public class RenderingManager extends Object implements WikiEventListener, InternalModule
This class also manages a rendering cache, i.e. documents are stored between calls. You may control the cache by tweaking the ehcache.xml file.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PARSER
The name of the default renderer.
|
static String |
DEFAULT_RENDERER
The name of the default renderer.
|
static String |
DEFAULT_WYSIWYG_RENDERER
The name of the default WYSIWYG renderer.
|
static String |
DOCUMENTCACHE_NAME
Name of the regular page cache.
|
static String |
VAR_EXECUTE_PLUGINS
Variable name which tells whether plugins should be executed or not.
|
static String |
WYSIWYG_EDITOR_MODE
Name of the WikiContext variable which is set to Boolean.TRUE or Boolean.FALSE
depending on whether WYSIWYG is currently in effect.
|
Constructor and Description |
---|
RenderingManager() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(WikiEvent event)
Fired when a WikiEvent is triggered by an event source.
|
String |
getHTML(WikiContext context,
String pagedata)
Convenience method for rendering, using the default parser and renderer.
|
String |
getHTML(WikiContext context,
WikiDocument doc)
Simply renders a WikiDocument to a String.
|
MarkupParser |
getParser(WikiContext context,
String pagedata)
Returns the wiki Parser
|
protected WikiDocument |
getRenderedDocument(WikiContext context,
String pagedata)
Returns a cached document, if one is found.
|
WikiRenderer |
getRenderer(WikiContext context,
WikiDocument doc)
Returns a WikiRenderer instance, initialized with the given
context and doc.
|
WikiRenderer |
getWysiwygRenderer(WikiContext context,
WikiDocument doc)
Returns a WikiRenderer instance meant for WYSIWYG editing, initialized with the given
context and doc.
|
void |
initialize(WikiEngine engine,
Properties properties)
Initializes the RenderingManager.
|
public static final String DEFAULT_PARSER
public static final String DEFAULT_RENDERER
public static final String DEFAULT_WYSIWYG_RENDERER
public static final String DOCUMENTCACHE_NAME
public static final String WYSIWYG_EDITOR_MODE
public static final String VAR_EXECUTE_PLUGINS
Boolean.TRUE
or Boolean.FALSE
. While not set it's value is null
public RenderingManager()
public void initialize(WikiEngine engine, Properties properties) throws WikiException
engine
- A WikiEngine instance.properties
- A list of properties to get parameters from.WikiException
- If the manager could not be initialized.public MarkupParser getParser(WikiContext context, String pagedata)
pagedata
- the page dataprotected WikiDocument getRenderedDocument(WikiContext context, String pagedata) throws IOException
context
- the wiki contextpagedata
- the page dataIOException
- If rendering cannot be accomplishedpublic String getHTML(WikiContext context, WikiDocument doc) throws IOException
context
- The WikiContext to render indoc
- A proper WikiDocumentIOException
- If the WikiDocument is poorly formed.public WikiRenderer getRenderer(WikiContext context, WikiDocument doc)
context
- The WikiContextdoc
- The document to renderpublic WikiRenderer getWysiwygRenderer(WikiContext context, WikiDocument doc)
context
- The WikiContextdoc
- The document to renderpublic String getHTML(WikiContext context, String pagedata)
context
- the wiki contextpagedata
- the page datapublic void actionPerformed(WikiEvent event)
Flushes the document cache in response to a POST_SAVE_BEGIN event.
actionPerformed
in interface WikiEventListener
event
- a WikiEvent objectWikiEventListener.actionPerformed(org.apache.wiki.event.WikiEvent)
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.