Wednesday, 23 November 2011

Scalate confexport tool

Scalate (Scalate template engine) is a handy tool for creating small Web sites, which we use for some of the Web sites at the Fuse Forge. A somewhat obscure, but useful feature, of Scalate is the confexport tool, which you can use to pull down the contents of an entire Confluence Wiki space through a remote SOAP interface. For example, if you want to pull down the entire Apache Camel site from Apache's Confluence Wiki, simply execute the following command in Scalate:

scalate> confexport --user user --password pass CAMEL

Note that this command assumes that you are using the latest (not yet released) snapshot of Scalate, which has been refactored to use Confluence's SOAP port instead of the XMLRPC port.

Now, since most of our documentation is written in DocBook format, it would be nice if there was a way to cross-reference pages in a Scalate Web site from inside a DocBook book. Recently, I added an enhancement to the confexport tool that lets you do just that. You just add the --target-db switch to confexport when you are downloading a Wiki space, for example:

scalate> confexport --user user --password pass --target-db CAMEL

Now, when confexport has finished downloading the CAMEL space, it will also create a target.db file for you. If you are familiar with DocBook XSL, you will recognize that this is the standard form of a link database that DocBook uses to create cross-references between books. After including this target.db file in your DocBook libraries site.xml file, you will be able to insert cross-references using the standard DocBook olink element.

If you have a nice XML editor like OxygenXML, you can then insert links to the Scalate site with the help of the UI. For example, here is a screenshot of the 'Insert OLink' dialog in OxygenXML:

No comments:

Post a Comment