Attach a Document by its originId - 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 originId, 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>
<sourceId>$ORIGINAL_SOURCE</sourceId>
<originId>$ATTACHMENT_ORIGIN_ID</originId>
<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
    • sourceId is the ID of the source originally used to upload the attachment. It is mandatory only if it is not the source used to upload the map to which the map attachment is to be attached. For instance, the map A, uploaded through the source A, lends its map attachment to the map B, uploaded through the source B.
    • originId is the ID given to the file to attach, as defined in the FluidTopicsControlFile.xml file when attaching the file to the DITA map.
    • 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.

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 DITA map and given the amazing_goldfish originId.

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 originId.

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>
<originId>amazing_goldfish</originId>
</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.