close

Filter

Importer Manual / Version 2307

Table Of Contents

4.1.2 IDs

Each document is uniquely determined by the value of its id attribute. It can be referenced to via this ID by other documents. In the example below, you can see that the document called MyDocument contains a link <link idref="pic1"/> to the second document.

The importer supports two types of ID:

  • target IDs

  • Target IDs refer to documents which already exist in the CoreMedia CMS repository. They begin with the prefix target: followed by the actual document ID which is always a positive even number.

  • internal IDs

  • They are only valid within the consistency check of an import procedure and are later mapped to target IDs by the importer. They begin with the prefix internal: followed by the actual document ID which can be a string, containing any character allowed for NMTOKEN. The internal document ID must be unique in the set of documents to import.

If the prefix is missing, the type of the ID is determined in the following way:

  1. The system checks whether the ID occurs in the import set or not. If a document can be found, the ID is treated as internal.

  2. The system checks for the ID in the CoreMedia repository. If a document can be found, the ID is treated as target.

  3. If no document with this ID was found at all, the import will fail.

The documents for import must form a closed set with regard to their referential integrity, that is, no documents can be imported which refer to unknown IDs. For internal IDs, this means that the referenced document must also be contained in the import group. A document which is referenced with a target ID must already exist in the CoreMedia CMS repository.

The following example is intended to illustrate this - for clarity reasons it is limited to the elements and attributes relevant in this context.

<coremedia>
  <document name="MyDocument" id="1" >
    <version>
      <linklist name="Images">
         <link idref="pic1" />                <!-- (1) -->
         <link idref="not_here" />            <!-- (2) -->
         <link idref="target:2468" />         <!-- (3) -->
         <link idref="3456"/>                 <!-- (4) -->
      </linklist>
    </version>
  </document>

  <document name="pic1" id="pic1">
  </document>
</coremedia>

Example 4.2. IDs


Case 1: The document with the internal ID pic1 is also contained in the import group: the link is valid.

Case 2: A document with the internal ID not_here is not contained in the import group. It cannot be a target ID either, because it is not a numerical: the import would therefore fail.

Case 3: If, at the time of the import, there is already a document with the ID 2468 in the repository, then the link is correct, otherwise the import would fail.

Case 4: A document with the internal ID 3456 is not contained in the import group. If, at the time of the import, there is already a document with the ID 3456 in the repository, then the link is correct, otherwise the import would fail.

The documents to import can be distributed over multiple XML files. Documents which are connected via a reference do not necessarily have to be in the same file. It is only important that all files with referenced documents are available at the start of the import process.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.