wftk tutorial - (unresolved tag 02-l-title)


The data dumpers covered in 02-h Records are useful for situations where we need to parse the data back out of a given format, but one common feature of easily parsed formats is that they're generally not all that useful for human consumption. (The standard format is meant to be a reasonable compromise, providing a relatively easy-to-parse format that can also be edited by a programmer, but non-programmers are not likely to find it terribly palatable.)

So the wftk also provides a mechanism for publishing data -- both lists and records -- using templates. Like everything else, the publishing system is an attempt to be as modular as possible, so you can define your own template language if that's what floats your boat, and everything that can possibly be seen as a publisher will be handled with this mechanism as well.

Here are some possible applications of publishers:

Generation of webpages to allow navigation in the data system of a repository

A list can be represented as an HTML table, and a record as a page to be displayed with a given template. Individual rows in the table will have links to display the records, and there can be a lot of work done with other navigational features, Javascript, frames, what have you -- all of that together resides as one complex publisher which uses a number of separate templates for various purposes.

Outgoing mail, with attachments, sent when particular events occur

This is an easier publisher to conceptualize. It can be a single action to invoke a notification publisher on a given record. That publisher may be parameterized with a list of recipients, and it can use a MIME email template to build an email with arbitrarily complex formatting and attachments, then send it.

Periodic reports

Given the action scheduling facility (see Chapter 3: Actions and events), you can set up periodic reporting to do whatever queries you want, format the results in a single useful HTML or PDF file, then save that file into a document management system for later evaluation by a human being.

Ad-hoc reporting

The same facility can be used to specify an ad-hoc reporter that can track what people have requested and stash results into a document management system. To do this, you might want to define a simple language for specification of the publisher, and perhaps provide a second document management facility to keep track of useful ad-hoc reports.

All of these are modeled in the wftk using the same publishing system, so any templates developed for one purpose can easily be reused for another.






Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.