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
- 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
- Add and link the due date field
- 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> - Link the new due date field with the version of maps, topics, illustrations and publications.
Note: The attribute
isindexable="true"is ignored for publications.<cardtype element="CTMASTERV"> <fielddefinition> <cardtypefield element="FDUEDATE" /> </fielddefinition> </cardtype>
- Create a field for the due date.
- Add and link the user field
Note: A generic field is used as a reference and is linked to user name data at the level of the card type.
- 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> - Link the new field with the publications.
<cardtype element="CTPUBLICATIONV"> <fielddefinition> <cardtypefield element="FPROJECTLEADER"> <cardreferencefield> <memberdefinition> <member element="USER" /> </memberdefinition> </cardreferencefield> </cardtypefield> </fielddefinition> </cardtype>
- Create a new user field holding the name of the project leader.
- Add and link the string field
- 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> - Link the new field with the publications.
<cardtype element="CTPUBLICATIONV"> <fielddefinition> <cardtypefield element="FPROJECTID" /> </fielddefinition> </cardtype>
- Create a new string field holding the project ID.
- Add and link the boolean field
- 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> - Link the new field with the illustrations.
<cardtype element="CTPUBLICATIONOUTPUT"> <fielddefinition> <cardtypefield element="FPUBINCLUDEPROJECTINFO"> <lovfield> <defaultvalue ishvaluetype='element'>FALSE</defaultvalue> </lovfield> </cardtypefield> </fielddefinition> </cardtype>
- Create a field linked with the default boolean LOV, named
- 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>