Upload a DITA Map 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

It is possible to use a control file to add a map attachment to a DITA map asynchronously as follows:

  1. Create or edit the FluidTopicsControlFile.xml file according to the context.
  2. Compress the FluidTopicsControlFile.xml file and the file(s) to attach in a ZIP archive.
  3. In the Knowledge Hub, upload the ZIP archive through the DITA source used to publish the DITA map.

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.

When attaching a file, add the following lines to the FluidTopicsControlFile.xml file:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<filePath>my_map.ditamap</filePath>
<attachments>
<attachment>
<filePath>$PATH_TO_THE_ATTACHMENT_FILE</filePath>
<filename>$DOWNLOAD_FILENAME</filename>
<originId>my_attachment</originId>
<displayName>My attachment</displayName>
<mimeType>$ATTACHMENT_MIME_TYPE</mimeType>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Where:

  • In the <resources> sub node, the filePath expects the absolute path to the DITA map file in the archive used to upload the DITA map to Fluid Topics. 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 defined for the attachment at the moment of its creation. 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.

When attaching a URL, add the following lines to the FluidTopicsControlFile.xml file:

<?xml version='1.0' encoding='utf-8'?>
<controlFile>
<resources>
<resource>
<filePath>my_map.ditamap</filePath>
<attachments>
<attachment>
<originUrl>$URL_TO_ATTACH</originUrl>
<originId>my_attachment</originId>
<displayName>My link</displayName>
<mimeType>$MIMETYPE_OF_THE_URL_TARGET</mimeType>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>

Where:

  • In the <resources> sub node, the filePath expects the absolute path to the DITA map file in the archive used to upload the DITA map to Fluid Topics. 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

originURL

The URL to attach.

Yes

originId

The identifier defined for the attachment at the moment of its creation. Should be unique among all content uploaded through the DITA source.

No

originURL

displayName

The name displayed in the Reader page.

No

Extracted from originURL.

mimeType

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

No

Extracted from originURL.

While not mandatory, defining an originId for the map attachment is recommended.