Replace an Ftmap Attachment with a Control File - Fluid Topics - 3.9 - Technical Notes

Manage Map Attachments in Fluid Topics

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

To update a map attachment already uploaded to Fluid Topics:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<originId>$FTMAP_ID</originId>
<attachments>
<attachment>
<originId>my_old_attachment</originId>
<displayName>My attachment</displayName>
<filePath>$NEW_ATTACHMENT_FILENAME</filePath>
<mimeType>$ATTACHMENT_MIME_TYPE</mimeType>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Where:

  • In the <resources> sub node, the originId expects the ft:originID defined for the Ftmap in the Ftmap file. It can be retrieved in the dita:mapPath field of the Metadata Journal.
  • The <attachment> sub node expects all information related to the attachment as follows:

Tag

Description

Mandatory?

Default value

filePath

The path of the file in the archive.

Yes

filename

The name of the file when downloaded.

No

Extracted from filePath.

originID

The identifier of the attachment. Should be unique among all content uploaded through the DITA source.

No

filename

displayName

The name displayed in the Reader page.

No

filename

mimeType

The MIME type indicating the nature and format of the content.

No

Computed by Fluid Topics.

If a map attachment does not have an originId or was added to a map using the legacy method (mapping.json) method, it is necessary to use its khubId to update it.

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 following lines show how to change the Spare_Part_Price_List.pdf file into the Spare_Part_Price_List_New.pdf file in the Time Machine User Guide Ftmap:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<originId>user_guide</originId>
<attachments>
<attachment>
<originId>spare_parts</originId>
<filePath>Spare_Part_Price_List_New.pdf</filePath>
<filename>time_machine_spare_part_prices_march_2019.pdf</filename>
<displayName>Our New Spare Part Price List</displayName>
<mimeType>application/pdf</mimeType>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, Our New Spare Part Price List is available in the Attachments tab of the Reader page when users view the Time Machine User Guide . It replaces the Spare Part Price List attachment.

To update a URL attachment into an attachment which is not a URL, it is mandatory to add an empty originUrl tag to the control file:

...
<attachment>
<originId>my_old_url</originId>
<filePath>file_to_replace_the_url.pdf</filePath>
<displayName>My attachment</displayName>
<mimeType>application/pdf</mimeType>
<originUrl></originUrl>
</attachment>
...