Detach a Document by its KHUB ID - Fluid Topics - 3.7

Manage Map Attachments in Fluid Topics

Product
Fluid Topics
FT_Version
3.7
Category
Technical Notes

To detach 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. It can be retrieved from the Metadata Journal, in the ft:originId field. If no ft:originID was defined, it takes the Ftmap filepath value.
  • 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 (mapping.json) method, you must use its khubId to detach it with the new Control File method.

The attachment is not deleted in case it would be attached to another document in the portal. It is only detached from the document. All its related information (originId, displayName, and so on) are stored for any further use.

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 not available anymore in the Attachments tab of the Time Machine User Guide Ftmap.