Replace an Ftmap Attachment by a New One - Fluid Topics - 3.6 - Technical Notes

Manage Map Attachments in Fluid Topics

Product
Fluid Topics
Fluid Topics Version
3.6
Category
Technical Notes
Language
English
Target 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:

  • 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
    • originId is the ID given to the old attachment.
    • 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.
    • filePath expects the relative or absolute path to the file to attach in the archive. This parameter is mandatory.
      OR
      originUrl is the URL to attach to the Ftmap. This parameter is mandatory.
    • mimeType is the MIME type corresponding to the content of the attachment. It is used to override the attachment type calculated by Fluid Topics.

If the old attachment does not have any originId, use its khubId.

If a map attachment was added to a map using the legacy (mapping.json) method, you must use its KHUB ID to update it with the new Control File method.

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 now available in the Time Machine User Guide Ftmap Attachments tab. It replaces the Spare Part Price List document.

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>
...

When successfully uploading a control file through a source that is not of the Unstructured Documents type, the following information is provided in the History table of the Knowledge Hub interface: Published=0, Failed=0 and Rejected files=0. This is due to the fact that the control file is taken into account for the specified document but is not itself indexed, searchable or accessible in the Fluid Topics portal.
No failed or rejected file means that the upload was successful
More information about the upload can be consulted in the Dataflow interface of the Back Office.