I've made the following changes to RVDB's Ant script:
- Inside the build directory (where the root
build.xml
is located), created afop
subdirectory, and inside that, ajars_replaced
directory, where I'm going to store Cocoon jars that have been superceded by newer versions from FOP. - Created a
fop-jars.xsl
file inside the fop directory, to process and update Cocoon'sjars.xml
file (modelled onexist-jars.xsl
, which does the same thing). - Created a new target in the Ant file:
<target description="Replace FOP 0.95 with FOP 1.0" name="upgrade_fop"> <echo message="-----------------------------------------------"/> <echo message="Upgrading FOP from 0.95 to 1.0 "/> <echo message="-----------------------------------------------"/> <echo message="-----------------------------------------------"/> <echo message="Patching jars.xml "/> <echo message="-----------------------------------------------"/> <xslt-saxon in="${cocoon.home}/lib/jars.xml" style="fop/fop-jars.xsl" out="${cocoon.home}/lib/jars.xml.patched"> </xslt-saxon> <move file="${cocoon.home}/lib/jars.xml.patched" tofile="${cocoon.home}/lib/jars.xml"/> <echo message="-----------------------------------------------"/> <echo message="Removing jars to be replaced "/> <echo message="-----------------------------------------------"/> <move failonerror="false" file="${cocoon.home}/lib/optional/batik-all-1.6.jar" tofile="fop/jars_replaced/optional/batik-all-1.6.jar"/> <move failonerror="false" file="${cocoon.home}/lib/optional/fop-0.95.jar" tofile="fop/jars_replaced/optional/fop-0.95.jar"/> <move failonerror="false" file="${cocoon.home}/lib/optional/xmlgraphics-commons-1.3.1.jar" tofile="fop/jars_replaced/optional/xmlgraphics-commons-1.3.1.jar"/> <echo message="-----------------------------------------------"/> <echo message="Adding replacement jars and new required jars "/> <echo message="-----------------------------------------------"/> <copy todir="${cocoon.home}/lib/optional" overwrite="true"> <fileset dir="${fop.home}/lib"> <include name="batik-all-1.7.jar"/> <include name="xmlgraphics-commons-1.4.jar"/> <include name="serializer-2.7.0.jar"/> </fileset> </copy> <copy todir="${cocoon.home}/lib/optional" overwrite="true"> <fileset dir="${fop.home}/build"> <include name="fop.jar"/> </fileset> </copy> <copy todir="${cocoon.home}/lib/endorsed" overwrite="true"> <fileset dir="${fop.home}/lib"> <include name="xml-apis-ext-1.3.04.jar"/> </fileset> </copy> </target>
- Added that target to the main "prepare" target:
<target description="Prepare the cocoon and eXist directories" name="prepare" depends="update_exist, copy_exist, prepare_cocoon, upgrade_fop, build_cocoon, copy_additional_jars, patch_cocoon"> </target>
- Ran a build, which seemed to work fine, and confirmed that Cocoon and the eXist Webstart client still work. They do.
What I don't know yet is whether anything else works properly. This is what I'll have to do next:
- Check through the sitemap changes made in RVDB's transformations, and alter anything that doesn't match our existing projects. For instance, he changes the XHTML doctype to transitional; that's something we definitely don't want. There may also be changes in our original transformation missing from RVDB's.
- Identify, or create, a simple project that can be used to test all the functionality. The natural candidate is the IALLT Journal project, which is quite small, and uses FOP. However, it's not simple. It might be worth simply creating something straightforward for easier testing of future builds. We want to confirm that XQuery Generators, Saxon XSLT transformations, and FOP transformations all work.
- Test character encoding issues. This is particularly needed because of this comment at the head of
patch_web_xml.xsl
:<!-- change default encodings to UTF-8 --> <!-- except for servlet[servlet-name='cocoon']/init-param/param-name[. = 'container-encoding']: should stay ISO-8859-1, see -http://markmail.org/message/nm6bnvqztbee4s5o -http://markmail.org/message/jt256gl3magir6g4 -http://wiki.apache.org/cocoon/RequestParameterEncoding#A3._Decoding_incoming_requests:_Servlet_Container -->
We had form submission working fine with both GET and POST, using all-UTF-8 settings; if possible, I'd prefer this, but it may be that something has changed in Cocoon 2.1.12x which screws this up.