[ info ]   [ edit ]

Using as a Component

This page describes how you can embed a Pinkwino wiki within your existing java web application. It assumes you are a programmer, experienced with java, jsp and tomcat.

First you need to assemble the required pieces within you web application. Here are a list of files within the pinkwino code that you need to include within your own webapp :

WEB-INF/pinkwino.tld

Simply copy (or link) to your own webapp's WEB-INF directory.

WEB-INF/web.xml

You will need to merge pinkwino's web.xml file with your own webapp's web.xml file. Specifically, all of pinkwino's servlet, servlet-mapping and listener tags need to be included.

WEB-INF/lib/*.jar

Copy all of the jar files that pinkwino uses into your webapp's lib directory.

WEB-INF/classes/common_*.bsh

These are the default configuration files that pinkwino will use.

WEB-INF/classes/pinkwino.bsh

You will also need the "master" configuration file. You have two choices, either create/alter the file WEB-INF/classes/pinkwino.bsh, or you can put the configuration file anywhere in the file system (not in the webapp), and register the location of this file within tomcat's servler.xml file like this :

<Context path="/mywebapp" docBase="/home/nick/mywebapp">
  <Parameter name="pinkwino.initscript"
    value="/home/nick/mywebapp-pinkwino-config.bsh"
    override="false"/>
</Context>

The second approach is preferable if you want to have one war file for both testing and live versions, but two different configuration files.

wiki

Copy (or link) the whole "wiki" directory. This contains the jsp files required by pinkwino.

wiki/templates/

It is likely that you will want to create your own template, so that pinkwino looks and feels the same as the rest of your web application.

Customisation

Changing the pinkwino urls

By default, the url for editing a wiki comment will be :

/yourwebapp/edit/pagename

This may conflict with your own webapp's urls. If so, you can change them. Do do this :

  1. change the servlet mappings in WEB-INF/web.xml
  2. Make a copy of WEB-INF/classes/common_urlManager
  3. Change your pinkwino config file, and change the line : wikiEngine.initialiseFromClasspath( "common_urlManager.bsh" );