Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.proxy
Class RenderManagerProxy

java.lang.Object
  extended by com.jivesoftware.forum.proxy.RenderManagerProxy
All Implemented Interfaces:
RenderManager
Direct Known Subclasses:
ForumRenderManagerProxy

public class RenderManagerProxy
extends java.lang.Object
implements RenderManager

A protection proxy for the RenderManager. A proxy has a set of permissions that are specified at creation time of the proxy. Subsequently, those permissions are use to restrict access to protected methods. If a user does not have the right to execute a particular method, an UnauthorizedException is thrown.

See Also:
Permissions, UnauthorizedException

Field Summary
protected  AuthToken authToken
           
protected  RenderManager manager
           
protected  long objectType
           
protected  Permissions permissions
           
 
Constructor Summary
protected RenderManagerProxy()
           
  RenderManagerProxy(RenderManager manager, long objectType, Permissions permissions)
           
 
Method Summary
 void addFilterRenderTypes(java.lang.String filterName, java.util.List renderTypes)
          Adds a set of render types for the given filter.
 void addRenderFilter(java.lang.String className)
          Installs a new class into the list of render filters for the system.
 void copyGlobalFilters()
          Copy all global filters to the current context.
 long getFilterRenderTypes(java.lang.String filterName)
          Returns the bitset render types installed for the filter at the given index.
 java.util.Map getInheritedRenderFilters()
          Retrieve the map of render filters -> renderTypes searching up the tree to the global level if no render filters are defined at the current/parent(s) level.
 AuthToken getProxyAuthToken()
           
 Permissions getProxyPermissions()
           
 RenderFilter getRenderFilter(java.lang.String filterName)
          Return the render filter with the specified name
 int getRenderFilterCount()
          Returns the count of currently installed render filters.
 RenderFilter[] getRenderFilters()
          Returns an array of RenderFilter objects that list all the currently configured render filters.
 RenderManager getUnproxiedObject()
           
 boolean isAdmin()
           
 void removeAllFilters()
          Removes all filters from the current context.
 void removeFilterRenderTypes(java.lang.String filterName, java.util.List renderTypes)
          Removes a set of render types from the given filter.
 void removeRenderFilter(java.lang.String filterName)
          Removes the specified filter from the list of currently configured filters.
 java.lang.String render(java.lang.Object source, RenderType renderType, RenderStrategy strategy, java.lang.String string)
          Applies filters to the specified string.
 java.lang.String render(java.lang.Object source, RenderType RenderType, java.lang.String string)
          Applies filters to the specified string.
 void save()
          Saves all filters to the persistent store.
 void setObjectType(long objectType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected RenderManager manager

objectType

protected long objectType

authToken

protected AuthToken authToken

permissions

protected Permissions permissions
Constructor Detail

RenderManagerProxy

protected RenderManagerProxy()

RenderManagerProxy

public RenderManagerProxy(RenderManager manager,
                          long objectType,
                          Permissions permissions)
Method Detail

setObjectType

public void setObjectType(long objectType)

render

public java.lang.String render(java.lang.Object source,
                               RenderType RenderType,
                               java.lang.String string)
Description copied from interface: RenderManager
Applies filters to the specified string. The source object for which we're rendering the string is needed since a render filter or macro may require it to properly determine what to render. The renderType will be used to generate the list of filter to apply to the passed in string.

The RenderStrategy.RENDER_ALL render stategy will be used.

Specified by:
render in interface RenderManager
Parameters:
source - the source object for which we're rendering a string for.
RenderType - the render type to use to determine which filters to apply.
string - the string to render.
Returns:
the rendered string.
See Also:
RenderType

render

public java.lang.String render(java.lang.Object source,
                               RenderType renderType,
                               RenderStrategy strategy,
                               java.lang.String string)
Description copied from interface: RenderManager
Applies filters to the specified string. The source object for which we're rendering the string is needed since a render filter or macro may require it to properly determine what to render. The renderType will be used to the proper list of filters to apply to the passed in string.

Specified by:
render in interface RenderManager
Parameters:
source - the source object for which we're rendering a string for.
renderType - the render type to use to determine which filters to apply.
strategy - the render strategy to use to render the string.
string - the string to render.
Returns:
the rendered string.
See Also:
RenderType

getRenderFilters

public RenderFilter[] getRenderFilters()
                                throws UnauthorizedException
Description copied from interface: RenderManager
Returns an array of RenderFilter objects that list all the currently configured render filters.

Specified by:
getRenderFilters in interface RenderManager
Returns:
an array of all configured render filters.
Throws:
UnauthorizedException - if not a system administator.

addRenderFilter

public void addRenderFilter(java.lang.String className)
                     throws UnauthorizedException,
                            java.lang.ClassNotFoundException,
                            java.lang.IllegalArgumentException
Description copied from interface: RenderManager
Installs a new class into the list of render filters for the system. Exceptions are thrown if you're not a system administrator, the class can't be loaded from the classpath, or the class isn't an instance of RenderFilter.

Specified by:
addRenderFilter in interface RenderManager
Parameters:
className - the fully qualified name of the class to add to the list of available render filters in the system.
Throws:
UnauthorizedException - if not a system administator.
java.lang.ClassNotFoundException - if the class could not be loaded.
java.lang.IllegalArgumentException

getRenderFilterCount

public int getRenderFilterCount()
                         throws UnauthorizedException
Description copied from interface: RenderManager
Returns the count of currently installed render filters.

Specified by:
getRenderFilterCount in interface RenderManager
Returns:
a count of the currently installed render filters.
Throws:
UnauthorizedException - if not an administator.

getRenderFilter

public RenderFilter getRenderFilter(java.lang.String filterName)
                             throws UnauthorizedException,
                                    java.lang.IndexOutOfBoundsException
Description copied from interface: RenderManager
Return the render filter with the specified name

Specified by:
getRenderFilter in interface RenderManager
Parameters:
filterName - the name of the filter to return
Returns:
the RenderFilter with the given name, or null if no such filter exists.
Throws:
UnauthorizedException - if not an administator.
java.lang.IndexOutOfBoundsException

removeRenderFilter

public void removeRenderFilter(java.lang.String filterName)
                        throws UnauthorizedException
Description copied from interface: RenderManager
Removes the specified filter from the list of currently configured filters.

Specified by:
removeRenderFilter in interface RenderManager
Parameters:
filterName - the name of the filter to remove.
Throws:
UnauthorizedException - if not an administator.

getFilterRenderTypes

public long getFilterRenderTypes(java.lang.String filterName)
                          throws UnauthorizedException
Description copied from interface: RenderManager
Returns the bitset render types installed for the filter at the given index.

Specified by:
getFilterRenderTypes in interface RenderManager
Parameters:
filterName - the name of the filter.
Returns:
a bitset of render types for the given filter.
Throws:
UnauthorizedException - if not an administator.

addFilterRenderTypes

public void addFilterRenderTypes(java.lang.String filterName,
                                 java.util.List renderTypes)
                          throws UnauthorizedException
Description copied from interface: RenderManager
Adds a set of render types for the given filter.

Specified by:
addFilterRenderTypes in interface RenderManager
Parameters:
filterName - the name of the filter.
renderTypes - a list of render types to add.
Throws:
UnauthorizedException - if not an administator.

removeFilterRenderTypes

public void removeFilterRenderTypes(java.lang.String filterName,
                                    java.util.List renderTypes)
                             throws UnauthorizedException
Description copied from interface: RenderManager
Removes a set of render types from the given filter.

Specified by:
removeFilterRenderTypes in interface RenderManager
Parameters:
filterName - the name of the filter.
renderTypes - a list of render types to remove.
Throws:
UnauthorizedException - if not an administator.

save

public void save()
          throws UnauthorizedException
Description copied from interface: RenderManager
Saves all filters to the persistent store. This method should be called after setting any properties on individual filters that are being managed by this render manager.

Warning: Calling this method will expire all pertinent caches so that cache consistency is maintained.

Specified by:
save in interface RenderManager
Throws:
UnauthorizedException - if not a system administator.

isAdmin

public boolean isAdmin()

copyGlobalFilters

public void copyGlobalFilters()
                       throws java.lang.IllegalStateException,
                              UnauthorizedException
Description copied from interface: RenderManager
Copy all global filters to the current context. If the current context already has 1 or more filters configured an IllegalStateException will be thrown.

Specified by:
copyGlobalFilters in interface RenderManager
Throws:
java.lang.IllegalStateException - if the current context already has 1 or more filters configured
UnauthorizedException - if not an admin

removeAllFilters

public void removeAllFilters()
                      throws UnauthorizedException
Description copied from interface: RenderManager
Removes all filters from the current context.

Specified by:
removeAllFilters in interface RenderManager
Throws:
UnauthorizedException - if not an admin

getInheritedRenderFilters

public java.util.Map getInheritedRenderFilters()
Description copied from interface: RenderManager
Retrieve the map of render filters -> renderTypes searching up the tree to the global level if no render filters are defined at the current/parent(s) level.

Specified by:
getInheritedRenderFilters in interface RenderManager
Returns:
a map (RenderFilter -> Long of render types)

getProxyAuthToken

public AuthToken getProxyAuthToken()

getProxyPermissions

public Permissions getProxyPermissions()

getUnproxiedObject

public RenderManager getUnproxiedObject()

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.