Attach a Document by its khubId - 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 an Ftmap to another Ftmap instance by its khubId, add the following lines to the FluidTopicsControlFile.xml file:

<controlFile>
<resources>
<resource>
<originId>$ID_OF_THE_MAP_TO_ATTACH_THE_DOCUMENT</originId>
<attachments>
<attachment>
<khubId>$ATTACHMENT_KHUB_ID</khubId>
<displayName>My attachment</displayName>
</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
    • khubId is the ID given to the file to attach 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
    • displayName is the title of the file to attach. It is displayed in the Attachments 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.

If displayName, filename, or mimeType are not defined in the control file, the attachment keeps the current value of its other occurrences.

If a parameter is defined, e.g., displayName, it impacts also all already existing occurrences of the attachment.

Example

The Spare_Part_Price_List.pdf file was initially attached to the Time Machine User Guide Ftmap

The Time Machine Configuration Guide Ftmap already has the time_machine_drawing.png file.

To add Spare_Part_Price_List.pdf to the Time Machine Configuration Guide Ftmap, one possibility is to use its khubId.

When the Spare_Part_Price_List.pdf attachment from the Time Machine User Guide 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 add the PDF to the Time Machine Configuration Guide Ftmap:

<controlFile>
<resources>
<resource>
<originId>time_machine_configuration_guide</originId>
<attachments>
<attachment>
<khubId>pcwi0pKPqMj9v52bTMS~XQ</khubId>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, the Spare_Part_Price_List.pdf PDF is now available in the Attachments tab of the Time Machine Configuration Guide Ftmap.