Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.renderer
Interface RenderManager

All Superinterfaces:
JiveManager

public interface RenderManager
extends JiveManager

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 addRenderPlugin(com.jivesoftware.community.renderer.RenderPlugin filter)
          Adds a new filter to the filter stack.
 void addRenderPlugin(String clazz)
          Installs a new class into the list of render pugins for the system.
 void disablePluginForField(com.jivesoftware.community.renderer.RenderPlugin plugin, JiveContentObject.Field field)
          Disables a plugin for a field
 void enablePluginForField(com.jivesoftware.community.renderer.RenderPlugin plugin, JiveContentObject.Field field)
          Enables a plugin for a field
 List<JiveContentObject.Field> getEnabledFields(com.jivesoftware.community.renderer.RenderPlugin plugin)
          Returns a list of fields that are enabled for a plugin
 int getLocalRenderPluginCount()
          Returns the count of currently installed render plugins.
 RenderManager getRenderManager(JiveContainer container)
          Returns the RenderManager associated with the container.
 com.jivesoftware.community.renderer.RenderPlugin getRenderPlugin(String name)
          Return the render filter with the specified name
 List<com.jivesoftware.community.renderer.RenderPlugin> getRenderPlugins()
          Returns an array of RenderFilter objects that list all the currently configured render filters.
 void removeAllPlugins()
          Removes all filters from the current context.
 void removeRenderPlugin(String name)
          Removes the specified filter from the list of currently configured filters.
 String render(JiveObject source, RenderStrategy strategy, Document doc)
          Applies filters to the specified string.
 String render(JiveObject source, RenderStrategy strategy, String string)
          Applies filters to the specified string.
 String renderField(JiveContentObject source, RenderStrategy strategy, JiveContentObject.Field field)
          Applies filters to the specified string.
 void save()
          Saves all plugins and associated properties to the persistent store.
 void setRenderPlugins(List<com.jivesoftware.community.renderer.RenderPlugin> plugins)
          Sets render plugins.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

renderField

String renderField(JiveContentObject source,
                   RenderStrategy strategy,
                   JiveContentObject.Field field)
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.
field - the Field to render.
Returns:
the rendered string.
See Also:
RenderType

render

String render(JiveObject source,
              RenderStrategy strategy,
              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.
strategy - the render strategy to use to render the string.
string - the string to render.
Returns:
the rendered string.
See Also:
RenderType

render

String render(JiveObject source,
              RenderStrategy strategy,
              Document doc)
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.
strategy - the render strategy to use to render the string.
doc - the document to render.
Returns:
the rendered string.
See Also:
RenderType

getLocalRenderPluginCount

int getLocalRenderPluginCount()
                              throws UnauthorizedException
Returns the count of currently installed render plugins.

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

getRenderPlugin

com.jivesoftware.community.renderer.RenderPlugin getRenderPlugin(String name)
                                                                 throws UnauthorizedException
Return the render filter with the specified name

Parameters:
name - the name of the filter to return
Returns:
the RenderFilter at the specified index.
Throws:
UnauthorizedException - if not an administator.
IndexOutOfBoundsException - if the filterIndex is not valid.

getRenderPlugins

List<com.jivesoftware.community.renderer.RenderPlugin> getRenderPlugins()
                                                                        throws UnauthorizedException
Returns an array of RenderFilter objects that list all the currently configured render filters.

Returns:
a list of all configured render plugins.
Throws:
UnauthorizedException - if not a system administator.

addRenderPlugin

void addRenderPlugin(String clazz)
                     throws UnauthorizedException,
                            ClassNotFoundException
Installs a new class into the list of render pugins 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:
clazz - the fully qualified name of the class to add to the list of available render plugins in the system.
Throws:
UnauthorizedException - if not a system administator.
ClassNotFoundException - if the class could not be loaded.

setRenderPlugins

void setRenderPlugins(List<com.jivesoftware.community.renderer.RenderPlugin> plugins)
                      throws UnauthorizedException
Sets render plugins.

Parameters:
plugins - list of render plugins to add to the system.
Throws:
UnauthorizedException - if not a system administator.

addRenderPlugin

void addRenderPlugin(com.jivesoftware.community.renderer.RenderPlugin filter)
Adds a new filter to the filter stack. This filter's settings will not be persisted. This expects that the filter will be installed the next time the appserver starts by something like the plugin framework.

Parameters:
filter - The render filter instance to add.

removeRenderPlugin

void removeRenderPlugin(String name)
                        throws UnauthorizedException
Removes the specified filter from the list of currently configured filters.

Parameters:
name - the name of the plugin to remove.
Throws:
UnauthorizedException - if not an administator.

save

void save()
          throws UnauthorizedException
Saves all plugins and associated properties 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.

removeAllPlugins

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

Throws:
UnauthorizedException - if not an admin

getRenderManager

RenderManager getRenderManager(JiveContainer container)
Returns the RenderManager associated with the container.


enablePluginForField

void enablePluginForField(com.jivesoftware.community.renderer.RenderPlugin plugin,
                          JiveContentObject.Field field)
Enables a plugin for a field

Parameters:
plugin - plugin to enable
field - field to enable on

disablePluginForField

void disablePluginForField(com.jivesoftware.community.renderer.RenderPlugin plugin,
                           JiveContentObject.Field field)
Disables a plugin for a field

Parameters:
plugin - plugin to enable
field - field to enable on

getEnabledFields

List<JiveContentObject.Field> getEnabledFields(com.jivesoftware.community.renderer.RenderPlugin plugin)
Returns a list of fields that are enabled for a plugin

Parameters:
plugin - plugin to enable
Returns:
list of fields

Clearspace Project Page

Copyright © 1999-2007 Jive Software.