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 or never, 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>
In Windchill, you must set the value false for the worker parameter com.ptc.arbortext.wvs/disableMetadataReplacer added to your publishing rules for the Arbortext authoring application. See the SamplePublishingRules.xml file located at Windchill-path\codebase\com\ptc\arbortext\windchill\worker for an example. This ensures that any changes made to applicable Windchill metadata are reflected in the published document.
The metadata attributes that are used for two-way-metadata must be included in the payload that is sent from Windchill to Arbortext Publishing Engine. To do this, you need to edit the file manifest_attset.xml and include the attributes. For more information on the manifest_attset.xml file.
Supported PTC Server System Attributes
The following PTC Server System Attributes are supported values for the source attribute.
Supported PTC Server System Attributes
Attribute Name
Burst Configuration File Name
CMS Object Logical ID
IO_ATTR_LOGICAL_ID
Check In Comment
WC_COMMENT_ATTR
Created By
WC_CREATEDBY_ATTR
Created On
WC_CREATEDON_ATTR
Last Modified
WC_LASTUPDATEDON_ATTR
Lifecycle State
WC_LIFECYCLE_ATTR
Modified By
WC_LASTUPDATEDBY_ATTR
Target Folder Name
WC_TARGET_FOLDER_ATTR
If you want to use the above attributes in CopyMetadataConfig.xml file, then you must ensure that their Windchill attributes are included in the manifest_attset.xml file for the DynamicDocument type in Windchill.
Attribute in CopyMetadataConfig.xml
Attribute in manifest_attset.xml
Check In Comment
WC_COMMENT_ATTR
Created By
WC_CREATEDBY_ATTR
Lifecycle State
WC_LIFECYCLE_ATTR
Modified By
WC_LASTUPDATEDBY_ATTR
Target Folder Name
WC_TARGET_FOLDER_ATTR
For example:
<Type name=”${domain}.DynamicDocument”>
<Attribute action=”include” name=”state.state” type=”enum” token=”wt.lifecycle.State”/>
<Attribute action=”include” name=”iterationNote” />
<Attribute action=”include” name=” modifier.id” type=”reference”/>
<Attribute action=”include” name=” creator.id” type=”reference”/>
<Attribute action=”include” name=” folder.id” type=”reference”/>
The other PTC Server System Attributes apart from the ones listed above are not supported for two-way-metadata.
See Windchill Help topic Defining Attribute Sets.
For more information about twowaymetadata rule, see the Assigning PTC Server Properties topic.