Remove an Attachment Using its KHUB ID - 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 an Ftmap by its khubId, add the following lines to the FluidTopicsControlFile.xml file:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<originId>$FTMAP_ID</originId>
<attachments>
<attachment>
<isAttached>false</isAttached>
<khubId>$ATTACHMENT_KHUB_ID</khubId>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Where:

  • resource
    • originId expects the ft:originID defined for the Ftmap in the Ftmap file.
  • attachment
    • isAttached expects the false value to detach the attachment from the Ftmap.
    • khubId is the ID given to the file to detach by the FluidTopics connector. It is derived from the originId – or filepath if no originId was set – and the source. It is unique and can be retrieved by using a web service or from the URL of the map attachment when it is opened in the Viewer page: http://mysite.fluidtopics.net/viewer/book-attachment/$PUBLICATION_KHUB_ID/$MAP_ATTACHMENT_KHUB_ID

If a map attachment was added to a map using the legacy method (mapping.json), 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.

- Be careful not to confuse the originId metadata associated with a map attachment and the originId metadata associated with a map. The first is defined at the attachment level within the <ft:attachment> node of an Ftmap file, whereas the second can be retrieved in the Metadata journal.

Example

The Time Machine User Guide Ftmap has two attachments: the Time Machine Mounting Scheme URL and the Spare Part Price List PDF file.

To detach Spare_Part_Price_List.pdf from the Time Machine User Guide Ftmap, one possibility is to use its khubId.

When the Spare Part Price List attachment from the map is opened in the Viewer page, you can retrieve its khubId from the URL of the page: http://mysite.fluidtopics.net/viewer/book-attachment/cbQHcjWRiKpsP2DSB0NXqw/pcwi0pKPqMj9v52bTMS~XQ

The following lines are added to the FluidTopicsControlFile.xml file to detach the PDF file from the Time Machine User Guide Ftmap:

<controlFile>
<resources>
<resource>
<originId>time_machine_user</originId>
<attachments>
<attachment>
<isAttached>false</isAttached>
<khubId>pcwi0pKPqMj9v52bTMS~XQ</khubId>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, the Spare Part Price List document is no longer available in the Attachments tab of the Time Machine User Guide Ftmap.