Main -> Documentation -> Open SiteSearch Record Builder -> Customizing DC Templates -> Adding Elements to a DC Template

Adding Elements to a DC Template

 

Contents

Introduction
Document Conventions
Before You Begin
Procedure


Introduction

This document explains how to add new elements to a Record Builder DC (DC(2) or DCQ) template by modifying the database's template.xml and field.xml files (click here for DC(2); click here for DCQ), as well as other database framework files. You can add locally-defined elements or domain-specific elements recommended by a Dublin Core Metadata Initiative (DCMI) Working Group, such as the Architecture and Education Working Groups to a DC template.

Adding new elements is one of the supported customizations to DC templates. You should add new elements to a database framework before you add any records to the database.


Document Conventions

  • <WebZ_root> is the location of the WebZ environment that includes Record Builder.
  • db_name is the top-level directory of the database for which you want to add or remove qualifiers.
  • XML namespace is an identifier used to ensure uniqueness among XML elements with the same name. In a tag used to specify an element, the namespace precedes the element's name and a colon separates the namespace and the element, such as DC:Title or RB:Info.

Before You Begin

Return to Contents


Procedure

Follow this procedure to add one or more elements to a DC template. In this procedure, you:

Creating a List of Values for New Element(s)

1. How do you want metadata specialists to enter data for each new element?

  • Typing data in a text box (textarea). Go directly to step 2.
  • By selecting a value from a drop-down list (listbox):

    • Create a text file that contains the allowable values for the element, with one value per line like the following example:
    • data
      image
      interactive
      software
      sound
      text

    • Save the text file in a location accessible via a URL.
    • Repeat for new each listbox field.

Adding the New Element(s) to template.xml

2. Open <WebZ_root>/dbbuilder/dbs/db_name/template.xml with a text editor. Go to template.xml example Click here for an example of the template.xml file in a second browser window.

3. Take one of the following actions:

  • For a textarea field, copy the entire element specification for DC:Creator, beginning with the <DC:Creator> opening tag through the </DC:Creator> closing tag.
  • For a listbox field, copy the entire element specification for DC:Language, beginning with the <DC:Language> opening tag through the </DC:Language> closing tag.

4. Paste the element specification you copied in step 3 in the place in template.xml where you want the new element to appear on the data entry workform (Edit Record screen).

Note:  

Make sure that you do not paste the element specification:

  • Anywhere between the top of the file and the closing </ID> tag.
  • Within any other element specification.
  • Below the </DublinCore> tag at the end of the file.

5. Edit the element's opening and closing tags, using a unique namespace other than DC, RDF, MANTIS, or RB, followed by a colon, and the element name.

Example:   For the DC-ed Audience element (recommended by the DCMI Working Group), the opening and closing tags would be <DC-Ed:Audience> and </DC-Ed:Audience>.

6. Would you like a different label for the element on the Edit Record and View Record screens than the name you defined for the element in its opening and closing tags?

  • Yes. Edit the text between the <MANTIS:label><RDF:Value> and </RDF:Value></MANTIS:label> tags so that it contains the desired label.
  • No. Go directly to step 7.

7. Can there be more than one instance of this element per record; in other words, is the new element repeatable?

  • Yes. Go directly to step 8.
  • No. Delete this line:
  • <mantis:replicable><rdf:value>Yes</rdf:value></mantis:replicable>

This prevents the Add and Del buttons from appearing beside the element on the Edit Record screen.

8. Is the new element a textarea or a listbox?

  • Textarea. If desired, modify the height and maximum height of the text box as follows:
    • The default height (size of the text box) is 2 lines. To change this, edit this line to reflect the desired height:

      <MANTIS:height>2</MANTIS:height>

    • The default maximum height (number of lines of data that the text box can contain) is 4 lines. To change this, edit this line to reflect the desired maximum height:

      <MANTIS:maxHeight>4</MANTIS:maxHeight>

  • Listbox. Edit this line to indicate the URL of the file that contains the list of possible values for this element:

    <MANTIS:href>http://purl.oclc.org/sitesearch/lists/languagelist.txt
         </MANTIS:href>

    using the name and path to the file you created in step 1.

9. For a database based on the DC(2) framework, remove these lines if the element will not have qualifiers (SiteSearch 4.1.2) or modifiers (SiteSearch 4.1.1):

  • For SiteSearch 4.1.2:

    <DC:Qualifier>
        <MANTIS:display>invisible</MANTIS:display>
        <MANTIS:label>Qualifier</MANTIS:label>
    </DC:Qualifier>

  • For SiteSearch 4.1.1:

    <RB:modifier>
        <MANTIS:display>invisible</MANTIS:display>
        <MANTIS:label>Modifier</MANTIS:label>
    </RB:modifier>

10. Repeat steps 2-9 for any other new elements you want to add to the template.
11. Save and close template.xml.

Adding Schemes and Qualifiers to field.xml

12. Add schemes and qualifiers for the new element(s), as described in these procedures:

Adding the Element(s) to the Database's .dtd File

13. Add the new element(s) to the database's .dtd file. Use each element's namespace, followed by a colon and a numeric identifier for the element. The numeric identifier for each element must be unique for the database.

Example:

DC-Ed:Audience      1401

Defining Indexes for the Element(s)

14. Modify the database's .dsc file (<WebZ_root>/dbbuilder/dbs/db_name/db_name.dsc) to define the index(es) that you want to create and the routines that you want to use to index the new element(s).

15. Add indexes you defined in step 14 to the database's configuration file in <WebZ_root>/ini/dbs. For each index:

Adding Constant Data for the Element(s) (optional)

16. Do you want to define constant data for the new element(s)?

  • Yes. Go to step 17.
  • No. Go to step 18.

17. Follow the procedure for defining constant data in Creating or Disabling Constant Data for a DC Database.

Verifying Template Changes

18. Stop and then restart Record Builder. Click here for more information for UNIX; click here for more information for Windows NT.

19. Open Record Builder with a Web browser. From the New Record screen, click the link for creating a new record for the database.

20. When the Edit Record screen displays, verify that the new element(s), its(their) schemes and qualifiers, and constant data appear correctly.
21. Complete the fields on the Edit Record screen and then submit the record to the database. (See Adding a Record to a Local Database.)
22. Using an index you defined for a new element, search for the new record. Repeat this step for each index you defined in steps 14 and 15.

Return to Contents


See Also

Performing Online Updates to Local Databases with Record Builder
Record Builder Database Frameworks
Removing Elements from a DC Template


[Main][Documentation][Support][Technical Reference][Community][Glossary][Search]

Last Modified: