7.4.8 The documents directory
The documents directory contains all the documents to import. For each document there should be a subdirectory named after the ID of the document. This directory in turn contains again subdirectories for each variant of the document. The name structure is <branch name>~<language name>.
An example structure:
documents
+ 123-DSY
+ main~default
+ document.xml
+ main~nl
+ document.xml
+ 124-DSY
+ main~default
+ document.xml
The variant directory contains at least a document.xml file, and possibly more files for the part data (if any).
This is the minimal structure for the document.xml file:
<?xml version="1.0"?> <document type="..."> <name>...</name> </document>
Everything else described below is optional.
7.4.8.1 Specifying the owner
The owner is defined by its login in an attribute called owner on the root tag:
<document type="..." owner="piet"> ...
7.4.8.2 Specifying the version state
For the case where the import would cause a new document version to be created, the state for that version can be specified with a versionState attribute:
<document type="..." versionState="draft|publish"> ...
7.4.8.3 Specifiying the reference language
The reference language can be optionally specified on the root tag:
<document type="..." referenceLanguage="en"> ...
7.4.8.4 Specifying fields
All fields are defined inside a fields element:
<document ...>
<fields>
<field .../>
</fields>
</document>
7.4.8.4.1 Single-value fields
<field type="..." value="..."/>
Type type attribute contains the name of the field type.
The format of the values depends on the value type of the field, and is described in a table further on.
7.4.8.4.2 Multi-value fields
<field type="..."> <value>...</value> <value>...</value> </field>
7.4.8.4.3 Single-value hierarchical fields
<field type="...">
<hierarchyPath>
<value>...</value>
<value>...</value>
</hierarchyPath>
</field>
7.4.8.4.4 Multi-value hierarchical fields
Repeat the hierarchyPath element multiple times.
<field type="...">
<hierarchyPath>
<value>...</value>
<value>...</value>
</hierarchyPath>
<hierarchyPath>
<value>...</value>
<value>...</value>
</hierarchyPath>
</field>
7.4.8.5 Specifying parts
All parts are defined inside a parts element:
<document ...>
<parts>
<part .../>
</parts>
</document>
The syntax for the part element is as follows:
<part type="..." mimeType="..." dataRef="..." fileName="..."/>
The type attribute contains the name of the part type.
The mimeType attribute specifies the mime type of the data. For example, for Daisy-HTML parts this will be "text/xml". For a PNG-image it is "image/png".
The dataRef attribute specifies the name of a file containing the data of the part. This file should be located in the same directory as this document.xml file. You are free to choose the file name.
The fileName attribute is optional and specifies the fileName property of the part (which is the file name that will be presented to the user when downloading the content of this part).
7.4.8.6 Specifying links
Example syntax:
<document ...>
<links>
<link>
<title>...</title>
<target>...</target>
</link>
[ more link elements ]
</links>
</document>
7.4.8.7 Specifying custom fields
Example syntax:
<document ...>
<customFields>
<customField name="..." value="...">
[ more customField elements ]
</customFields>
</document>
7.4.8.8 Specifying collections
Example syntax:
<document ...>
<collections>
<collection>[collection name]</collection>
[ more collection elements ]
</collections>
</document>
Previous