Attach Several Documents to Several Instances of a DITA Map - Fluid Topics - 3.7

Manage Map Attachments in Fluid Topics

Product
Fluid Topics
FT_Version
3.7
Category
Technical Notes

To add several map attachments to several instances of a DITA map, add the following lines to the FluidTopicsControlFile.xml file:

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.

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<filePath>my_map.ditamap</filePath>
<instances>
<instance>
<filePath>version1.ditaval</filePath>
<attachments>
<attachment>
<originId>attachment1</originId>
<displayName>My attachment 1</displayName>
<filePath>$PATH_TO_THE_ATTACHMENT_1_FILE</filePath>
<filename>$DOWNLOAD_FILENAME</filename>
<mimeType>$ATTACHMENT_MIME_TYPE</mimeType>
</attachment>
</attachments>
</instance>
<instance>
<filePath>version2.ditaval</filePath>
<attachments>
<attachment>
<originId>attachment2</originId>
<displayName>My attachment 2</displayName>
<filePath>$PATH_TO_THE_ATTACHMENT_2_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

To attach the Pufferfish Song audio file to the Novice instance of the Pufferfish DITA map, and the Pufferfish Circles image to its Expert instance.

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.

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<filePath>_pufferfish.ditamap</filePath>
<instances>
<instance>
<filePath>Novice.ditaval</filePath>
<attachments>
<attachment>
<originId>pufferfish-video</originId>
<displayName>Pufferfish Video</displayName>
<filePath>pufferfish-video.mp4</filePath>
</attachment>
</attachments>
</instance>
<instance>
<filePath>Expert.ditaval</filePath>
<attachments>
<attachment>
<originId>Circles</originId>
<displayName>Pufferfish Circles</displayName>
<filePath>pufferfish-circles.jpg</filePath>
</attachment>
</attachments>
</instance>
</instances>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, Pufferfish Circles image is now available for the Novice instance of the Pufferfish DITA map and the Pufferfish Video file is now available for the Expert instance of the map in the Attachments tab:

Video file is added to the map attachments

Circles PNG image is added to the map attachments

In the Document properties of Pufferfish map the Audience is Novice

Pufferfish map Expert instance