At line 1 changed one line |
''This page still under construction'' |
[{TableOfContents}] |
At line 3 changed one line |
Current known JSPWiki embedders: |
!!How does it all work? |
At line 5 removed 5 lines |
* [Roller Weblogger|http://rollerweblogger.org/wiki/Wiki.jsp?page=RollerWikiPlugin]. [Sample code|http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/roller/roller/src/org/roller/presentation/velocity/plugins/jspwiki/WikiPlugin.java?rev=1.4&content-type=text/vnd.viewcvs-markup] |
* [JabberMessageArchiving] |
|
!How does it all work? |
|
At line 16 changed one line |
!How to get a WikiEngine? |
!!How to get a WikiEngine? |
At line 29 changed one line |
Properties properties = new Propeties(); |
Properties properties = new Properties(); |
At line 38 changed one line |
!How do I get a WikiContext |
!!How do I get a WikiContext? |
At line 57 changed one line |
!How to use the TranslatorReader? |
!!How to get rendered page data? |
At line 59 changed one line |
After you have the WikiContext, you can simply create a new TranslatorReader by using |
If your page data is stored inside a JSPWiki repository, you can use the JSPWiki rendering code directly via the method ~WikiEngine.getHTML(): |
|
At line 57 added 9 lines |
String rendereddata = myWikiEngine.getHTML( wikiContext, page ); |
}}} |
|
The reason why you need to respecify the WikiPage you want to render is that in some occasions you may want to render a page within the context of another page, for example, the LeftMenu wants the ReferringPagesPlugin to get the referring pages of the page are viewing, not LeftMenu. |
|
!!How to use the TranslatorReader? |
|
If you have just a chunk of WikiMarkup, you don't want to store it in the Wiki page repository, but you want to render it directly. This can be accomplished by directly accessing a TranslatorReader. After you have the WikiContext, you can simply create a new TranslatorReader by using |
{{{ |
At line 69 changed one line |
!How can I vary the rendering? |
%%note |
Note: You will need to call any PageFilters manually, if you are directly accessing the TranslatorReader, as normally this is done by the WikiEngine. |
%% |
At line 71 changed one line |
TBA. |
!!How can I vary the rendering? |
At line 73 changed one line |
!What other information can I get from the TranslatorReader? |
Take a look at the Javadoc of TranslatorReader to get the most up-to-date information, but here are some things you can do. You can control some features by setting variables in the WikiContext before rendering, and some others by directly accessing the TranslatorReader. |
At line 75 changed one line |
TBA. |
!Switching off the plugin rendering |
At line 77 changed one line |
!What libraries (Jars) do I need? |
Say |
{{{ |
wikiContext.setVariable( TranslatorReader.PROP_RUNPLUGINS, "false" ); |
}}} |
At line 89 added 34 lines |
Alternatively, use |
{{{ |
translatorReader.enablePlugins( false ); |
}}} |
|
!Turn off image inlining |
|
No matter what jspwiki.properties says, this turns off any image inlining. |
{{{ |
translatorReader.enableImageInlining( false ); |
}}} |
|
!!What other information can I get from the TranslatorReader? |
|
TranslatorReader has a bunch of places where you can hook. I'm calling them hooks, because, well, I'm an old Amiga guy, and that word just sits better with me than "Listener". (This is a stub, more info needed.) |
|
!Modifying link text |
|
Hook to {{{ addLinkTransmutator() }}} |
|
!Collecting local links |
|
Add a listener with {{{addLocalLinkHook()}}}. |
|
!Collecting external hyperlinks |
|
Add a listener with {{{addExternalLinkHook()}}}. |
|
!Collecting attachment links |
|
Add a listener with {{{addAttachmentLinkHook()}}}. |
|
!!What libraries (Jars) do I need? |
|
At line 81 changed one line |
!How do I make JSPWiki's logging play nice with my app's Log4j setup? |
!!How do I make JSPWiki's logging play nice with my app's Log4j setup? |
At line 86 changed one line |
;:''BTW, I am not very adept at [log4j] config, so if someone else can help me out here, it would be cool. --[JanneJalkanen]. |
;:''BTW, I am not very adept at [log4j] config, so if someone else can help me out here, it would be cool. --[JanneJalkanen].'' |
|
!!!Current known JSPWiki embedders: |
|
* [Roller Weblogger|http://rollerweblogger.org/wiki/Wiki.jsp?page=RollerWikiPlugin]. [Sample code|http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/roller/roller/src/org/roller/presentation/velocity/plugins/jspwiki/WikiPlugin.java?rev=1.4&content-type=text/vnd.viewcvs-markup] |
* [JabberMessageArchiving] |
* [The Ceryle Project|http://purl.org/ceryle/] |