Understanding IDs in Workflow Forms

From EPrints Documentation
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects

Anatomy of an input ID

This is an explanation of how the id="" tags are generated for individual input elements. (ie. a <input>) in a HTML page generated by the EPrints workflow system.

This is useful to understand if you're doing clever things with the autocompleter tools or if you want to make your own input components.

First of all, some jargon:

  • The workflow contains pages
  • A page is rendered as a web page. It is displayed containing one or more input components
  • input components allow the inputing of zero or more eprint fields.
  • eprint fields may be multiple. If so they contain multiple rows of input. Otherwise they contain a single row
  • a row in a compound field consists of all the input elements of all the sub-fields.
  • a row in a non-compound field consists of the fields own input elements
  • the input elements are the actual HTML bits needed to input the data (eg. 3 for date, 2 for page range, one for a title).

The id is constructed thus...

  • EPrints assigns a prefix to the component. This is just a string eprints assigns when generating the page, and should not be relied on.
    • eg. id3
    • This is the component prefix
  • For a field in a coponent, add "_" and the name of the field.
    • eg. id3_creators
    • This is the field prefix
  • If this is a multiple field, add "_" and the number of the row. Otherwise add nothing.
    • eg. id3_creators_2
    • eg. id3_creators_3
    • eg. id4_title (not multiple)
    • eg. id5_pagerange
    • This is the row prefix
  • If this is a compound field, then add "_" and the sub-field id we're inputing.
    • eg. id3_creators_2_name
    • eg. id4_title (not compound)
  • If this (sub)field has more than one input component, add the suffix for that input component (see below).
  • eg. id3_creators_2_name_given
  • eg. id4_title
  • eg. id5_pagerange_from

Field types with more than one input component

  • date: _day, _month, _year
  • name: _given, _family (and possibly _lineage and _honourific)
  • pagerange: _from, _to
  • time: _day, _month, _year, _second, _minute, _hour