Attach a Document by its KHUB ID - Fluid Topics - 3.7

Manage Map Attachments in Fluid Topics

Product
Fluid Topics
FT_Version
3.7
Category
Technical Notes

To add a map attachment from a DITA map to another DITA map instance by its khubId, add the following lines to the FluidTopicsControlFile.xml file:

<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 Fluidtopics connector. It is derived from the originId – or filepath if no originId was set – and the source. It is unique and can be retrieved from the URL of the map attachment when it is opened in the Viewer page: http://mysite.fluidtopics.net/viewer/book-attachment/$PUBLICATION_KHUB_ID/$MAP_ATTACHMENT_KHUB_ID
    • displayName is the title of the file to attach. It is displayed in the Attachments tab and can be clicked for a direct access to the attachment. In the case of reusing an existing map attachment, if the displayName does not match the initial one, then it overrides it.

It is necessary to create one instance element for each DITAVAL variant:
- It is possible to provide more instances, and declare the map attachment only once for all of them.
OR
- It is possible to provide the instance only once, and then declare all attachments.
See the following section for use examples.

Example

The goldfish.png image file was initially attached to the goldfish.ditamap.

The Animals DITA map already has the pufferfish.pdf file, in its two instances, Novice and Intermediate.

To add goldfish.png to the Animals DITA map, in its Novice instance, one possibility is to use its khubId.

When the goldfish attachment from the goldfish map is opened in the Viewer page, you can retrieve its khubId from the URL of the page: http://mysite.fluidtopics.net/viewer/book-attachment/3b5d1zP9~WhIcoVsGwdiZg/vQlcqgYveKfDv53M5zn82Q

The following lines are added to the FluidTopicsControlFile.xml file to add the image to the Novice instance of the Animals DITA map:

<controlFile>
<resources>
<resource>
<filePath>_animals.ditamap</filePath>
<instances>
<instance>
<filePath>Novice.ditaval</filePath>
<attachments>
<attachment>
<khubId>vQlcqgYveKfDv53M5zn82Q</khubId>
<displayName>Amazing Goldfish</displayName>
</attachment>
</attachments>
</instance>
</instances>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, the Goldfish image is now available in the Attachments tab of the Novice instance of the Animals DITA map.