Trying again to build Cocoon/eXist
Posted by mholmes on 14 Oct 2009 in Activity log
My current attempt, based on some back-and-forth with WM, goes like this:
- Replace the
build.xml
,exist-gump.xsl
andexist-jars.xsl
with the ones from here:
http://exist.svn.sourceforge.net/viewvc/exist?view=rev&revision=10205 - Download a fresh Cocoon 2.1.11.
- Patch the Cocoon blocks.properties with a local.blocks.properties which disables Lucene and querybean, per WM's instructions.
- Check the build/scripts/cocoon/build.properties file in $EXIST_HOME to make sure it points to your local $COCOON_HOME instead of WM's
- Sign the eXist jars: in $EXIST_HOME
./build.sh -f build/scripts/jarsigner.xml
- Build eXist: in $EXIST_HOME
./build.sh -f build/scripts/cocoon/build.xml
- Clean up the Cocoon tree: in $COCOON_HOME
./build.sh clean
- Rebuild the Cocoon webapp: in $COCOON_HOME
./build.sh
- Copy
ws-commons-util-1.0.2.jar
andsunxacml-1.2.jar
fromEXIST_HOME/lib/core
into the generatedCOCOON/build/webapp/WEB-INF/lib
- Copy my own TitleSortComparator.jar and xqSearchUtils.jar into the same folder (optional for the moment)
- Copy the generated
webapp
folder to [Tomcat]/webapps, and rename itcocoon
. - Start Tomcat.
- Confirm that Cocoon and eXist are running.
- Try the JNLP: It should startup OK.
- Connect using the client: $EXIST_HOME/bin,
./client.sh
, then connect toxmldb:exist://localhost:8080/cocoon/xmlrpc
- Using either the client or the JNLP, upload documents, then create a backup to make the process simpler in future.
- Shut down Tomcat.
- Add
saxon9he.jar
to[cocoon]/WEB-INF/lib
. - Change
web.xml
to set all encodings to UTF-8 (some are still 8859-1 in the default setup). This assumes that the Tomcat process is itself being launched with a UTF-8 flag in the VM, as part of the Java launch command. I do this using a startup_as_utf8.sh file in [Tomcat]/bin:#!/bin/bash ./startup.sh dFile.encoding="UTF-8"
- Configure Cocoon so that Saxon can be called. First, open cocoon/WEB-INF/cocoon.xconf, and find the bit that refers to Saxon XSLT, which is commented out by default. Uncomment the code and change it according to the instructions in the file, so that it enables Saxon 9:
<component logger="core.xslt" role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon" class="org.apache.cocoon.components.xslt.TraxProcessor"> <parameter name="use-store" value="true"/> <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/> </component>
- Now we need to edit
cocoon/sitemap.xmap
to enable the Saxon transformer. In the<map:transformers>
section, add this below the other XSLT transformers:<map:transformer name="saxon" pool-grow="2" pool-max="32" pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer"> <use-request-parameters>false</use-request-parameters> <use-browser-capabilities-db>false</use-browser-capabilities-db> <xslt-processor-role>saxon</xslt-processor-role> </map:transformer>
- Add the following in the
<map:serializers>
section, to enable a couple more useful output formats:<!-- Customization: compatibility setting for IE6 --> <map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" name="xhtml11_compat" pool-grow="2" pool-max="64" pool-min="2" src="org.apache.cocoon.serialization.XMLSerializer"> <doctype-public>-//W3C//DTD XHTML 1.1//EN</doctype-public> <doctype-system>http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</doctype-system> <encoding>UTF-8</encoding> </map:serializer> <!-- Customization: set text output to UTF-8 --> <map:serializer logger="sitemap.serializer.text" mime-type="text/plain" name="text" src="org.apache.cocoon.serialization.TextSerializer"> <encoding>UTF-8</encoding> </map:serializer>
- In eXist's configuration (
WEB-INF/conf.xml
), make change the indexing settings from this:<indexer caseSensitive="yes" index-depth="5" preserve-whitespace-mixed-content="no" stemming="no" suppress-whitespace="none" tokenizer="org.exist.storage.analysis.SimpleTokenizer" track-term-freq="yes">
to this:<indexer caseSensitive="no" index-depth="8" preserve-whitespace-mixed-content="yes" stemming="no" suppress-whitespace="none" tokenizer="org.exist.storage.analysis.SimpleTokenizer" track-term-freq="yes">
- In eXist's
<conf.xml>
, change this:<serializer add-exist-id="none" compress-output="no" enable-xinclude="yes" enable-xsl="no" indent="yes" match-tagging-attributes="no" match-tagging-elements="no">
to this:<serializer add-exist-id="none" compress-output="no" enable-xinclude="yes" enable-xsl="no" indent="yes" match-tagging-attributes="no" match-tagging-elements="yes">
(just the final attribute changes) to turn on exist:match tagging. - In eXist's
<conf.xml>
, change this:<index> <fulltext attributes="false" default="none"> <exclude path="/auth"/> </fulltext> </index>
to this:<index> <fulltext attributes="false" default="all"> <exclude path="/auth"/> </fulltext> </index>
to turn on fulltext indexing. You can also do this by collection in the admin client. - Restart Tomcat. Check that things work.