Exporting A Topic Map

The export operation allows you to export a topic map from a persistent store to an XTM syntax file. The export operation does not remove the topic map from the persistent store or modify the topic map in any way.

To export a topic map from a configured provider, select the topic map from the main tree view. Then either right-click on the entry and select the "Export Topic Map" menu item from the popup menu or select "Actions"->"Export Topic Map" from the main menu. The Export dialog should then be displayed as shown below.

Figure 3.2. The Export Dialog

The Export Dialog

The dialog has three tabs. On the File Options tab pictured above, you can either type the name of the file to write to in the field labelled "Export To File" or click the "Browse..." button to use a file browser to specify the file to be written.

On the XTM Options tab pictured below, check "Export Implied IDs" to export the TM4J-generated object identifiers for those XTM elements which are represented by objects in the TM4J object model. This setting ensures that nearly all elements in the export XTM file have an ID attribute set that can be used to locate the object in the store that caused that element to be exported.

Check the "Export Resource IDs" checkbox to export the resourceLocator property of topic map objects in the store as the id attribute value in the XTM file. Setting this option enables a "round-trip" export that ensures that the id attribute values set in the imported topic map are recreated in the exported topic map.

The fields labelled "XTM Namespace Prefix" and "XLink Namespace Prefix" can be used to alter the default namespace prefixes used. By default the XTM Namespace is made the default namespace of the exported file (and so has no prefix) and the XLink Namespace is given the prefix 'xlink'.

Figure 3.3. The Export XTM Options Panel

The Export XTM Options Panel

The XML Options tab is used to control the formatting and encoding of the XTM file that is generated by the export process. To have the exported file 'pretty-printed', check the "Indent XML" option and enter the level of indentation in the entry field to the right (you can use the up and down arrows to increment and decrement this count). The indentation level specified is the number of spaces by which a child element will be indented relative to its parent element.

By default, XTM files are exported using the platform's default encoding. To alter this, select either the "UTF-8" option to encode the file in UTF-8, or else select the "Other" option and enter the name of the encoding to be used.

Figure 3.4. The Export XML Options Panel

The Export XML Options Panel

Once you are happy with the export settings, click the "Export Map" button to export the topic map.