org.jboss.wiki
Class WikiPlugin

java.lang.Object
  extended by org.jboss.wiki.WikiPlugin

public abstract class WikiPlugin
extends java.lang.Object

Author:
Damon Sicore
, Tomasz Szymanski


This class is used for making own plugins, that allow page processing.

From inside WikiPlugin you can acess WikiEngine, WikiPage you're processing and some session attributes passed to the plugin in WikiSession.

They are:

AttributeTypeWhat is it?
actionURLStringAction url to create links
hostURLStringUrl of the host
credentialsorg.jboss.wiki.CredentialsCredentials of browsing user

Also if you add to actionURL parameter val1 val2 ... valn they will be all added to WikiSesion and passed to plugins.

To add a plugin to a WikiType you have to add coresponding xml part to wiki-common/src/etc/WikiTypes.xml:
        <plugin>
                <name>plugin name</name>
                <class>plugin class<name>
        </plugin>
 
See Also:
WikiInsidePlugin

Constructor Summary
WikiPlugin()
           
 
Method Summary
 java.lang.String getName()
          Returns name of that plugin.
abstract  void init()
          It's run after initiating plugin.
abstract  org.jboss.wiki.WikiPage process(org.jboss.wiki.WikiPage wikiPage, org.jboss.wiki.WikiSession wikiSession)
          Processes given WikiPage and returns processed one.
 void setName(java.lang.String name)
          Sets name of current plugin.
 void setWikiEngine(org.jboss.wiki.WikiEngine wikiEngine)
          Sets WikiEngine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiPlugin

public WikiPlugin()
Method Detail

process

public abstract org.jboss.wiki.WikiPage process(org.jboss.wiki.WikiPage wikiPage,
                                                org.jboss.wiki.WikiSession wikiSession)
Processes given WikiPage and returns processed one.

Parameters:
wikiPage - WikiPage to process
wikiSession - Session for passing attributes and getting some stuff from it.
Returns:
Processed WikiPage

init

public abstract void init()
It's run after initiating plugin.


setWikiEngine

public void setWikiEngine(org.jboss.wiki.WikiEngine wikiEngine)
Sets WikiEngine. If you're not sure why would you like to override it, leave that one.

Parameters:
wikiEngine -

getName

public java.lang.String getName()
Returns name of that plugin.

Returns:
name of current plugin.

setName

public void setName(java.lang.String name)
Sets name of current plugin.

Parameters:
name - Name of the plugin.