Attach a Document 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 a map attachment 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>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>
<instance>
<filePath>version2.ditaval</filePath>
<attachments>
<attachment>
<originId>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 Swim image to the Novice and Expert instances of the Pufferfish DITA map:

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>Yellow</originId>
<displayName>Pufferfish Swim</displayName>
<filePath>pufferfish-yellow.png</filePath>
</attachment>
</attachments>
</instance>
<instance>
<filePath>Expert.ditaval</filePath>
<attachments>
<attachment>
<originId>Yellow</originId>
<displayName>Pufferfish Swim</displayName>
<filePath>pufferfish-yellow.png</filePath>
</attachment>
</attachments>
</instance>
</instances>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, Pufferfish Swim image is now available in the Attachments tab of the Novice and Expert instances of the Pufferfish DITA map:

Map attachments for the Novice instance of the Pufferfish map

Map attachments for the Expert instance of the Pufferfish map

In the Document properties of Pufferfish map the Audience is Novice

Pufferfish map Expert instance