Installation

In this chapter you will see how to install the Logibit WebTools into Apache Cocoon.

Step 1: Download, extract and copy

After you have downloaded the Logabit WebTools package from here, unzip it and then add the jar file logabit-webtools-xx.jar to your WEB-INF/lib directory of your Cocoon application.

Step 2: Register Patchwork in cocoon.xconf

In the next step you need to register the different WebTools components within your WEB-INF/cocoon.xconf configuration file by adding the lines shown below directly under the element <cocoon version="2.1">:

<component role="com.logabit.webtools.patchwork.PatchworkManager" class="com.logabit.webtools.patchwork.PatchworkManagerImpl">
  <parameter name="patchwork-config" value="webtools/config/patchwork.xml"/>
  <parameter name="request-name" value="patchwork"/>
</component>

<component role="com.logabit.webtools.patchwork.PatchworkConfigurationParser"
   class="com.logabit.webtools.patchwork.PatchworkConfigurationParserImpl"/>
   
<component role="com.logabit.webtools.navigation.NavigationManager"
  class="com.logabit.webtools.navigation.NavigationManagerImpl">
     <parameter name="navigation-def-path" value="webtools/config/naviwork.xml"/>
</component>
  • patchwork-config - This optional parameter tells the Patchwork manager where to find the Patchwork configuration file. This can be any uri which is supported by Cocoon's source resolver. If the path is a relatively one, it will be interpreted relatively to the root sitemap of Cocoon. If no such parameter is given, the default points to patchwork.xml. This means that a file called patchwork.xml is expected in the same folder as the root sitemap resides.
  • request-name - On each request, a layout object will be created. This object holds information about the currently requested layout like its name or its includes. To allow to read this layout object from within other components and the view, Patchwork places this object into the current request as attribute. The optional parameter request-name defines the name of the request attribute to be used. If no such parameter is given, the name patchwork will be used.
  • navigation-def-path - This optional parameter tells the Naviwork manager where to find the naviwork configuration file. This can be any uri which is supported by Cocoon's source resolver. If the path is a relatively one, it will be interpreted relatively to the root sitemap of Cocoon. If no such parameter is given, the default points to naviwork.xml. This means that a file called naviwork.xml is expected in the same folder as the root sitemap resides.