Customizer's Guide > Customizing Copying and Pasting from Other Applications > Using Arbortext Import to Customize the MapTemplate Files
  
Using Arbortext Import to Customize the MapTemplate Files
You can use the Arbortext Import MapTemplate Editor included in Arbortext Architect to modify the automatically generated MapTemplate files that Arbortext Editor produces for a copy and paste operation. Following are some reasons you might want to modify the default templates:
Modify the division title MapObjects to match custom heading style names instead of Microsoft Words default “Heading n” style names.
Modify the behavior of the default ID/IDREF handling from Microsoft Word bookmarks or Adobe FrameMaker cross-reference markers.
Add new MapObjects to convert inline character styles to elements
Add new MapObjects to convert formatted text to both elements and attributes
Modify the default MapObjects to handle user-defined list paragraph styles, list styles, or tables styles
Add map debug comments to troubleshoot copy and paste conversion issues
Add new MapObjects to work with custom Paste Special operations
The automatically generated MapTemplate files
The first time that you copy and paste content from another application into Arbortext Editor, a MapTemplate file for the pasted clipboard content and the document type into which the content is pasted is automatically created. These files are stored in the Arbortext Editor cache directory (.aptcache). The cache directory is typically located at C:\Documents and Settings\username\Application Data\PTC\Arbortext\Editor\.aptcache. The MapTemplate files are stored in a subdirectory of .aptcache named maptemplates.
The MapTemplate files are named source_type-doctype_name.std. For example, a MapTemplate file for the RTF source type and the axdocbook document type would be named rtf-axdocbook.std. A file for the HTML source type and the DITA topic document type would be named html-topic.std.
You can modify these automatically generated files in the MapTemplate Editor as required for your site. Put the modified files in either the Arbortext-path\custom\lib directory or in a custom\lib directory referenced through the APTCUSTOM environment variable. Your customized MapTemplate file will override the automatically generated file for the source type and document type combination implied by its file name.
The automatically generated MapTemplate files are regenerated every time you start a new Arbortext Editor session and paste for the first time with a given source type and document type combination. If you modify a document type’s .dcf file or perform a Arbortext Editor preview operation in Arbortext Styler, the MapTemplate files in .aptcache\maptemplates are marked as outdated and are regenerated as if you have started a new Arbortext Editor session. MapTemplate files in a custom\lib directory are not affected by Arbortext Editor operations and can only be disabled by renaming the file or deleting the MapTemplate from the file system.
The base MapTemplate files
The automatically generated MapTemplate files are created from a set of base MapTemplate files. These files are stored in the Arbortext-path\lib\cpix\lib directory. The following base MapTemplate files are in this directory:
Base MapTemplate files
common-base.std — The common file used for all automatically generated maps.
htm—base.std — The file used for HTML content.
This file is concatenated with the common file to generate an HTML MapTemplate file. Similarly, one of the following three base files is concatenated with the common file to create MapTemplate files for the associated type of content. Only one of these four files is used for an automatically generated MapTemplate file.
mif—base.std — The file used for MIF content.
rtf—base.std — The file used for RTF content.
txt—base.std — The file used for text content.
html-table.std — The file used for HTML tables.
This file is concatenated with the common file and the source type file to create the final MapTemplate file. The type of table file used is based on the primary table model supported by the document type. Only one of the table files is included in an automatically generated MapTemplate file.
oasis-table.std — The file used for OASIS Exchange tables.
The base MapTemplate files contain placeholder values for the document type element names. For example, the element used for paragraphs in a document type has the placeholder aticp:primary_paragraph in the Output Rules defined in the base MapTemplate file. This placeholder is replaced in the automatically generated MapTemplate file by the paragraph element defined in the .dcf file for the document type used for the generated file. Other elements are similarly added to the file based on information in the document type’s .dcf and .style files.
Following are the placeholder values for different document elements in the base MapTemplate files, including example markup from the axdocbook.dcf file that matches the placeholders for that document type.
aticp:primary_paragraph
Description
Primary paragraph element
Sample Markup
<Specials>
<Paragraph
element="para"/>
</Specials>
Notes
You can identify the element with this ACL function: paragraph_tag_name(doc)
aticp:division1
Description
Primary division element
Sample Markup
<ElementOptions>
<ElementOption
category="division"
element="sect1"
primary="yes"/>
</ElementOptions>
Notes
You can identify division elements with this ACL function: division_tag(tagname[, doc[, primary]]))
aticp:division2
Description
Nested division element
Sample Markup
<ElementOptions>
<ElementOption
category="division"
element="sect2"
primary="yes"/>
</ElementOptions>
Notes
aticp:division3
Description
Nested division element
Sample Markup
<ElementOptions>
<ElementOption
category="division"
element="sect3"
primary="yes"/>
</ElementOptions>
Notes
aticp:division4
Description
Nested division element
Sample Markup
<ElementOptions>
<ElementOption
category="division"
element="sect4"
primary="yes"/>
</ElementOptions>
Notes
aticp:division5
Description
Nested division element
Sample Markup
<ElementOptions>
<ElementOption
category="division"
element="sect5"
primary="yes"/>
</ElementOptions>
Notes
aticp:divisiontitle
Description
Primary division title element
Sample Markup
<PasteOptions>
<PasteElement
category="primary_division_title"
element="title"/>
</PasteOptions>
Notes
You can identify the element with this ACL function: dcfmodel_element_list(arr, primary_division_title[, doc[, 1]])
aticp:bold
Description
Markup for bold text
Sample Markup
<TextStyles>
<Bold
attribute="role"
attributeValue="bold"
element="emphasis"/>
</TextStyles>
Notes
You can identify the element with this ACL function: text_style_tag_name(bold, arr[, doc])
aticp:italic
Description
Markup for italic text
Sample Markup
<TextStyles>
<Italic
attribute="role"
attributeValue="italic"
element="emphasis"/>
</TextStyles>
Notes
You can identify the element with this ACL function: text_style_tag_name(italic, arr[, doc])
aticp:underline
Description
Markup for underline text
Sample Markup
<TextStyles>
<Underline
attribute="role"
attributeValue="underline"
element="emphasis"/>
</TextStyles>
Notes
You can identify the element with this ACL function: text_style_tag_name(underline, arr[, doc])
aticp:smallcaps
Description
Markup for smallcaps text
Sample Markup
<TextStyles>
<SmallCaps
attribute="role"
attributeValue="smallcaps"
element="emphasis"/>
</TextStyles>
Notes
You can identify the element with this ACL function: text_style_tag_name(smallcaps, arr[, doc])
aticp:subscript
Description
Markup for subscript text
Sample Markup
<TextStyles>
<Subscript
element="subscript"/>
</TextStyles>
Notes
You can identify the element with this ACL function: text_style_tag_name(subscript, arr[, doc])
aticp:superscript
Description
Markup for superscript text
Sample Markup
<TextStyles>
<Superscript
element="superscript"/>
</TextStyles>
Notes
You can identify the element with this ACL function: text_style_tag_name(superscript, arr[, doc])
aticp:bulleted_list
Description
Markup for bulleted list
Sample Markup
<Lists>
<Bulleted>
<Block element="itemizedlist"/>
<Item element="listitem"/>
</Bulleted>
</Lists>
Notes
This placeholder triggers the main element name and all other list block tags in which this list might be nested.
aticp:bulleted_list_item
Description
Markup for bulleted list item
Sample Markup
<Lists>
<Bulleted>
...
<Item element="listitem"/>
</Bulleted>
</Lists>
Notes
aticp:numbered_list
Description
Markup for numbered list
Sample Markup
<Lists>
<Numbered>
<Block element="orderedlist"/>
<Item element="listitem"/>
</Numbered>
</Lists>
Notes
This placeholder triggers the main element name and all other list block tags in which this list might be nested.
aticp:numbered_list_item
Description
Markup for numbered list item
Sample Markup
<Lists>
<Numbered>
...
<Item element="listitem"/>
</Numbered>
</Lists>
Notes
aticp:simple_bulleted_list
Description
Simplified markup for a bulleted list
Sample Markup
<Lists>
<Bulleted>
<Block element="itemizedlist"/>
<Item element="listitem"/>
</Bulleted>
</Lists>
Notes
This placeholder makes no provision for nested lists. It is only used for the bullet list selection in the Paste Special dialog box.
aticp:simple_numbered_list
Description
Simplified markup for a numbered list
Sample Markup
<Lists>
<Numbered>
<Block element="orderedlist"/>
<Item element="listitem"/>
</Numbered>
</Lists>
Notes
This placeholder makes no provision for nested lists. It is only used for the numbered list selection in the Paste Special dialog box.
aticp:internal_link
Description
Markup for internal document links
Sample Markup
<Specials>
<Link
element="link"
idref="linkend"/>
</Specials>
Notes
For non-DITA document types, you can identify the element with this ACL function: link_tag_name([doc]). For DITA document types, use the _cpix::make_internal_link(doc) and _cpix::get_link_element() functions. These functions can be customized and do not use the .dcf file.
aticp:internal_link_attribute
Description
The reference attribute for internal document links
Sample Markup
<Specials>
<Link
element="link"
idref="linkend"/>
</Specials>
Notes
For non-DITA document types, you can identify the element with this ACL function: link_idref_attr_name(tagname[, doc]). For DITA document types, use the _cpix::make_internal_link(doc) and _cpix::get_link_attribute() functions. These functions can be customized and do not use the .dcf file.
aticp:external_link
Description
Markup for external links
Sample Markup
<Specials>
<Link
element="ulink"
uri="url"/>
</Specials>
Notes
For non-DITA document types, you can identify the element with this ACL function: link_tag_name([doc]). For DITA document types, use the _cpix::make_external_link(doc) and _cpix::get_link_element() functions. These functions can be customized and do not use the .dcf file.
aticp:external_link_attribute
Description
The reference attribute for external links
Sample Markup
<Specials>
<Link
element="ulink"
uri="url"/>
</Specials>
Notes
For non-DITA document types, you can identify the element with this ACL function: link_idref_attr_name(tagname[, doc]). For DITA document types, use the _cpix::make_external_link(doc) and _cpix::get_link_attribute() functions. These functions can be customized and do not use the .dcf file.
aticp:graphic
Description
Markup for block graphics
Sample Markup
<Specials>
<Graphic
element="graphic"
... />
</Specials>
Notes
You can identify the element with this ACL function: graphic_tag_name([doc[, prompt]])
aticp:graphic_height_attribute
Description
The height attribute for block graphics
Sample Markup
<Specials>
<Graphic
...
reproDepth="depth"
... />
</Specials>
Notes
You can identify the element with this ACL function: graphic_attr_name(tagname, repodep[, doc])
aticp:graphic_width_attribute
Description
The width attribute for block graphics
Sample Markup
<Specials>
<Graphic
...
reproWidth="width"
... />
</Specials>
Notes
You can identify the element with this ACL function: graphic_attr_name(tagname, repowid[, doc])
aticp:graphic_scalefit_attribute_value
Description
The scalefit attribute for block graphics
Sample Markup
<Specials>
<Graphic
...
scaleToFit="scalefit"
... />
</Specials>
Notes
You can identify the element with this ACL function: graphic_attr_name(tagname, scalefit[, doc])
aticp:inline_graphic
Description
Markup for inline graphics
Sample Markup
<Specials>
<Graphic
element="inlinegraphic"
... />
</Specials>
Notes
You can identify the element through the first inline graphic element returned with this ACL function: dcfmodel_element_list(arr, 'graphic', [doc], 0).
aticp:inline_graphic_height_attribute
Description
The height attribute for inline graphics
Sample Markup
Same attribute as block graphics
Notes
Same ACL function as block graphics
aticp:inline_graphic_width_attribute
Description
The width attribute for inline graphics
Sample Markup
Same attribute as block graphics
Notes
Same ACL function as block graphics
aticp:inline_graphic_scalefit_attribute_value
Description
The scalefit attribute for inline graphics
Sample Markup
Same attribute as block graphics
Notes
Same ACL function as block graphics
aticp:default_table_with_title
Description
Markup for the document type’s default table model when a title element is required
Sample Markup
<PasteOptions>
<PasteElement
category="primary_table_wrapper"
element="informaltable"/>
</PasteOptions>
Notes
If the document type contains only one supported table model, then that is the default model. Otherwise, you can define the default table model in the .dcf file.
aticp:default_table_without_title
Description
Markup for the document type’s default table model when there is no title element
Sample Markup
Same as above
Notes
Same as above
aticp:table_title
Description
Markup for the table title
Sample Markup
None
Notes
This element is defined by the document type and the content model of the table markup. You can identify the element with this ACL function: tbl_model_table_title(tmid)
aticp:table_with_title
Description
Markup for the table wrapper element when a title element is required
Sample Markup
None required
Notes
This is the element defined by the primary_table_wrapper category in the .dcf file’s PasteElement element paste option. If this is not defined in the .dcf file and there is no default table model, then this is the first table in the document type’s table model list that has a required title element.
aticp:table_without_title
Description
Markup for the table wrapper element when a title element is not required
Sample Markup
None required
Notes
This is the element defined by the primary_table_wrapper category in the .dcf file’s PasteElement element paste option. If this is not defined in the .dcf file and there is no default table model, then this is the first table in the document type’s table model list that has a optional or no title element.
aticp:source_type
Description
Source type for the clipboard data
Sample Markup
None
Notes
This placeholder is defined by the type of copy operation taking place based on the defined precedence of the clipboard data. This is used to support the Paste Special feature by helping define the correct source type for that operation.
aticp_graphic_attr_name
Description
The reference attribute for graphics
Sample Markup
Possibly set through:
<Specials>
<Graphic
...
entity="entityref"
filename="fileref"
... />
</Specials>
Notes
If this is not in the .dcf file, it is determined from the document type. This is set through the ACL function oid_set_graphic_pathname(). This placeholder is used internally and dynamically in place of hard coded attribute names. This makes the MapObject more generic.
This operation is performed in an ACL paste callback named checksmartcopypaste which is located in Arbortext-path\packages\main\_cpix.acl.
aticp_id_attr_name
Description
The ID attribute
Sample Markup
Possibly set through:
<Options
...
idAttribute="id"
... >
</Options>
Notes
You can identify the element with this ACL function: target_id_attr_name(tagname[, doc]). For DITA document types, this is defined in the .dcf file. For other document types, it is defined in the document type. This placeholder is used internally and dynamically in place of hard coded attribute names. This makes the MapObject more generic.
aticp_internal_link_attr_name
Description
The internal link reference attribute
Sample Markup
Possibly set through:
<Specials>
<Link
element="link"
idref="linkend"/>
</Specials>
Notes
For non-DITA document types, you can identify the attribute with this ACL function: link_idref_attr_name(tagname[, doc]). This attribute is defined either in the .dcf file or in the document type. Special processing occurs for DITA documents to specify required attributes. This placeholder is used internally and dynamically in place of hard coded attribute names. This makes the MapObject more generic.
aticp_external_link_attr_name
Description
The external link reference attribute
Sample Markup
Possibly set through:
<Specials>
<Link
element="ulink"
uri="url"/>
</Specials>
Notes
For non-DITA document types, you can identify the element with this ACL function: link_idref_attr_name(tagname[, doc]). This attribute is defined either in the .dcf file or in the document type. Special processing occurs for DITA documents to specify required attributes. This placeholder is used internally and dynamically in place of hard coded attribute names. This makes the MapObject more generic.
As with the automatically generated MapTemplate files, you can modify a copy of the base files in the MapTemplate Editor as required for your site. Put the modified files in either the Arbortext-path\custom\lib directory or in a custom\lib directory referenced through the APTCUSTOM environment variable. Your customized MapTemplate file will override the base file.
* 
If you put a customized, automatically generated MapTemplate file (such as rtf-topic.std) into a custom\lib directory, then any changes you make to the base MapTemplate files that affect the RTF source type will not apply for that document type.
Following are some examples of how you might modify the base MapTemplate files:
To expand the functionality of one of the base MapTemplate files, insert the appropriate placeholder name in place of actual document type dependent element names. Your base MapTemplate file will affect all document types. For example, if your Microsoft Word documents use special style names for division titles, you might add new MapObjects or modify the Input Rules of existing MapObjects. These MapObjects in a base MapTemplate file can include placeholder names for division elements and their title in the Output Steps of the MapObject’s Output Rules.
The base table MapTemplate files produce hard-coded element names rather than placeholder names, because these names are typical of the table models supported by Arbortext Editor. If your document type uses namespaced elements for one or more of the supported table models, you can modify the Output Rules of the base table MapTemplate and the change will affect all source types and document types at your site.
Because default styles are less common in Adobe FrameMaker, custom MapTemplate files can provide better support for both divisions and their titles and numbered and bulleted lists.
Customizing the MapTemplate files
You can customize the MapTemplate files in the following ways:
The base MapTemplate files themselves
Changes you make here will affect all of the automatically generated files. Also, if Arbortext changes the base files in a future release those changes will not be reflected in your customized file.
Custom overrides to the base files
If there are just certain areas of the base map files that you want to customize, you can create a custom override file to the base files that just affects certain parts of the base file. Custom override files are named the same as the base file with -custom appended to the name of the file. For example, the override file for the common-base.std file would be named common-base-custom.std. The changes you make in the custom override file are prepended to the base file and override the base file content. As with other customized files, you put the modified files in either the Arbortext-path\custom\lib directory or in a custom\lib directory referenced through the APTCUSTOM environment variable.
The automatically generated MapTemplate files
Changes you make here will override any customizations you make to the base files or a custom override file for the base files. In fact, if you have a customized file in place at this level, no automatic file generation takes place for that type of file.
Again, if Arbortext changes the base files in a future release those changes will not be reflected in your customized file.
Custom overrides to the automatically generated files
As with the base files, you can create a custom override file for the automatically generated files that just affects parts of those files. This override file uses the same naming convention as the overrides to the base files. For example, the override file for rtf-topic.std would be named rtf-topic-custom.std. This override file would also need to be in a custom directory.
Note that any changes you make in this override file would take precedence over changes you have made to the base files or a custom override file for the base files.
The best practice for customizing the MapTemplate files is to use the custom override files. This enables you to just change the specific parts of the base and automatically generated files that you need to modify. Note that this feature only recognizes the map objects found in a custom map template. It ignores the metadata in a map template, such as the drivers, driver options, and pre- and post-processing options. Those settings are defined in the rtf-base.std, mif-base.std, htm-base.std, and txt-base.std files.
The following sample files are available in the Arbortext-path\samples\copypaste directory:
common-base-custom.std — Shows how to customize the default pasting behavior by having bold text in other applications converted to a processing instruction.
rtf-task-custom.std — Shows how to use the Paste Special dialog box to paste numbered lists as steps and substeps in a DITA task.
pasteAsList.xlf — Used with the rtf-task-custom.std sample file to show the changes to the Paste Special dialog box.
rtf-topic-custom.std — Shows how to paste footnotes and index terms from Microsoft Word to a DITA topic.
rtf-axdocbook.std and pasteaslist.xlf — Shows how to paste footnotes and index terms from Microsoft Word to an XML DocBook document.
A readme.txt file in the directory describes how to implement the sample files.
Manually generating the MapTemplate files
You can use the create_copypaste_map function to manually generate a MapTemplate file for a given source type and document type. The function returns the same MapTemplate file as the one automatically created by Arbortext Editor.
This function has the following syntax:
create_copypaste_map (source_type, path[, doc])
This function generates a basic MapTemplate file for the given clipboard source type and document type. It has the following parameters:
source_type — Specifies the type of clipboard data. The following values are supported:
htm — HTML markup
mif — Maker Interchange Format (MIF)
rtf — Rich Text Format (RTF)
txt — Unicode and 8-bit ANSI text
path — The full path to the generated MapTemplate file.
The manually generated MapTemplate file must follow the same naming convention as the automatically generated files: source_type-doctype_name.std. For example, a MapTemplate file for the RTF source type and the axdocbook document type must be named rtf-axdocbook.std.
doc — Optional. The identifier of the document for which the associated document type should be used for the MapTemplate file.
If doc is omitted or is 0, the current document is used.
The function returns 0 on success or one of the following error codes on failure:
Code
Values
1
Base MapTemplate file not found
2
Cannot open destination MapTemplate file
3
Invalid document type (such as ASCII)
4
Base table MapTemplate file not found
5
No DITA DOCTYPE element found
6
Unknown error creating MapTemplate file
Related topics
Copying and pasting text from other applications
Configuring and Using Arbortext Import/Export
Document type configuration files
Cache directory (.aptcache)
set pastesource
Using Paste Special