Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Files:

  • [dspace]/config/input-forms.xml

Instructions:

  1. This XML file contains form definitions, each contained within its own

    Code Block
    <form>

    <form> element. Each

    Code Block
    &lt;form&gt;
    element contains
    Code Block
    &lt;page&gt;

    <form> element contains <page> elements that represent single pages of input. Each

    Code Block
    &lt;page&gt;
    element contains
    Code Block
    &lt;field&gt;

    <page> element contains <field> elements with instructions for creating the fields on that page. This structure is mocked up below, for a single form with a single page.

    Code Block
    &lt;form-definitions&gt; 
    Code Block
       &lt;form<form-definitions>
      <form name="traditional"&gt;
    Code Block
    >
        <page  &lt;page number="1"&gt;
    Code Block
    >
              &lt;field&gt;
    Code Block
                    ...
    Code Block
              &lt;/field&gt;
    Code Block
            &lt;/page&gt;
    Code Block
       &lt;/form&gt;
    Code Block
    &lt;/form-definitions&gt; <field>...</field>
        </page>
      </form>
    </form-definitions>
    
  2. The default form has a Code Blockname attribute whose value is Code Block"traditional". To change all submission forms throughout DSpace, edit the XML inside this form.
  3. To change a submission form for a specific collection, add a new
    Code Block
    &lt;form&gt;
    <form> element with a new and unique collection-related value for the Code Blockname attribute. (You can copy the XML from the default and edit as desired, as long as you change the Code Blockname attribute value.)
    • Once you've created your new

      Code Block
      &lt;form&gt;

      <form> element, you will have to map it to your specific collection using the

      Code Block
      &lt;form-map&gt;

      <form-map> section at the top of the XML:

      Code Block
      &lt;form-map&gt; 
      Code Block
      &lt;name<form-map>
        <name-map collection-handle="default" form-name="traditional" /&gt; 
      Code Block
      &lt;/>
      </form-map&gt; map>
      
    • You'll need to create a new
      Code Block
      &lt;name-map&gt;
      <name-map> element to "map" your collection's handle to the new
      Code Block
      &lt;form&gt;
      <form> you just created.
  4. Create all appropriate

    Code Block
    &lt;page&gt;

    <page> elements, numbering them sequentially starting from 1 in the

    Code Block

    number

    attribute. Within them, add individual

    Code Block
    &lt;field&gt;

    <field> elements according to this template:

    Code Block
    &lt;field&gt; 
    Code Block
         &lt;dc-schema&gt;dc&lt;/dc-schema&gt;
    Code Block
            &lt;dc-element&gt;identifier&lt;/dc-element&gt;
    Code Block
         &lt;dc-qualifier&gt;citation&lt;/dc-qualifier&gt;
    Code Block
         &lt;repeatable&gt;false&lt;/repeatable&gt;
    Code Block
         &lt;label&gt;Citation&lt;/label&gt;
    Code Block
         &lt;input-type&gt;onebox&lt;/input-type&gt;
    Code Block
         &lt;hint&gt;Enter<field>
      <dc-schema>dc</dc-schema>
      <dc-element>identifier</dc-element>
      <dc-qualifier>citation</dc-qualifier>
      <repeatable>false</repeatable>
      <label>Citation</label>
      <input-type>onebox</input-type>
      <hint>Enter the standard citation for the previously issued instance of this item.&lt;/hint&gt;
    Code Block
         &lt;required&gt;&lt;/required&gt;
    Code Block
              &lt;vocabulary&gt;&lt;/vocabulary&gt;
    Code Block
    &lt;/field&gt; </hint>
      <required></required>
      <vocabulary></vocabulary>
    </field>
    
  5. Stop and restart Tomcat (See Quick Restart in Rebuild + DSpace).

Notes:

  • The
    Code Block
    &lt;required&gt;
    <required> element contains the textual hint displayed to the submitter about why the field is required. Leave it empty for optional fieldsRemove the tag to transform field to optional.
  • The

    Code Block
    &lt;vocabulary&gt;

    <vocabulary> element is optional. It allows you to specify the controlled vocabulary (see Use Controlled Vocabularies for more information) that this field should select its values from. This field also has an optional

    Code Block

    closed

    attribute. If closed is set to true, a user can only select values from the controlled vocabulary. By default, closed is set to false, which allows a user to also enter in free text if he/she chooses. For example:

    Code Block
    &lt;vocabulary<vocabulary closed="true"&gt;srsc&lt;/vocabulary&gt; >srsc</vocabulary>
    
  • The name of the controlled vocabulary must correspond to the name of the XML file (without ".xml") which contains the vocabulary. So, in the above example, Code Blocksrsc references the vocabulary specified in the file located at [dspace]/config/controlled-vocabularies/srsc.xml
  • Valid input types (for
    Code Block
    &lt;input-type&gt;
    <input-type>) are:
    • "date"
    • "name" (two text boxes, labeled last and first name)
    • "onebox" (a one-line textbox)
    • "twobox" (two textboxes on a single line)
    • "dropdown" (for which you must specify a Code Blockvalue-pairs-name attribute referring to the
      Code Block
      &lt;value-pairs&gt;
      <value-pairs> list of allowed values, see Change + a + form + value)
    • "qualdrop_value" (a textbox, which is preceded by a "qualifying" dropdown of values. Requires a Code Blockvalue-pairs-name attribute, similar to "dropdown". Also requires
      Code Block
      &lt;repeatable&gt;
      <repeatable> is set to "true")
    • "textarea"
  • Setting the
    Code Block
    &lt;repeatable&gt;
    <repeatable> element to "true" creates an "Add more" button, which allows you to add multiple values into that particular field. Examples of this include the authors and keywords fields in the standard DSpace submission process.