FEATURE REQUEST: Template System
Scraps will use IMT to add structured metadata to the digitized artifacts it handles. The metadata is well-formed, pre-defined XML, not simple text or a series of <p> tags. Each artifact can have its own, user defined XML format, which currently has no DTD or schema (but likely will). All objects under an artifact will have the same XML format, and Scraps will enforce compliance to (validate) that format when the IMT file is loaded into the database. However, the current version of IMT has no mechanism to enforce compliance as data is being entered. It is also difficult and error prone to enter raw tags in the annotation field; this became very evident during the Dodds Scrapbook digitization and markup project done by Special Collections during the summer of 2006.
Scraps (and other IMT projects) would benefit from having a mechanism where a template could be specified that controls the metadata that can be entered and makes data entry easier. The template would be selected when the file is first created; possibly it could be specified when IMT is launched, via a command line parameter. The template would be an XML file, possibly a schema (W3C or RelaxNG). The IMT user should not be able to modify the XML file; it would be useful if it could be retrieved from a common repository, possibly a web location via a URL. Using a template would be optional, but once loaded, the template would have the following effect:
- All IMT options not compatible with a template system are disabled.
- An optional list of categories is loaded from the template; the template has a switch that controls whether the user is able to create additional categories.
- In the standard Annotation Details window, the Annotation Text field is replaced with a field list (Delphi object inspector style) that matches the required XML tags. The Annotation Title and Category fields are left as-is.
- As data is entered, it is validated against the template field specifications. This could include checking for required fields, valid field content type (string, integer, date), valid ranges, etc. The template would also specify "choice" lists which would be presented as combo boxes; the user could only select an item from the list.
- When the IMT file is saved, the data is written as well-formed and valid XML as a block within the <div n="xxxx" type="imtAnnotation"> tag for each annotation object.
Unresolved problems:
- Does a W3C schema or RelaxNG schema allow for all of the features needed to define a template? If not, a custom XML format is required. Possibly a complex structure would be needed: a schema used for validating the resulting XML embedded in an XML wrapper that defines additional features needed for a template.
- Nested tags can be handled with an object inspector style interface, but how can attributes be handled?