Creating a Form - wvulibraries/mfcs GitHub Wiki
#Creating Fields
Standards
Release to Public
With MFCS 2.1 Public release is now handled on the Form Settings tab. To include the "Release to Public" drop down select the "Display Public Release" option. This will include a "Yes"/"No" drop down at the top of the form. If the default for this for should be "Yes", release the object to the public, select the check box "Public Release default "Yes".
Field Name
The field name should be considered to be a "database field" and is used as form element names.
The field name has a number of requirements and best practices.
- Once a form is in production, the field name SHOULD NOT be changed.
- Field name cannot contain spaces.
- The field name should not contain special characters other than the underscore, "_"
- It is preferable to use Camel case instead of any special characters
Field Label
This is what is displayed as a label for the field on data entry.
Additionally, it may be added to exports if defined by the Metadata Schema.
Metadata Schema
Define the Schema and predicate for the field.
WIP
If the predicate is defined and has two consecutive percent signs, additional information is expected.
example
Dublin Core | source%%add=label|combine=collection_number,collection_name,boxlocation,folderlocation|delimiter="; "
in the above example we selected the "Dublin Core" schema from the drop down. IN the text input field we entered: source%%add=label|combine=collection_number,collection_name,boxlocation,folderlocation|delimiter="; "
This breaks down to:
- predicate: source
- combine= : combines multiple fields into 1. So, if you have multiple source fields and want it combined into a single source element in the DC XML, list all the source fields here. In the default export scripts, combine must be all text-based inputs, not arrays (select or multiselect).
- ":" : the next parameter
- prepend= : in front of each field we will prepend the value of the field. This must be a form field value
- delimiter= : the delimiter to be used when combine is used.
If we are combining fields we then need to "ignore" other fields that are combined.
%%add=label|discard=true
When combining fields, it is most efficient to use the first of the fields that will be combined.
All standard modifiers:
- append
- combine
- delimiter
- discard (by default, discard is ignored if nocombine is set in the query string)
- prepend
append and preprend understand "label", "class", "id", and "name" ... they will append or prepend the value in those fields in the form editor.
These are just the "standard" field modifiers. any fields will be parsed and passed back to the export scripts. Using custom fields will require custom export scripts.