Sunday, June 19, 2011

Playing with Apache Cocoon 3.0 - Part 2

As couple of people requested a complete example, I uploaded the full source file, as well as some sample input files, everything but the jar files here.


About the upload

  • The uploaded file is called dist.zip (MD5: d930916c8506bdc563925385e7aa1162) and contains 2 folders : src and www
  • The src folder contains the Java source file 
  • The www folders contains all the files needed to generate a simple website. I didn't provide the exact files that I used for privacy reasons.

Dependencies


You can grab the required Jar dependencies from Maven repositories(click on the hyperlinks below) :



Running the application
  • Create an Java project with the IDE of your choice and add the source file and the required dependencies(jar files).
  • In the main method of the class StaticSiteGenerator, change the variable wwwRoot to point the the folder www folder extracted from the dist.zip archive.
  • Run the class and the output will be generated in the www/out folder in HTML format.