Doco Home Tools Home

Platypus Tools: PO Config File Generator

The ConfigGen tool generates a skeleton config file for a PO. It uses as input only the DOM class generated by XMLC, and the global dev.conf file.

The format of the config files is described here. ConfigGen generates the file containing the section for the PO it is invoked on.

Associated with ConfigGen is the diffpatch script, which attempts to merge a newly generated skeleton with an existing config file.

There is a difficult design trade-off in ConfigGen. It is obviously desireable that the generated config files need as little hand-editing as possible. This requires ConfigGen to make intelligent guesses about how a dynamic node will be used. On the other hand, the skeleton files will definitely need hand-editing. There is nothing more irritating than fixing the output of a tool that tried to be smart, and got it wrong. Also, a consistent, predictable skeleton makes editor macors much more useful for hand-editing the config files. So, if ConfigGen sometimes seems stupider than it need be, its probably because of this design trade-off.

Another design goal in ConfigGen was to treat the ID attributes in the prototype HTML simply as labels - they should contain no semantic information. We have largely succeeded in this, though we have allowed a couple of exceptions to slip through:

  1. We try to keep the use of an ID attribute consistent between POs. Thus, if an ID is used for some particular purpose in one PO, we try to use the same ID for that purpose in other POs. There is some support for this built into ConfigGen and Pond.
  2. ID attributes in some tags are assumed to indicate that an access will be based around that tag. Such tags include <TABLE> and <TR>.

Defaults in dev.conf

When an ID is being processed by ConfigGen, it will check whether that ID has a section in the global dev.conf file's IDS section. If it does, ConfigGen will assume that dev.conf has the correct value for some fields it generates, such as DATAFROM and FIELDPATH. If these exist in the global IDS section, ConfigGen will not generate these fields in the PO specific file.

On the other hand, some fields should reflect what is in the prototype HTML - for example, HTMLLOCN is likely to vary from PO to PO. Even if these fields exist in the global IDS section, ConfigGen will generate fields for them in the PO specific file.

Unfortunately, the set of fields which are generated regardless, and which aren't, is still fluid (19Oct99), and is not documented here.