Instructions for building a minimal, empty webapp suitable as a starting point for creating your own Cocoon-based web applications. These instruction use UNIX filesystem notation.

  • Based on 2.0.4 distribution. For 2.1, see CreateMinimalWebapp2.1dev
  • For now, these are step by step instructions for doing this manually. A goal would be to incorporate this as a build target, and include the result in the binary dist.
  • Some comments are focused at ideas for the build process and can be ignored.
  1. remove all jars from optional EXCEPT: 1.# commons-jxpath-1.0.jar (this is an improper dependency introduced it appears by the jxpath input module 1.# servlet_2_2.jar optional only if you do not want to run cocoon as a webapp (eg, command line only)
  2. edit lib/jars.xml to comment out/remove all the optional jars except the ones noted above 1.#could be done with an xsl transform (see example Transformation jars2exclude)
  3. move jtidy-04aug2000r7-dev.jar from optional to tools/lib as it's needed for an ant task 1.# should probably be there to begin with?
  4. do a build.(bat|sh) -Dinclude.webapp.libs=true webapp-local 1.# tried -Ddocs.notrequired=true and -Djavadocs.notrequired=true to eliminate those as well, with no apparent effect so those will be eliminated manually later
  5. cd to build/cocoon/webapp
  6. cp stylesheets/system/error2html.xsl welcome/ 1.# or provide a more suitable live error xsl that doesn't give specific information about the error.
  7. rm -rf docs documentation i18n logicsheets protected resources samples 1.# I also had rm -rf WEB-INF/classes/org but some recently removed it with no comment. If you're still there, can you explain? One sample (maybe i18n but I don't remember) was placing class files there during the build) when I went through this.
  8. rm -rf search stylesheets sub sunspotdemo templates tutorial mount/lint
  9. rm -rf WEB-INF/db
  10. edit sitemap.xmap 1.# comment out all but most common components, 1.# delete all pipelines except a trivial welcome pipeline 1.## should be static xml transformed by trivial xsl. 1.## not the current welcome, as it references samples, docs etc. 1.## would work better as an included/generated file that is copied in place during build 1.## maybe place in mount/ with comment in root sitemap that the welcome can be removed by deleting the welcome dir in mount. then, the only pipelines would be a redirect from "" to welcome/ and the automount setup.
  11. edit cocoon.xconf to remove/comment out the jdbc setup for hsql
  12. edit web.xml to comment out the hsql driver in the init-param
  13. possibly edit cocoon.xconf & web.xml to modify settings to more appropriate defaults for live sites 1.# disable uploads, disable cocoon-reload, disable auto-reload of sitemaps & resources (need to warn about that one). 1.# This bears discussion and group think about "best practices" here anyway
  14. possibly add a simple README explaining what this is? (part of welcome page?)
  15. jar cvf cocoon-simple.war .

See the attached sitemap.xmap for a first stab at a simplified version:

Attachment: sitemap.xmap

  • No labels