|
You may need to generate static documents, like documentation, but would like to
have the ability to use the same templating and groovy ability that gracelets has. The StaticContentGenerator tool allows you to do this. You simply pass it a source and target directory and it will render each .xhtml and .groovy source file it finds recursively and render them to corresponding .html files in the target directory. You simply have to design your pages knowing they are to be rendered in a static form (thus using forms and such would not make sense for instance). Since it uses the gracelet MockServer environment it needs access to the javax.servlet libraries and so forth. You can use the latest Gracelet Server startup jar so that this will be easier. The following is a command line usage example: C:\gracelets_server>java -jar startup.jar gracelets.tools.scg.StaticContentGenerator [web_root] [sub_dir] [dst_dir] [interval] The web_root is the root of the groovy/facelet source pages. The sub_dir can be empty ("") or specify that a sub directory of the web root is what you want to be statically rendered. The dst_dir parameter is where the generated views will go. Interval, if passed and is greater than -1, will have the generator continuously run and every [interval] seconds it will check for source pages that have changed and regenerate them. It will even extract gracelet resources from the views and save them in static form and translate the urls into a reference of the static resource. All of this allows you to sit and develop the documents and see the changes instantly in your browser for the final result. In fact, this utility is being used to generate the whole Gracelets site, manuals and documentation. |
| Last Updated: 05/05/2009 09:43PM CDT | © Gracelets 2008-2009 |