Attach a file using its khubId - 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 khubId 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>
          <khubId>$ATTACHMENT_KHUB_ID</khubId>
          <displayName>My attachment</displayName>
       </attachment>
      </attachments>
    </resource>
  </resources>
</controlFile>

Where:

  • resource

    • originId expects the ft:originId defined for the Ftmap in the Ftmapfile. It can be retrieved from the Metadata journal.
  • attachment

    • khubId is the ID given to the file to attach by the connector. It is derived from the originId - or the filepath if no originId was set – combined with the source. It is unique and can be retrieved from the URL of the map attachment when it is opened in the Viewer page: https://mysite.fluidtopics.net/viewer/book-attachment/$PUBLICATION_KHUB_ID/$MAP_ATTACHMENT_KHUB_ID.

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