Attach a Document to a DITA Map Instance - 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 to a DITA map instance, add the following lines to the FluidTopicsControlFile.xml file:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<filePath>my_map.ditamap</filePath>
<instances>
<instance>
<filePath>version1.ditaval</filePath>
<attachments>
<attachment>
<originId>my_attachment</originId>
<displayName>My attachment</displayName>
<filePath>$PATH_TO_THE_ATTACHMENT_FILE</filePath>
<filename>$DOWNLOAD_FILENAME</filename>
<mimeType>$ATTACHMENT_MIME_TYPE</mimeType>
</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
    • originId is the ID given to the file to attach. Make sure that the originId is unique within ALL the DITA map attachments.
    • displayName is the title of the file to attach. It is displayed in the Downloads 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.
    • filePath expects the absolute path to the file to attach in the archive.
    • filename expects the filename of the document to download from the Viewer page.
    • mimeType is the MIME type corresponding to the content of the attachment. It is used to override the attachment type calculated by Fluid Topics.

Indicating an originId for the map attachment is recommended.

Example

The following lines show how to attach the Pufferfish Song audio file to the Novice instance of the Pufferfish DITA map:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<filePath>_pufferfish.ditamap</filePath>
<instances>
<instance>
<filePath>Novice.ditaval</filePath>
<attachments>
<attachment>
<originId>pufferfish_song</originId>
<displayName>Pufferfish Song</displayName>
<filePath>pufferfish-song.mp3</filePath>
</attachment>
</attachments>
</instance>
</instances>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, Pufferfish Song is now available in the Attachment tab of the Novice instance of the Pufferfish DITA map:

Pufferfish Song is available in the map attachments of the Novice version of Pufferfish map

In the Document properties of Pufferfish map the Audience is Novice