Content Management > PTC Server connection Setup > Configuring Two-way Metadata for Document Publishing
  
Configuring Two-way Metadata for Document Publishing
For Windchill 12.1.1.0 and higher, the Arbortext Publishing Engine Worker can pass the document and graphic content that Arbortext Publishing Engine needs for publishing in a payload. This way Arbortext Publishing Engine does not need to call back into Windchill to fetch the compound document components that are being published. Whenever the com.ptc.arbortext.wvs/ PreferAdapter setting in the publishing rule is set to no, the payload method will be used. When the payload method is used, any two-way or to-xml metadata rules need to be included in a separate CopyMetadataConfig.xml file for the xml content to reflect the correct metadata values during publishing.
Configuring two-way metadata allows to synchronize changes in values that appear in document object metadata as well as inside the document object xml.
You can configure two-way metadata to synchronize changes made to metadata in Windchill into documents published using Arbortext Publishing Engine. You must create a CopyMetadataConfig.xml file to configure this option.
The configuration file uses three elements:
CopyMetadataConfig—The root element
Boundary— Constrains the copy behavior to doctypes with an optional specific root node
Copy— Defines the metadata source, the condition, and the target location
For example,
<?xml version="1.0" encoding="UTF-8"?>
<CopyMetadataConfig version="2.0">
<Boundary doctype="ditabase" root="topic">
<Copy source="IBA2" target="title"/>
</Boundary>
</CopyMetadataConfig>
In this case, at the time of publishing the topic, the content of the title element is taken from IBA2 attribute in Windchill.
The following example shows different ways the target element can be specified::
<?xml version="1.0" encoding="UTF-8"?>
<CopyMetadataConfig version="2.0">
<Boundary doctype="doctype" root="*"><!-- lower precedence -->
...
</Boundary>
<Boundary doctype="doctype" root="rootname">
<Copy source="metaname" target="elemname"/>
<Copy source="metaname" target="elemname@attrname"/>
<Copy source="metaname" target="elemname[@matchattrname=matchattrvalue]"/>
<Copy source="metaname" target="elemname[@matchattrname=matchattrvalue]@attrname"/>
</Boundary>
</CopyMetadataConfig>
The XML document must be of the given doctype and start with the root element rootname (if given and not *). In order, these four sample rules copy in the metadata metaname:
as first textual child of elemname
as value of attribute attrname of elemname
as first textual child of elemname if the match condition holds
as value of attribute attrname of elemname if the match condition holds
The match condition is that the element must have an attribute by the name matchattrname whose value is matchattrvalue.
This file is looked for in (local to the Arbortext Publishing Engine server):
a file folder specified by the APTOBJCFG environment variable, and
the lib directory of all known custom/application directories
Note that for IBAs (reusable attributes), .bcf files must include the internal name of the IBA whereas in case of CopyMetadataConfig.xml file, you must use the logical identifier of the IBA.
For example, the same twowaymetadatarule added in a .bcf file to set up twowaymetadata in Arbortext Editor is given below:
<dmsmetadata>
<twowaymetadatarule sourcetype="text" bndryelemname="topic"
metadataelemname="title"
metadata="org.rnd.iba2" mode="twoway"></twowaymetadatarule>
</dmsmetadata>
For more information about twowaymetadata rule, see the Assigning PTC Server Properties topic.