Wiki Creole is a common wiki markup that works across different wiki engines. For more details, see http://www.wikicreole.org/. You can test creole markup at http://www.wikicreole.org/creole-sandbox/.

Wiki Creole is not an official JSPWiki 2.6 Feature right now, please see the discussion in the mailinglist for details... http://www.mail-archive.com/jspwiki-dev@incubator.apache.org/msg00845.html. WikiCreole support is currently provided by the CreoleFilter.

Creole Filter#

The creole page filter implements the common wiki markup http://www.wikicreole.org for JSPWiki in mixed mode. This means you can use original JSPWiki markup and Creole markup together. It allows easy migration of existing wiki installations. It's maintained by the i3G Institute.

Download and Installation#

Download the binary at http://www.i3g.hs-heilbronn.de/Wiki.jsp?page=JSPWikiCreoleFilter and copy it into your JSPWiki/WEB-INF/lib directory.

To activate the CreoleFilter, add this to your filters.xml

	<filter>
		<class>org.wikiwizard.jspwiki.filters.CreoleFilter</class>
	</filter>

You now have to configure the behavior of the filter through properties. Copy this section into your jspwiki.properties file

##############################################################################
#
# Creole Translator configuration
# see http://www.wikicreole.org
#
# JSPWiki comes with a Creole filter that needs to be activated first in the
# filters.xml. The properties below allow you to define the behavior of 
# the following features
#
# * Change date signature format for the --~~~~ markup
# * Define which plugin and which parameters to use for the creole image markup {{x}}
#

#
# === Signature Configuration ===
# set the date format for the Wikipedia style --~~~~ signatures 
# to something like 2007-Apr-01 12:15 (UTC-1)
# see http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
# for the syntax rules.
creole.dateFormat = yyyy-MMM-dd HH:mm (zz)

# === Image Configuration ===
# You can configure, which plugin of jspwiki will be used
# to display images. For example if you don't specify anyting the markup:
# 
# {{Image.jpg|My Image}}
# 
# will be translated by default to
# 
# [{Image src='Image.jpg' title='My Image'}].
#  
# You can change this e.g. to ImageX plugin for advanced 
# features like server side resize etc. with the imagePlugin.name parameter
# e.g. creole.imagePlugin.name = ImageX
# 
# Parameters will be indicated by the third parameter in the
# Creole Syntax (the second one is defined as title)
# e.g.
#
# {{Image.jpg|My Image|-X-, M}}
# {{Image.jpg|My Image|M, +X+, [-]}}
#
# Parameters are seperated by comma, characters are case insensitive, however
# you have to define them in the property files in Uppercase(!).
# Note that parameters are not standardized in Creole. The parameters below
# are just a suggestion.
#
creole.imagePlugin.name = Image

#creole.imagePlugin.name = ImageX
#creole.imagePlugin.src = src
#creole.imagePlugin.caption = caption

creole.imagePlugin.para.S = width='140'
creole.imagePlugin.para.M = width='180'
creole.imagePlugin.para.L = width='360'
creole.imagePlugin.para.XL = width='540'
creole.imagePlugin.para.XXL = width='1024'
creole.imagePlugin.para.%px = width='%px"

#creole.imagePlugin.para.X- = align='left'
#creole.imagePlugin.para.-X = align='right'
#creole.imagePlugin.para.-X- = align='center'

#creole.imagePlugin.para.X+ = float='left'
#creole.imagePlugin.para.+X = float='right'
#creole.imagePlugin.para.+X+ = float='center'

#creole.imagePlugin.para.[+] = border=true
#creole.imagePlugin.para.[-] = border=false



#
# Linebreak Mode
# This is an experimental feature, see
# http://www.wikicreole.org/wiki/ChangeLinebreakMarkupProposal
#
# creole.blogLineBreaks = true

Debugging#

Use the following code to find out status information about your currently installed filter. This will help you to find out and report problems...

* Version: <<$creolepagefilter.version>>
* CreoleVersion: <<$creolepagefilter.creoleversion>>
* ImagePlugin: <<$creolepagefilter.imageplugin>>
* Linebreak: <<$creolepagefilter.linebreak>>

Known Issues#

Finally there are some minor issues that I've found when using the filter with the test cases for creole:

  • URLs are not automatically converted
  • The constructions foo://bar makes 'bar' become cursive and it shouldn't
  • Lists that become with spaces (before the asterisk or hash) are not
correctly rendered
  • Multi line lists are not properly rendered. The second line is not
included in the LI

Hi,

I tried using the CreoleFilter. However, I get the following stack trace in Tomcat 5.5.23. I've looked through the JavaDocs and I can't see where the CreoleFilter actually implements the J2EE Filter interface.

Cheers,

Andrew.

java.lang.ClassCastException: com.ecyrd.jspwiki.filters.CreoleFilter
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:208)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1206)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
	at java.lang.Thread.run(Unknown Source)

--AnonymousCoward, 14-Jul-2007


It's not a J2EE Filter, it's a JSPWiki PageFilter. You have to add in your JSPWiki filters.xml, as stated above.

--JanneJalkanen, 14-Jul-2007


D'OH! Thanks.

Andrew.

--AnonymousCoward, 17-Jul-2007


Can't seem to get this working in 2.5.165. Can't find a filters.xml file, so added <filter> element in web.xml, where others are. Tried syntax above and also mirrored pre-existing syntax like:

   <filter>                                                           
      <filter-name>CreoleFilter</filter-name>                         
      <filter-class>com.ecyrd.jspwiki.filters.CreoleFilter</filter-class>
   </filter>                                                          

Result in both cases is 404 error with resource (/JSPWiki/) not available.

Commenting out added <filter> element restores functionality.
--StephenBlack, 06-Dec-2007


Ah. Found filters.xml instructions on PageFilterConfiguration and it's all good now.

--Stephen Black, 10-Dec-2007

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-16) was last changed on 02-Apr-2008 10:36 by 141.7.56.2