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 another Ftmap, it is possible to use that attachment's originId to attach the file to a different Ftmap as follows:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
  <resources>
    <resource>
      <originId>$ID_OF_THE_MAP_TO_ATTACH_THE_DOCUMENT</originId>
      <attachments>
        <attachment>
          <sourceId>$ORIGINAL_SOURCE</sourceId>
          <originId>$ATTACHMENT_ORIGIN_ID</originId>
          <displayName>My attachment</displayName>
        </attachment>
      </attachments>
    </resource>
  </resources>
</controlFile>

Where:

  • resource

    • originId expects the ft:originId defined for the Ftmap in the ftmap file.
  • 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.

    • originId expects the ft:originId defined for the attached file when uploaded to Fluid Topics. If no ft:originId is defined, its value defaults to the Ftmap's filepath value.

    • 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.

If the displayName, filename, or mimeType are not defined in the control file, the attachment keeps the current value of its other occurrences.

If a parameter is defined in the control file, it impacts also all already existing occurrences of the attachment.

Be careful not to confuse the originId metadata associated with a map attachment and the originId metadata associated with a map. The first is defined at the attachment level within the node of an Ftmap file. The second can be retrieved in the document's Metadata journal.