Attach a File Using its originId - Fluid Topics - 3.10 - Technical Notes

Manage Map Attachments in Fluid Topics

Product
Fluid Topics
Fluid Topics Version
3.10
Category
Technical Notes
Language
English
Target Audience
public

To add a map attachment from an Ftmap to another Ftmap instance by its originId, add the following lines to the FluidTopicsControlFile.xml file:

<controlFile>
<resources>
<resource>
<originId>$ID_OF_THE_MAP_TO_ATTACH_THE_DOCUMENT</originId>
<attachments>
<attachment>
<sourceId>$ORIGINAL_SOURCE</sourceId>
<originId>$ATTACHMENT_ORIGIN_ID</originId>
<displayName>My attachment</displayName>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Where:

  • resource
    • originId expects the ft:originID defined for the Ftmap in the Ftmap file.
  • attachment
    • sourceId is the ID of the source originally used to upload the attachment. It is mandatory only if it is not the source used to upload the map to which the map attachment is to be attached.
    • originId expects the ft:originID defined for the attached file when uploaded to Fluid Topics. If no ft:originID was defined, it takes the Ftmap's filepath value.
    • 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 the 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.

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 Spare_Part_Price_List.pdf file was initially attached to the Time Machine User Guide Ftmap and given the spare_parts originId.

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

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>
<originId>spare_parts</originId>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Once published to Fluid Topics, the Spare Part Price List PDF is available in the Attachments tab of the Reader page when users view the Time Machine Configuration Guide.