Remove an ftmap attachment - Fluid Topics - Latest

Map Attachments

Category
Technical Notes
Audience
public
Version
Latest

To remove an attachment from an ftmap:

  1. Remove the ft:attachment corresponding to the map attachment to remove.
  2. Reupload the updated FTML archive to the Knowledge Hub.

Example

In this scenario, the following ftmap file was used to publish a map with a PNG image, a PDF document, and a URL as attachments:

<ft:map xmlns:ft="http://ref.fluidtopics.com/v3/ft#" ft:lang="en-US" ft:originId="ftmap_id" ft:title="Time Machine User Guide"
    ft:editorialType="book">
    <ft:toc>
        <ft:node ft:originId"origin_id" href="topics/how_to_time_travel.html" ft:title="How to Time Travel" type="topic"></ft:node>
    </ft:toc>
    <ft:attachments>
        <ft:attachment>
            <ft:originId>drawing</ft:originId>
            <ft:filePath>attachments/drawing.png</ft:filePath>
            <ft:filename>time_machine_drawing.png</ft:filename>
            <ft:displayName>Time Machine Drawing</ft:displayName>
            <ft:mimeType>image/png</ft:mimeType>
        </ft:attachment>
        <ft:attachment>
            <ft:originId>spare_parts</ft:originId>
            <ft:filePath>attachments/Spare_Part_Price_List.pdf</ft:filePath>
            <ft:filename>time_machine_spare_part_prices.pdf</ft:filename>
            <ft:displayName>Spare Part Price List</ft:displayName>
            <ft:mimeType>application/pdf</ft:mimeType>
        </ft:attachment>
        <ft:attachment>
            <ft:originId>mounting_scheme</ft:originId>
            <ft:url>https://timemachines.com/time-machine.jpg</ft:url>
            <ft:displayName>Time Machine Mounting Scheme</ft:displayName>
            <ft:mimeType>image/jpeg</ft:mimeType>
        </ft:attachment>
    </ft:attachments>
</ft:map>

Where:

  • ft:attachment expects all the information related to the attachment as follows:
Tag Description Mandatory? Default value
ft:originId The identifier of the attachment. Should be unique among all content uploaded through the FTML source. No ft:filename
ft:filepath The URL to attach to the ftmap. Yes
ft:filename The name of the file when downloaded. No Extracted from ft:filePath.
ft:displayName The name displayed in the Reader page. No ft:filename
ft:mimeType The MIME type indicating the nature and format of the content. No Computed by Fluid Topics

Be careful not to confuse the ft:originId metadata associated with a map attachment and the ft:originId metadata associated with a topic or map. The first is defined at the attachment level within the ft:attachment node of an ftmap file, whereas the second two can be retrieved in the Metadata journal.

The ZIP archive used to publish this map and its attachments contained the following elements:

└── time_machine_user_guide.ftmap
└── topics
    └── how_to_time_travel.html
└── attachments
    └── drawing.png
    └── Spare_Part_Price_List.pdf

In Fluid Topics, the following map attachments are available for the Time Machine User Guide:

  • drawing.png
  • Spare Part Price List PDF

The steps to remove the Spare Part Price List map attachment are as follows:

Remove the ft:attachment corresponding to the PDF attachment in the ftmap as follows:

<ft:map xmlns:ft="http://ref.fluidtopics.com/v3/ft#" ft:lang="en-US" ft:originId="ftmap_id" ft:title="Time Machine User Guide"
    ft:editorialType="book">
    <ft:toc>
      <ft:node ft:originId="origin_id" href="topics/how_to_time_travel.html" ft:title="How to Time Travel" type="topic"></ft:node>
    </ft:toc>
    <ft:attachments>
        <ft:attachment>
            <ft:originId>drawing</ft:originId>
            <ft:filePath>attachments/drawing.png</ft:filePath>
            <ft:filename>time_machine_drawing.png</ft:filename>
            <ft:displayName>Time Machine Drawing</ft:displayName>
            <ft:mimeType>image/png</ft:mimeType>
        </ft:attachment>
        <ft:attachment>
            <ft:originId>mounting_scheme</ft:originId>
            <ft:url>https://timemachines.com/time-machine.jpg</ft:url>
            <ft:displayName>Time Machine Mounting Scheme</ft:displayName>
            <ft:mimeType>image/jpeg</ft:mimeType>
        </ft:attachment>
    </ft:attachments>
</ft:map>

Only the PNG reference is kept in the ftmap.

Upload a new ZIP archive of the project with the updated ftmap and without the PDF file:

└── time_machine_user_guide.ftmap
└── topics
    └── how_to_time_travel.html
└── attachments
    └── drawing.png

Once republished, only the drawing.png map attachment is available for the Time Machine User Guide.