Example Record Templates
The Record Template XML for our first example is:
<template>
<tuple>
<atom name="ObjectType">Object</atom>
<atom name="TitObjectStatus">Accessioned</atom>
<atom name="TitAccessionDate">
<input cols="15">
<prompt>Enter the Accession Date:</prompt>
<help>Enter the date on which the works were accepted into the collection.</help>
</input>
</atom>
</tuple>
</template>
The Template is used to create accessioned object records in the Catalogue module. A suitable title would be Create Accessioned Objects. The following values are set in the records created:
- Object in the ObjectType field.
- Accessioned in the TitObjectStatus field.
- Asks for the accession date and sets the TitAccessionDate field to the value entered.
The Input Values screen used to request the accession date looks like:
Notice how the input prompt and help use the text specified in the Template XML.
In this example we set up a Record Template for the Multimedia module that copies a selection of fields and asks the user for the Title, Creator and Description. The input fields do not have to have a value, but are initialised with the value from the source record. The maximum number of records to be created will be set to 10 and a starting IRN cannot be specified. The following Record Template XML is suitable:
<template maxrecords="10" setIRN="no">
<tuple>
<table name="DetSubject_tab"><source name="DetSubject_tab"/></table>
<table name="DetContributor_tab"><source name="DetContributor_tab"/></table>
<table name="DetLanguage_tab"><source name="DetLanguage_tab"/></table>
<table name="DetRelation_tab"><source name="DetRelation_tab"/></table>
<table name="DetDate0"><source name="DetDate0"/></table>
<atom name="DetResourceType"><source name="DetResourceType"/></atom>
<atom name="DetPublisher"><source name="DetPublisher"/></atom>
<atom name="DetCoverage"><source name="DetCoverage"/></atom>
<atom name="DetSource"><source name="DetSource"/></atom>
<atom name="DetRights"><source name="DetRights"/></atom>
<atom name="MulTitle">
<input cols="30" mandatory="no">
<prompt>Enter the Media Title:</prompt>
<help>Enter the title of the media.</help>
<value><source name="MulTitle"/></value>
</input>
</atom>
<table name="MulCreator_tab">
<tuple>
<atom>
<input cols="30" mandatory="no">
<prompt>Enter the Media Creator:</prompt>
<help>Enter a description of the media.</help>
<value><source name="MulCreator_tab" rows="1"/></value>
</input>
</atom>
</tuple>
</table>
<atom name="MulDescription">
<input rows="3" cols="40" mandatory="no">
<prompt>Enter the Media Description:</prompt>
<help>Enter a description of the media.</help>
<value><source name="MulDescription"/></value>
</input>
</atom>
</tuple>
</template>
Notice how the first value of the MulCreator_tab table is extracted as the default value for the media creator. The image below shows the Input Values screen for media description:
The following example shows how the increment attribute of the <input> tag can be used to allocate Accession Numbers. The Record Template creates child records linking them to their parent record. Each child record has an Accession Number allocated that consists of the parent's Accession Number followed by a dot and the part number. For example, if the source record's Accession Number is 2007.14, the child numbers will be 2007.14.1, 2007.14.2, etc. The report produced will list the Accession Numbers created.
The Record Template XML is:
<template maxrecords="100">
<tuple>
<atom name="TitObjectStatus"><source name="TitObjectStatus"/></atom>
<atom name="TitAccessionDate"><source name="TitAccessionDate"/></atom>
<atom name="TitMainTitle"><source name="TitMainTitle"/></atom>
<atom name="AccAccessionLotRef"><source name="AccAccessionLotRef"/></atom>
<atom name="AssParentObjectRef"><source name="irn"/></atom>
<atom name="TitPartNumber"><number/></atom>
<atom name="TitNumberOfParts"><records/></atom>
<atom name="TitAccessionNo"><source name="TitAccessionNo"/>.
<input type="integer" increment="1">
<prompt>Enter next suffix:</prompt>
</input>
</atom>
</tuple>
<report>Accession Number: <column name="TitAccessionNo"/></report>
</template>
Notice how the IRN of the source record is placed in the AssParentObjectRef field of the created record, creating the parent / child link. The Record Template report contains:
Template record creation started 26 Jun 2008 11:45:11
Number of records to create: 2
Starting IRN: Next available IRN
Record 1, Accession Number: 2007.14.1 created (irn: 45)
Record 2, Accession Number: 2007.14.2 created (irn: 46)
Number of errors: 0
Number of records created: 2
Template record creation finished 26 Jun 2008 11:45:12