JSR 168 and JSPWiki

In case you are looking for a Wiki you can integrate into your Portal you will likely search for "JSR 168 Wiki" in Google & Co. This search reveals not much information whether there is a wiki portlet.

Just by luck I discovered that JSPWiki is already integrated as portlet in many Open Source Portal solution: JBoss, Liferay and Sun Glasfish. The status of the integration differs much. While the integration into Liferay is already very good, the integration into JBoss is still Beta2 and lacks attention of the JBoss community. Last friday, JBoss anounced that JBoss wiki will be from now actively maintained by Piergiorgio Lucidi and Luca Stancapiano.

I’m just wondering why there are so many Wiki products out there but no support for integration into a Java Portal which is already a common standard in an enterprise.


The difference between a structured and unstructured wiki

Before you choose a wiki application you must decide whether you are going to use an unstructured wiki like wikipedia or an structured wiki like dekiwiki or confluence.

The difference is simple but with a big consequence:
  • unstructured wikis organize wiki pages by their page name. They have a flat space with wiki pages whoose page names are unique in the whole wiki.
  • structured wikis organize their wiki pages similar to a file system with directories. In that case every wiki page represents a directory which may contain sub pages. The page name has to be unique only within one directory.


Unstructured wikis need a process to resolve the conflicts that occur when articles about two or more different topics could have the same "natural" page title. The page name"ARM" could mean the financial term "Adjustable rate mortgage" or "Advanced RISC Machine". See Disambiguation in Wikipedia for more details. This process is ideal for open communities where many people organize and categorize pages.

Structured Wikis avoid this problem due to their page structure, e.g. /Finance/ARM or /Computer/ARM. As consequence you need a common understanding about the root directory (page) structure and should not change it frequently. In an Enterprise you have naturally this kind of structure, due to the nature how an Enterprise is organized (Finance, Marketing, Department, Development, etc.).


There is no simple way for unstructured wikis to enable advanced authorization for wiki pages.

Most structured wikis provide an advanced authorization mechanism, e.g. where you can apply autorization rules to a whole subtree at once.


In case you want to access to wiki pages attached files not only via webbrowser but also via Windows Explorer WebDAV offers here an elegant solution.
Unstructured Wikis don’t provide enough navigation information for the WebDAV user.
Structured Wikis can map their wiki page structure as WebDAV directory structure, which is an ideal approach for collaborating files.

Structured Wikis and WebDAV

Wiki WebDAV Comments
Confluence Yes  
JSPWiki Yes  
TWiki Yes*
Apache 2 servers are not supported.
Hierarchical webs are not supported
Xwiki Yes only supports basic authentication

Render a table content with Google barchart

This feature took me some time to figure out how to render the content of a normal table with the google chart mashup. Believe it or not it’s just one line of code and a trick when you have headers in the table.

The one line looks like the following:
{{google.piechart(400,200,xml.list(page.xml, “//tr/td[2]”),xml.list(page.xml, “//tr/td[1]”), _,true)}}

How it works:
Dekiscript is a powerful language to manipulate content inside and between wikipages. The google barchart expect to “list”, one with the labels and one with the values. The trick is to extract the table content with dekiscript by using xml.list and page.xml. with xml.list you perform the XPath-Query “//tr/td[2]” on the XML representation of a page (page.xml). When you call page.xml without any parameter the actual page is returned.

Hint 2: when you have a header line in your table you must manually change the tags of the first row to which means in HTML this is a header row. The google barchart will then exclude this row. Maybe someone has an idea to solve this more elegant.

Simple as possible. Great job of mindtouch.

Display several locations in Google Maps

Here is one simple example which explains how to display several adresses with google mashup and display them in parallel as table.

Dekiwiki pages provide something called a pagebus which allows several “objects” e.g. mashup to communicate. The basic idea how to solve this problem is to publish the adresses on the page bus and configure the google mashup and dhtml table to listen on one specific channel. As additional example I show how to add dynamically adresses via a dynamic form.


  • dhtml fetches all messages from the pagebus
  • google maps only fetches those messages which are published after it is displayed
  • google maps looks for messages with attributes “address” and “label”. Every other attribute is ignored
  • if you have an error it’s likely you have a typo

{{ dhtml.form([ { field:”restaurant”, label:”restaurant” }, { field:”address”, label:”address” } ] , “Add”,100,”data1″) }}

{{dhtml.table( [ { field:”restaurant”, label:”restaurant” }, { field:”address”, label:”address” } ] , “data1” ) }}

{{ google.Map{address: ” Vienna, Austria”, zoom: “12”,subscribe:”data1″} }}

{{ pagebus.publish { channel:”data1″, message: { restaurant:’Asian noodles’, address: ‘Karlsplatz 1, Vienna, Austria’, label: ‘Asian noodles’ } } }}

Add styles for ok, alert and todo

One simple trick to enhance the layout of your dekiwiki is to add custom styles to your editor.

Goto Control Panel>Customize>CustomCSS and add the following css fragment to the “Content CSS” section of the page:

.qok {background:#FFFBC5 url(/deki-cp/assets/images/icons/tick.gif) no-repeat scroll 10px center;border:1px solid #DEDEDE;margin:8px 0 0;padding:8px 8px 8px 35px}
.qinfo {background:#F2F7FA url(/deki-cp/assets/images/icons/information.gif) no-repeat scroll 10px center;border:1px solid #DEDEDE;margin:8px 0 0;padding:8px 8px 8px 35px}
.qerror {background:#FFFBC5 url(/deki-cp/assets/images/icons/cross.gif) no-repeat scroll 10px center;border:1px solid #DEDEDE;margin:8px 0 0;padding:8px 8px 8px 35px}
.qalert {background:#FFFBC5 url(/deki-cp/assets/images/icons/error.gif) no-repeat scroll 10px center;border:1px solid #DEDEDE;margin:8px 0 0;padding:8px 8px 8px 35px}
.comment {color:blue;font-style:italic;padding:8px 35px 8px 35px}

Maybe the URL for the icons is not working on your installation. In that case deploy your own icons to the webserver and update the image URLs to reflect the changes.