Content Transfer Assistant (CTA) allows users to copy and paste content between documents and define what style should be applied when pasted. These definitions can be saved as 'Schema's' and can be shared between users.
A full description of how CTA works can be found here. This article focuses on how it should be configured within the clients solution.
SDUP Structure
Modules
The module for CTA is located here:
...\AlloyPlugins\ModuleLibrary\ContentTransferAssistant\01_nocontext_ContentTransferAssistant
Copy the folder into the Modules folder in your SDUP. This module contains a number of different buttons that are designed to be used in conjunction with each other.
Plugin
Plugin here:
...\AlloyPlugins\Omnidocs.ContentTransferAssistant
Folder structure
CTA relies on the existence of two separate folders within the users OfficeExtensions\Content
folder.
Schemas
contains all the schemas that each individual creates.
Global
is designed to be used by the clients own global admins. Here they can add individual schema's that can be accessed by all users. Individual users cannot write to this folder locaition.
These can be found here:
...\AlloyPlugins\Configuration\Omnidocs.ContentTransferAssistant
NOTE that both of these folders contain a single text file called DO_NOT_DELETE.txt. These exist simply to prevent Templafy from deleting the folders on deployment of a package if they are empty.
In addition, CTA will create a temporary file in a folder defined within the module when copying. This contains the content copied during the process. When the paste command is used, the content will be selected from this temp file and once the paste process is complete, this file will be deleted. See below references to TempFileOverride
for more information on this.
CMDs
A number of commands must be configured in conjunction for the tool.
Copy
This is the first step in the CTA process.
<Cmd case="Omnidocs.ContentTransferAssistant:copy"
selectAll="true"
TempFileOverride="%localappdata%\OfficeExtensions\User\Temp"/>
Parameters
SelectContent
This is an optional parameter and accepts two values. false
copies only the currently selected content in the active document. If the parameter is omitted this is the default behaviour. true
selects all content within the document.
TempFileOverride
This is a required parameter. Defines the location of the temp file created during the process.
Paste
Once the user has copied content, this command can be used to paste it in the required file. This will also prompt the CTA task pane to appear allowing the user to select an existing schema or create a new schema to apply to the pasted content.
<Cmd case="Omnidocs.ContentTransferAssistant:paste"
stylePrefixes="appendix;schedule"
TempFileOverride="%localappdata%\OfficeExtensions\User\Temp"
PasteAtBookmarkName="bmkStart">
<ReplaceTocWith>TOC \O "1-2" \H \Z \T</ReplaceTocWith>
</Cmd>
Parameters
stylePrefixes
This is an optional parameter. In many cases clients will have identically styled multi-level numbering. When defining schema's, this parameter allows the tool to differentiate between styles where they have different numbering prefixes but are otherwise identical.
TempFileOverride
This is a required parameter. Defines the location of the temp file created during the process. NOTE that it MUST match the same value as defined within the copy command.
PasteAtBookmarkName
This is an optional parameter. If included, this parameter will paste the content at the location of the bookmark defined.
ReplaceTocWith
This is an optional parameter. If included, this parameter will find any TOC field codes within the document and replace it with code defined in the module.
Edit Schema
This command allows users to delete previously created definitions within personal schema's. NOTE that to change a definition a user must first delete the existing definition, then re-add the correct definition.
<Cmd case="Omnidocs.ContentTransferAssistant:edit"/>
Convert
Allows a user to create or apply schema's to existing content within a document. No paste action is involved with this command.
<Cmd case="Omnidocs.ContentTransferAssistant:convert"
stylePrefixes="appendix;schedule;part"
TempFileOverride="%localappdata%\OfficeExtensions\User\Temp">
<ReplaceTocWith>TOC \O "1-2" \H \Z \T</ReplaceTocWith>
</Cmd>
Parameters
stylePrefixes
This is an optional parameter. In many cases clients will have identically styled multi-level numbering. When defining schema's, this parameter allows the tool to differentiate between styles where they have different numbering prefixes but are otherwise identical.
TempFileOverride
This is a required parameter. Defines the location of the temp file created during the process. NOTE that it MUST match the same value as defined within the paste command.
ReplaceTocWith
This is an optional parameter. If included, this parameter will find any TOC field codes within the document and replace it with code defined in the module.
Handling xml parts
CTA also supports the transfer of specific xml parts as part of the copy paste process. This is achieved using two separate commands which must be added to relevant buttons within the module.
In both commands the namespaces
parameter defines which xml parts should be copied and pasted. Multiple namespaces are supported by separating each with a semi-colon.
Copy
This should be included as part of any copy button.
<Cmd case="Omnidocs.ContentTransferAssistant:copy-customxmlpart"
namespaces="xx;yy"/>
Paste
This should be included as part of any paste button.
<Cmd case="Omnidocs.ContentTransferAssistant:paste-customxmlpart"
namespaces="xx;yy"/>
Transferring to a new file
CTA supports integration with Templafy One to allow users to transfer content directly to a new document selected from Templafy. NOTE that this is not currently supported by Templafy Hive.
In this case, in addition to CTA, the SkabelonDesign.ReuseDoc
plugin will also need to be included in the clients SDUP. For more information on this refer to this article.
Below is an example of how the two plugins can be used in conjunction.
- Omnidocs.ContentTransferAssistant:copy is used to copy the required content
- SkabelonDesign.ReuseDoc:TemplafyReuse is used to present the user with the Templafy template selection pane
- Omnidocs.ContentTransferAssistant:paste is then used to paste the content to the new document. I
<Button label="CTA to New File" icon="ImportOpml" size="large" showInPowerPoint="false" showInOutlook="false" showInExcel="false"> <Cmd case="Omnidocs.ContentTransferAssistant:copy" selectAll="true" TempFileOverride="%localappdata%\OfficeExtensions\User\Temp"/> <cmd case="SkabelonDesign.ReuseDoc:TemplafyReuse" relativePathDocPropName="DisplayName" relativePathFallback="documents" closeSourceDocument="false"> <ReplacementMap/> <PreCommands> <!-- Extract etc. --></PreCommands> <PostCommands> <!--SPECIFIC HANDLING --> <Cmd case="Omnidocs.ContentTransferAssistant:paste-customxmlpart" namespaces="xx" TempFileOverride="%localappdata%\OfficeExtensions\User\Temp"/> <Cmd case="Omnidocs.ContentTransferAssistant:paste" stylePrefixes="appendix;schedule;part" TempFileOverride="%localappdata%\OfficeExtensions\User\Temp" PasteAtBookmarkName="bmkStart"> <ReplaceTocWith>TOC \O "1-2" \H \Z \T</ReplaceTocWith> </Cmd> </PostCommands> <PostPostCommands/> </cmd> <Cmd case="BaseExtensions:update-fields"/> </Button>
Languages supported
By default Word will translate the names of built in styles when opening in versions of office with different display languages set. So for example, the Heading 1 style when opened in a German language instance of word will show as Überschrift 1. This change needs to be handled by CTA and so it includes translation for all in built in style names. The current languages supported are:
- English
- German
- French
- Italian
Additional languages will need to be requested from development.
Comments
0 comments
Please sign in to leave a comment.