Exercise 9: Table reference
In this exercise we specify an attachment in the Loans module to several Catalog records (the objects loaned).
As we've seen, a Typical import is configured to deal with attachments as follows. Using the search values specified in your Import data file:
- A search is performed on all existing records in the specified module.
- If no match is found, a new record is added and an attachment is made to it.
- If a single matching record is found, an attachment is made to that record.
- If more than one match is found, the matching records are displayed so that the correct record can be selected manually.
- Create a new CSV Import data file with the following details:
Column Name (Row 1) |
Record 1 (Row 2) |
Record 2 (Row 3) |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Import data file specifies that Record 1 is an Outgoing
loan for three objects in the Catalog. In the Object: (Objects Loaned) table in the Loans module, a note is added for each object loaned.
Record 2 is an Incoming loan which will create a Catalog record for the incoming loan object.
- Save the Import data file as
exercise9_train1.csv
(whereTrain1
is your login name). - Before importing the data, perform a Custom Import to validate the Import data file.
- When there are no validation errors, perform a Typical Import (and remember to include your login name as the Import Identifier).
The Importing screen should appear as:
- Two records have been created in the Loans module, for an
Outgoing
and anIncoming
loan. - One record was created in the Catalog module for the
Incoming
Loan. - Three attachments (to the existing object records) were made to the Catalog module for the Outgoing Loan (i.e. these are the objects we are lending and they are, naturally, already recorded in the Catalog module).
- Two records have been created in the Loans module, for an
- Record the IRN of the Catalog record created. You'll need this for Exercise 10:
__________
- How many attachments would be made if you ran this same import again?:
__________
- Run the import again to see if you answered question 6 correctly.
- Why are there this number of attachments?
Confirm with your instructor that you've understood why.
<?xml version="1.0" encoding="UTF-8"?>
<table>
<!--First record-->
<tuple>
<!--First the atom fields in the Loans module are specified-->
<atom name="InfDirection">Outgoing</atom>
<atom name="InfLoanStatusValue">Ongoing</atom>
<atom name="InfReasonForLoan">Exhibition</atom>
<atom name="DatLoanCommencementDate">1 March 2013</atom>
<atom name="DatLoanDueDate">1 March 2014</atom>
<!--Next the Object: (Objects Loaned) attachment field is specified. This field attaches to one or more records in the Catalog module (so it's a table).-->
<table name="ObjObjectsLoanedRef_tab">
<tuple>
<atom name="TitAccessionNo">1957.161</atom>
</tuple>
<tuple>
<atom name="TitAccessionNo">1995.39.38</atom>
</tuple>
<tuple>
<atom name="TitAccessionNo">1978.138</atom>
</tuple>
</table>
<!--This specifies the Notes: (Objects Loaned) table within the Loans module. Keep in mind that if there are several rows in a table and no values in, say, the first row, but values in the subsequent rows, the first tuple would need to be specified with an empty value. Don't forget that when specifying tables there can be only one value per tuple.-->
<table name="ObjObjectNotes_tab">
<tuple>
<atom>On loan to the National Museum</atom>
</tuple>
<tuple>
<atom>On loan to the National Museum</atom>
</tuple>
<tuple>
<atom>On loan to the National Museum</atom>
</tuple>
</table>
</tuple>
<!--Second record-->
<tuple>
<atom name="InfDirection">Incoming</atom>
<atom name="InfLoanStatusValue">Ongoing</atom>
<atom name="InfReasonForLoan">Research</atom>
<atom name="DatLoanCommencementDate">1 March 2013</atom>
<atom name="DatLoanDueDate">1 April 2013</atom>
<table name="ObjObjectsLoanedRef_tab">
<tuple>
<atom name="ObjectType">Object</atom>
<atom name="TitObjectStatus">Inward Loan</atom>
<atom name="TitObjectCategory">Work of Art</atom>
<atom name="TitMainTitle">Train20</atom>
</tuple>
</table>
<table name="ObjObjectNotes_tab">
<tuple>
<atom name="ObjObjectNotes_tab">Research undertaken by Train20</atom>
</tuple>
</table>
</tuple>
</table>