Example 6: Specifying a table of attachments
In this example we examine how to specify a table of attachments, in this case, the Associations table in the Parties module:
Party: (Associated With) attaches to the Parties module and is a table of attachments. Role: (Associated With) is an associated table in the Parties module.
The fields loaded are:
Fields |
Back-end name |
---|---|
Role | AssRole_tab
|
For display purposes only, the import data below is presented with column headings listed vertically rather than horizontally. The first row of any tab or comma delimited file must include the column names. The appropriate layout is:
NamPartyType
|
NamOrganisation
|
NamDepartment
|
Organi
|
Chandler Funeral Homes and Crematory
|
Burial Services
|
Organi
|
Fort Washington Medical Center
|
Critical Care
|
The import data is:
Column Name (must appear as the first row of the import data file) |
Record 1 |
Record 2 |
---|---|---|
NamPartyType
|
Organi
|
Organi
|
NamOrganisation
|
Chandler Funeral Homes and Crematory
|
Fort Washington Medical Center
|
NamDepartment
|
Burial Services
|
Critical Care
|
AssAssociationRef_tab(1).NamOrganisation
|
Roller-McNutt Funeral Home
|
Abraham-Lincoln Memorial Hospital
|
AssRole_tab(1)
|
Head Office
|
Research Partner
|
AssAssociationRef_tab(2).NamOrganisation
|
Three Rivers Medical Center
|
|
AssRole_tab(2)
|
AssAssociation is both an attachment field (giving us AssAssociationRef) and a table (giving us AssAssociationRef_tab).
Thus AssAssociationRef_tab(1).NamOrganisation:
- Specifies the first row in the Associated With table.
- When Record 1 is processed a search of the Parties module will be initiated for a Party called
Roller-McNutt Funeral Home
.If found, an attachment from Party: (Associated With) in the first row of the Associated With table will be made to it.
AssRole_tab(1)
specifies Roles: (Associated With) in the first row in the Associated With table.
The XML for this example is:
<?xml version="1.0" encoding="UTF-8"?>
<table>
<!--First record-->
<tuple>
<!--First the atom fields in the Parties module are specified-->
<atom name="NamPartyType">Organisation</atom>
<atom name="NamOrganisation">Chandler Funeral Homes and Crematory</atom>
<atom name="NamDepartment">Burial Services</atom>
<!--Next the Party: (Associated With) attachment field is specified. This field attaches
to one or more records in the Parties module (so it's a table).-->
<table name="AssAssociationRef_tab">
<tuple>
<atom name="NamOrganisation">Roller-McNutt Funeral Home</atom>
</tuple>
<tuple>
<atom name="NamOrganisation">Three Rivers Medical Center</atom>
</tuple>
</table>
<!--This specifies the Roles: (Associated With) table within the Parties 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 non-reference tables there can be only one value per tuple-->
<table name="AssRole_tab">
<tuple>
<atom>Head Office</atom>
</tuple>
</table>
</tuple>
<!--Second record-->
<tuple>
<atom name="NamPartyType">Organisation</atom>
<atom name="NamOrganisation">Fort Washington Medical Center</atom>
<atom name="NamDepartment">Critical Care</atom>
<table name="AssAssociationRef_tab">
<tuple>
<atom name="NamOrganisation">Abraham-Lincoln Memorial Hospital</atom>
</tuple>
</table>
<table name="AssRole_tab">
<tuple>
<atom>Research Partner</atom>
</tuple>
</table>
</tuple>
</table>