Jive Forums API (5.5.20.2-oracle) Core Javadocs

com.jivesoftware.forum.renderer
Interface RenderManager


public interface RenderManager

A manager to manage filters to be used for render operations. This manager contains both adminstrative and user oriented methods; most uses of this manager will use the render methods to render wiki to html, html to wiki, etc as determined by a render context.

See Also:
Renderer, RenderFilter, RenderMacro

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.
 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.
 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.
 

Method Detail

render

java.lang.String render(java.lang.Object source,
                        RenderType renderType,
                        java.lang.String string)
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.

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

java.lang.String render(java.lang.Object source,
                        RenderType renderType,
                        RenderStrategy strategy,
                        java.lang.String string)
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.

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

getRenderFilterCount

int getRenderFilterCount()
                         throws UnauthorizedException
Returns the count of currently installed render filters.

Returns:
a count of the currently installed render filters.
Throws:
UnauthorizedException - if not an administator.

getRenderFilter

RenderFilter getRenderFilter(java.lang.String filterName)
                             throws UnauthorizedException
Return the render filter with the specified name

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.

getRenderFilters

RenderFilter[] getRenderFilters()
                                throws UnauthorizedException
Returns an array of RenderFilter objects that list all the currently configured render filters.

Returns:
an array of all configured render filters.
Throws:
UnauthorizedException - if not a system administator.

addRenderFilter

void addRenderFilter(java.lang.String className)
                     throws UnauthorizedException,
                            java.lang.ClassNotFoundException
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.

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.

removeRenderFilter

void removeRenderFilter(java.lang.String filterName)
                        throws UnauthorizedException
Removes the specified filter from the list of currently configured filters.

Parameters:
filterName - the name of the filter to remove.
Throws:
UnauthorizedException - if not an administator.
java.lang.IndexOutOfBoundsException - if the filterIndex is not valid.

getFilterRenderTypes

long getFilterRenderTypes(java.lang.String filterName)
                          throws UnauthorizedException
Returns the bitset render types installed for the filter at the given index.

Parameters:
filterName - the name of the filter.
Returns:
a bitset of render types for the given filter.
Throws:
UnauthorizedException - if not an administator.
java.lang.IndexOutOfBoundsException - if the filterIndex is not valid.

addFilterRenderTypes

void addFilterRenderTypes(java.lang.String filterName,
                          java.util.List renderTypes)
                          throws UnauthorizedException
Adds a set of render types for the given filter.

Parameters:
filterName - the name of the filter.
renderTypes - a list of render types to add.
Throws:
UnauthorizedException - if not an administator.
java.lang.IndexOutOfBoundsException - if the filterIndex is not valid.

removeFilterRenderTypes

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

Parameters:
filterName - the name of the filter.
renderTypes - a list of render types to remove.
Throws:
UnauthorizedException - if not an administator.
java.lang.IndexOutOfBoundsException - if the filterIndex is not valid.

save

void save()
          throws UnauthorizedException
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.

Throws:
UnauthorizedException - if not a system administator.

getInheritedRenderFilters

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.

Returns:
a map (RenderFilter -> Long of render types)

copyGlobalFilters

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

Throws:
java.lang.IllegalStateException - if the current context already has 1 or more filters configured
UnauthorizedException - if not an admin

removeAllFilters

void removeAllFilters()
                      throws UnauthorizedException
Removes all filters from the current context.

Throws:
UnauthorizedException - if not an admin

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.