Customizer's Guide > Customizing Copying and Pasting from Other Applications > Implementing Copy and Paste for a Custom Document Type
  
Implementing Copy and Paste for a Custom Document Type
You can implement the copying and pasting from other applications feature for custom document types. However, to get the best results you must be sure to provide the configuration information in your document type that Arbortext Editor requires to be able to correctly convert the source clipboard data into your document type’s markup.
Some of this information is in the document type itself, such as the supported table models. Also, some information is in the associated Arbortext Styler.style file. However, most of the required information is in the associated document type configuration (.dcf) file. You will get the best results from this feature by ensuring that this information is configured in your .dcf file. The following table summarizes the required .dcf file settings and provides example markup from the axdocbook.dcf file.
Description
Sample axdocbook .dcf File Markup
Primary paragraph element
<Specials>
<Paragraph
element="para"/>
</Specials>
Highest division element
<PasteOptions>
<PasteElement
category="primary_division"
element="chapter"/>
</PasteOptions>
Primary division element
<ElementOptions>
<ElementOption
category="division"
element="sect1"
primary="yes"/>
</ElementOptions>
Nested primary division element(s)
<ElementOptions>
<ElementOption
category="division"
element="sect2"
primary="yes"/>
</ElementOptions>
Primary division title element
<PasteOptions>
<PasteElement
category="primary_division_title"
element="title"/>
</PasteOptions>
Markup for bold text
<TextStyles>
<Bold
attribute="role"
attributeValue="bold"
element="emphasis"/>
</TextStyles>
Markup for italic text
<TextStyles>
<Italic
attribute="role"
attributeValue="italic"
element="emphasis"/>
</TextStyles>
Markup for underline text
<TextStyles>
<Underline
attribute="role"
attributeValue="underline"
element="emphasis"/>
</TextStyles>
Markup for smallcaps text
<TextStyles>
<SmallCaps
attribute="role"
attributeValue="smallcaps"
element="emphasis"/>
</TextStyles>
Markup for subscript text
<TextStyles>
<Subscript
element="subscript"/>
</TextStyles>
Markup for superscript text
<TextStyles>
<Superscript
element="superscript"/>
</TextStyles>
Markup for bulleted list
<Lists>
<Bulleted>
<Block element="itemizedlist"/>
<Item element="listitem"/>
</Bulleted>
</Lists>
Markup for bulleted list item
<Lists>
<Bulleted>
...
<Item element="listitem"/>
</Bulleted>
</Lists>
Markup for numbered list
<Lists>
<Numbered>
<Block element="orderedlist"/>
<Item element="listitem"/>
</Numbered>
</Lists>
Markup for numbered list item
<Lists>
<Numbered>
...
<Item element="listitem"/>
</Numbered>
</Lists>
Markup for internal document links
<Specials>
<Link
element="link"
idref="linkend"/>
</Specials>
The reference attribute for internal document links
<Specials>
<Link
element="link"
idref="linkend"/>
</Specials>
Markup for external links
<Specials>
<Link
element="ulink"
uri="url"/>
</Specials>
The reference attribute for external links
<Specials>
<Link
element="ulink"
uri="url"/>
</Specials>
Markup for block graphics
<Specials>
<Graphic
element="graphic"
... />
</Specials>
The height attribute for block graphics
<Specials>
<Graphic
...
reproDepth="depth"
... />
</Specials>
The width attribute for block graphics
<Specials>
<Graphic
...
reproWidth="width"
... />
</Specials>
The scalefit attribute for block graphics
<Specials>
<Graphic
...
scaleToFit="scalefit"
... />
</Specials>
Markup for inline graphics
<Specials>
<Graphic
element="inlinegraphic"
... />
</Specials>
The height attribute for inline graphics
Same attribute as block graphics
The width attribute for inline graphics
Same attribute as block graphics
The scalefit attribute for inline graphics
Same attribute as block graphics
Markup for the document type’s default table model
<PasteOptions>
<PasteElement
category="primary_table_wrapper"
element="informaltable"/>
</PasteOptions>
The reference attribute for graphics
<Specials>
<Graphic
...
entity="entityref"
filename="fileref"
... />
</Specials>
The determination of whether this is a file reference or entity reference depends on either the .style file or the .dcf file settings for graphic details. If the document type has a .style file, those settings take precedence and any .dcf file settings are ignored.
The ID attribute
<Options
...
idAttribute="id"
... >
</Options>
Arbortext Editor will use the information in your document type and the associated .dcf and .style files to build the automatically generated MapTemplate files for your document type and the relevant clipboard source formats. If you make a change to the .dcf file, then the automatically generated files are regenerated in the next copy and paste operation using the document type. If a .style file is associated with the document type, the information in the .style file for graphics, links, and link targets takes precedence over related .dcf information. All other information that controls copy and paste is collected from the .dcf file.
You might also want to customize the base MapTemplate files or the Paste Special dialog box for your custom document type. However, note that a MapTemplate file specific to a source type and document type (such as rtf-task.std for a DITA Task document) can be modified in the MapTemplate Editor without regard to the .dcf file information. Remember that the automatically generated MapTemplate files will be populated by placeholder element names rather than actual element names. You can modify the default MapTemplate files as desired using Arbortext Import, or even create custom MapTemplate files for copy and paste from scratch using the MapTemplate Editor. As long as you follow the file naming convention and put the customized MapTemplate file in a custom\lib folder, that file will control the conversion process.
Related topics
Copying and pasting text from other applications
Document type configuration files