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 one instance of a DITA map, it is possible to use that attachment's khubId 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>
              <khubId>$ATTACHMENT_KHUB_ID</khubId>
              <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 from 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 from the Metadata journal in the dita:ditavalPath field.
  • 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.