public class DefaultRenderingManager extends java.lang.Object implements RenderingManager
This class also delegates to a rendering cache, i.e. documents are stored between calls. You may control the cache by tweaking the ehcache configuration file.
PROP_BEAUTIFYTITLE, PROP_PARSER, PROP_RENDERER, PROP_WYSIWYG_RENDERER| Constructor and Description |
|---|
DefaultRenderingManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(WikiEvent event)
Flushes the document cache in response to a POST_SAVE_BEGIN event.
|
java.lang.String |
beautifyTitle(java.lang.String title)
Beautifies the title of the page by appending spaces in suitable places, if the user has so decreed in the properties when
constructing this Engine.
|
java.lang.String |
beautifyTitleNoBreak(java.lang.String title)
Beautifies the title of the page by appending non-breaking spaces in suitable places.
|
java.lang.String |
getHTML(Context context,
Page page)
Returns the converted HTML of the page using a different context than the default context.
|
java.lang.String |
getHTML(Context context,
WikiDocument doc)
Simply renders a WikiDocument to a String.
|
java.lang.String |
getHTML(java.lang.String pagename,
int version)
Returns the converted HTML of the page's specific version.
|
MarkupParser |
getParser(Context context,
java.lang.String pagedata)
Returns the wiki Parser
|
WikiDocument |
getRenderedDocument(Context context,
java.lang.String pagedata)
Returns a cached document, if one is found.
|
WikiRenderer |
getRenderer(Context context,
WikiDocument doc)
Returns a WikiRenderer instance, initialized with the given context and doc.
|
WikiRenderer |
getWysiwygRenderer(Context context,
WikiDocument doc)
Returns a WikiRenderer instance meant for WYSIWYG editing, initialized with the given
context and doc.
|
void |
initialize(Engine engine,
java.util.Properties properties)
Checks for cache size settings, initializes the document cache.
|
java.lang.String |
textToHTML(Context context,
java.lang.String pagedata) |
java.lang.String |
textToHTML(Context context,
java.lang.String pagedata,
StringTransmutator localLinkHook,
StringTransmutator extLinkHook,
StringTransmutator attLinkHook,
boolean parseAccessRules,
boolean justParse)
Helper method for doing the HTML translation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHTML, getHTML, textToHTML, textToHTMLpublic DefaultRenderingManager()
public void initialize(Engine engine, java.util.Properties properties) throws WikiException
initialize in interface InitializableWikiExceptionpublic java.lang.String beautifyTitle(java.lang.String title)
beautifyTitle in interface RenderingManagertitle - The title to beautifypublic java.lang.String beautifyTitleNoBreak(java.lang.String title)
beautifyTitleNoBreak in interface RenderingManagertitle - The title to beautifypublic MarkupParser getParser(Context context, java.lang.String pagedata)
getParser in interface RenderingManagerpagedata - the page datapublic WikiDocument getRenderedDocument(Context context, java.lang.String pagedata)
getRenderedDocument in interface RenderingManagercontext - the wiki contextpagedata - the page datapublic java.lang.String getHTML(Context context, WikiDocument doc) throws java.io.IOException
getHTML in interface RenderingManagercontext - The WikiContext to render indoc - A proper WikiDocumentjava.io.IOException - If the WikiDocument is poorly formed.public java.lang.String getHTML(Context context, Page page)
getHTML in interface RenderingManagercontext - A WikiContext in which you wish to render this page in.page - WikiPage reference.public java.lang.String getHTML(java.lang.String pagename, int version)
getHTML in interface RenderingManagerpagename - WikiName of the page to convert.version - Version number to fetchpublic java.lang.String textToHTML(Context context, java.lang.String pagedata)
textToHTML in interface RenderApipublic java.lang.String textToHTML(Context context, java.lang.String pagedata, StringTransmutator localLinkHook, StringTransmutator extLinkHook, StringTransmutator attLinkHook, boolean parseAccessRules, boolean justParse)
textToHTML in interface RenderingManagercontext - The WikiContext in which to do the conversionpagedata - The data to renderlocalLinkHook - Is called whenever a wiki link is foundextLinkHook - Is called whenever an external link is foundparseAccessRules - Parse the access rules if we encounter themjustParse - Just parses the pagedata, does not actually render. In this case, this methods an empty string.public WikiRenderer getRenderer(Context context, WikiDocument doc)
getRenderer in interface RenderingManagercontext - The WikiContextdoc - The document to renderpublic WikiRenderer getWysiwygRenderer(Context context, WikiDocument doc)
getWysiwygRenderer in interface RenderingManagercontext - The WikiContextdoc - The document to renderpublic void actionPerformed(WikiEvent event)
Flushes the document cache in response to a POST_SAVE_BEGIN event.
actionPerformed in interface WikiEventListenerWikiEventListener.actionPerformed(WikiEvent)Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.