Customizer's Guide > Customizing Copying and Pasting from Other Applications > Customizing the Paste Special Dialog Box
  
Customizing the Paste Special Dialog Box
Besides the automatic copy and paste support, you can control how content from other applications is pasted into a document through the Paste Special dialog box. After you have copied content from another application, you can select Edit > Paste Special  to open the dialog box and select how you want the content to be pasted into your document.
By default, the Paste Special dialog box enables you to paste clipboard content in the following formats:
bullet list
numbered list
paragraphs
table (from tabular text)
table with no title
table with title
text
title
web link
You can customize this dialog box to change the supported document formats, change the format to a different MapObject, or add support for elements in your custom document type. The supported document formats are configured in the following file: Arbortext-path\lib\locale\en\pasteAsList.xlf. Put your customized pasteAsList.xlf file in custom\lib\locale\en (or in your locale specific subdirectory).
The pasteAsList.xlf file uses the XML Localization Interchange File Format (XLIFF) document type. See www.oasis-open.org/committees/xliff/documents/xliff-specification.htm for more information about XLIFF. The XLIFF document type specifies sets of source and target tags, where the source tag contains the string to be translated and the target tag contains the string to be displayed in the dialog box.
Following is the markup from pasteAsList.xlf for the bullet list document format type:
<trans-unit id="1" resname="bullet_list">
<source>bullet list</source>
<target>bullet list</target>
</trans-unit>
Note the resname="bullet_list" part of this markup. That is a reference to one or more MapObjects in the common-base.std base MapTemplate file. These MapObjects are used to convert the content on the clipboard into the document format specified by the selection in the Paste Special dialog box and take precedence over the ones used for the regular copying and pasting operations in that case.
The MapObject in common-base.std that uses the bullet_list reference must use an EVAL_XPATH Input Rule which is triggered by the following XPath expression:
//TEXTXMLSTREAM/HEAD/XYZDOCUMENTMETATAGS/XYZMETA[@name="STDSourceFileName"]
[@value="bullet_list.aticp:source_type"]
This Input Rule can be expressed as “Match this MapObject if the source file name (an abstract name created from the resname attribute value) is equal to bullet_list.rtf or bullet_list.mif or bullet_list.htm” and so forth. Any MapObjects with Input Rules that match if the user has chosen the bullet list item in the Paste Special dialog box will perform the special conversions defined by those rules.
You can use Arbortext Editor to edit the pasteAsList.xlf file to add or remove document formats and to change the strings displayed in the Paste Special dialog box. You can use Arbortext Import to modify the MapObjects referenced in common-base.std (or any other MapTemplate) from pasteAsList.xlf or to add new MapObjects for new document formats.
Note that the MapObject priority as described in Arbortext Import online help is important to Paste Special customization. MapObjects in common-base.std have higher priority values, which means they have lower priority in the top-down MapObject selection process in the final generated map. A very specific MapObject such as those used for Paste Special might never be selected if that MapObject is located below more generic MapObjects that could match the selection first. Be sure to place Paste Special MapObjects near the top of your custom MapTemplate file.
Following are some examples of Paste Special customizations:
Develop a Paste Special MapObject for a paragraph to convert a simple paragraph to a document type specific footnote element.
To do this, follow these steps:
1. Create a new trans-unit element in pasteAsList.xlf:
<trans-unit id="n" resname="footnote">
<source>Footnote</source>
<target>Footnote</target>
</trans-unit>
Replace n with an appropriate integer number for the file.
2. Create a new MapObject in common-base.std (or any customized MapTemplate file) with Input Rules that match the following XPath expression for a general purpose rule:
//TEXTXMLSTREAM/HEAD/XYZDOCUMENTMETATAGS/XYZMETA[@name="STDSourceFileName"]
[@value="footnote.aticp:source_type]"
Or that match the following expression for a rule specific to the RTF source type:
//TEXTXMLSTREAM/HEAD/XYZDOCUMENTMETATAGS/XYZMETA[@name="STDSourceFileName"]
[@value="footnote.rtf]"
3. Add footnote-specific output steps to the newly-created MapObject to produce the footnote markup for your document type.
Develop a new Paste Special MapObject to convert numbered lists into steps and substeps elements in the DITA Task document type, instead of the default behavior of converting numbered lists in the clipboard source into numbered lists in the document type markup.
Develop a new Paste Special MapObject to convert Microsoft Word or Adobe FrameMaker index terms into document type specific index term markup.
Related topics
Copying and pasting text from other applications
Using Paste Special
Paste Special dialog box
Configuring and Using Arbortext Import/Export