Remove an Attachment Using its originId - Fluid Topics - 3.6 - Technical Notes

Manage Map Attachments in Fluid Topics

Product
Fluid Topics
FT_Version
3.6
Category
Technical Notes
language
English
audience
public

To remove a map attachment from a DITA map by its originId, 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>
<isAttached>false</isAttached>
<originId>my_attachment</originId>
</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
    • isAttached expects the false value to detach the attachment from the DITA map.
    • originId is the ID defined in the FluidTopicsControlFile.xml file when the file was originally attached to the DITA map.

If a map attachment was added to a map using the legacy (mapping.json) method, it is necessary to use its khubId to detach it with the Control File method.

It is possible to validate the control file against the following XML Schema Definition (XSD) file: https://ref.fluidtopics.com/3.5/control_file.xsd.

Example

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

To detach goldfish.png from 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 detach the image from the Novice instance of the Animals DITA map:

<controlFile>
<resources>
<resource>
<filePath>_animals.ditamap</filePath>
<instances>
<instance>
<filePath>Novice.ditaval</filePath>
<attachments>
<attachment>
<isAttached>false</isAttached>
<originId>amazing_pufferfish</originId>
</attachment>
</attachments>
</instance>
</instances>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, the Goldfish image is not available anymore in the Attachments tab of the Novice instance of the Animals 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.