Attach a file using its originId - Fluid Topics - Latest

Map Attachments

Category
Technical Notes
Audience
public
Version
Latest

If a file has already been attached to one instance of a DITA map, it is possible to use that attachment's originId to attach the file to a different instance of the same DITA map as follows:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
  <resources>
    <resource>
      <filePath>my_map_to_attach_the_document.ditamap</filePath>
      <instances>
        <instance>
          <filePath>version1.ditaval</filePath>
          <attachments>
            <attachment>
              <sourceId>$ORIGINAL_SOURCE</sourceId>
              <originId>$ATTACHMENT_ORIGIN_ID</originId>
              <displayName>My attachment</displayName>
            </attachment>
          </attachments>
        </instance>
      </instances>
    </resource>
  </resources>
</controlFile>

Where:

  • resource

    • filePath expects the absolute path to the DITA map file in the archive used to upload the DITA map to Fluid Topics. It can be retrieved in the Metadata journal in the dita:mapPath field.
  • instance

    • filePath expects the absolute path to the DITAVAL file in the archive used to upload the DITA map to Fluid Topics. It can be retrieved in the Metadata journal in the dita:ditavalPath field.
  • attachment

    • sourceId is the ID of the source originally used to upload the attachment. It is mandatory only if it is not the source used to upload the map to which the map attachment is to be attached. For instance, the map A, uploaded through the source A, lends its map attachment to the map B, uploaded through the source B.

    • originId is the ID given to the file by the connector. It can be retrieved in the Metadata journal.

    • displayName is the title of the file to attach. When reusing an existing map attachment, if the new displayName does not match the initial one, the new one overrides the initial one.