Documentation Center

Declaring a metadata field

XML setup structures can be designed for adding fields, List of Values (LOV) or LOV values in the Content Manager database. This example focuses on the creation of a different types of new fields.

Before you begin

Be sure to follow the naming convention.

For any object (LOV, LOV values or fields) creation, all attributes must be provided.

About this task

In this example, we describe how to:
  • Add a new field for the due date on the version of maps, topics, illustrations and publications.
  • Add a new user field on the version of publications.
  • Add a new string field with the project ID on the version of publications.
  • Add a boolean field on the publication output.

Procedure

  1. Add and link the due date field
    1. Create a field for the due date.
      <field element="FDUEDATE" issystem="false" isbasic="true" ismandatory="false" isindexable="true">
        <label>Due date</label>
        <description>Is used to store the due date on the version of maps, topics, illustrations and publications</description>
        <typedate ismultivalue="false" />
      </field>
    2. Link the new due date field with the version of maps, topics, illustrations and publications.
      <cardtype element="CTMASTERV">
        <fielddefinition>
          <cardtypefield element="FDUEDATE" />
        </fielddefinition>
      </cardtype>
  2. Add and link the user field
    1. Create a new user field holding the name of the project leader.
      <field element="FPROJECTLEADER" issystem="false" isbasic="true" ismandatory="false" isindexable="false">
        <label>Project leader</label>
        <description>Is used to store the project leader on the version of publications</description>
        <typecardreference ismultivalue="true" />
      </field>
    2. Link the new field with the publications.
      <cardtype element="CTPUBLICATIONV">
        <fielddefinition>
          <cardtypefield element="FPROJECTLEADER">
            <cardreferencefield>
              <memberdefinition>
                <member element="USER" />
              </memberdefinition>
            </cardreferencefield>
          </cardtypefield>
        </fielddefinition>
      </cardtype>
      
  3. Add and link the string field
    1. Create a new string field holding the project ID.
      <field element="FPROJECTID" issystem="false" isbasic="true" ismandatory="false" isindexable="false">
        <label>ProjectId</label>
        <description>Is used to store the projectid on the version of publications</description>
        <typestring ismultivalue="true" />
      </field>
    2. Link the new field with the publications.
      <cardtype element="CTPUBLICATIONV">
        <fielddefinition>
          <cardtypefield element="FPROJECTID" />
        </fielddefinition>
      </cardtype>
  4. Add and link the boolean field
    1. Create a field linked with the default boolean LOV, named BOOLEAN. This one is already defined in Content Manager.
      <field element="FPUBINCLUDEPROJECTINFO" issystem="false" isbasic="true" ismandatory="true" isindexable="false">
        <label>Include project info</label>
        <description>Should project information be included as part of the publication output?</description>
        <typelov element="BOOLEAN" ismultivalue="false" />
      </field>
    2. Link the new field with the illustrations.
      <cardtype element="CTPUBLICATIONOUTPUT">
        <fielddefinition>
          <cardtypefield element="FPUBINCLUDEPROJECTINFO">
            <lovfield>
              <defaultvalue ishvaluetype='element'>FALSE</defaultvalue>
            </lovfield>
          </cardtypefield>
        </fielddefinition>
      </cardtype>
  5. The complete structure would look like this:
    <?xml version="1.0" encoding="utf-8"?>
    <setup version="2.0">
      <fields>
        <field element="FDUEDATE" issystem="false" isbasic="true" ismandatory="false" isindexable="true">
          <label>Due date</label>
          <description>Is used to store the due date on the version of maps, topics, illustrations and publications</description>
          <typedate ismultivalue="false" />
        </field>
        <field element="FPROJECTLEADER" issystem="false" isbasic="true" ismandatory="false" isindexable="false">
          <label>Project leader</label>
          <description>Is used to store the project leader on the version of publications</description>
          <typecardreference ismultivalue="true" />
        </field>
        <field element="FPROJECTID" issystem="false" isbasic="true" ismandatory="false" isindexable="false">
          <label>ProjectId</label>
          <description>Is used to store the projectid on the version of publications</description>
          <typestring ismultivalue="true" />
        </field>
        <field element="FPUBINCLUDEPROJECTINFO" issystem="false" isbasic="true" ismandatory="true" isindexable="false">
          <label>Include project info</label>
          <description>Should project information be included as part of the publication output?</description>
          <typelov element="BOOLEAN" ismultivalue="false" />
        </field>
      </fields>
      <cardtypes>
        <cardtype element="CTMASTERV">
          <fielddefinition>
            <cardtypefield element="FDUEDATE" />
          </fielddefinition>
        </cardtype>
        <cardtype element="CTMAPV">
          <fielddefinition>
            <cardtypefield element="FDUEDATE" />
          </fielddefinition>
        </cardtype>
        <cardtype element="CTIMGV">
          <fielddefinition>
            <cardtypefield element="FDUEDATE" />
          </fielddefinition>
        </cardtype>
        <cardtype element="CTPUBLICATIONV">
          <fielddefinition>
            <cardtypefield element="FDUEDATE" />
              <cardtypefield element="FPROJECTLEADER">
                <cardreferencefield>
                  <memberdefinition>
                    <member element="USER" />
                  </memberdefinition>
                </cardreferencefield>
            </cardtypefield>
            <cardtypefield element="FPROJECTID" />
          </fielddefinition>
        </cardtype>
        <cardtype element="CTPUBLICATIONOUTPUT">
          <fielddefinition>
            <cardtypefield element="FPUBINCLUDEPROJECTINFO">
              <lovfield>
                <defaultvalue ishvaluetype='element'>FALSE</defaultvalue>
              </lovfield>
            </cardtypefield>
          </fielddefinition>
        </cardtype>
      </cardtypes>
    </setup>