Examples of Publish Rules XML Files
This section contains complete Publish Rules XML file examples. A sample Publish Rules XML file, PublishRules.xml, can be found in the <Windchill>/codebase/com/ptc/wvs/server/xml directory.
Simple Arbortext Publishing
This example publishes all Arbortext authored EPMDocuments when they are checked in, when a user creates a representation via the Create Representation Wizard, or when the EPMDocument is included in scheduled publishing. A PDF file is created by the Worker and stored as part of the Representation. The DefaultPostPublishDelegate is invoked when the Worker completes the creation or iteration of a WTDocument whose content is the PDF created by the Worker.
* 
The use of Substitution Keys to define the Name of the WTDocument that is created/iterated.
Several <publish> elements make use of the same <param-set>.
<rules xmlns="http://www.ptc.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ptc.com PublishRulesSchema.xsd">
<authoring-application name="ARBORTEXT">
<param-set name="Share with WTDocument">
<post-publish name="delegate">com.ptc.wvs.server.publish.
DefaultPostPublishDelegate</post-publish>
<post-publish name="name">{OUTPUT_TYPE} {AUTHORING_APP}
{EPM_NUMBER}</post-publish>
<post-publish name="published-content-link">create</
post-publish>
</param-set>
<publish on="checkin" output="PDF" param-set="Share with
WTDocument"/>
<publish on="create-representation" output="PDF" param-set=
"Share with WTDocument"/>
<publish on="schedule" output="PDF" param-set="Share with
WTDocument"/>
</authoring-application>
</rules>
Creating Arbortext Documents from CAD Documents
This example publishes Creo Parametric and SolidWorks authored EPMDocuments. If the EPMDocument has a global attribute named PUBLISH TO ARBORTEXT, or if a user manually invokes Post Publishing on an existing Representation, the EPMPostPublishDelegate is invoked to create/iterate an Arbortext authored Dynamic Document.
* 
Multiple Authoring Applications are making use of a single <param-set>.
All Creo Parametric and SOLIDWORKS authored EPMDocuments is published, but the EPMPostPublishDelegate is only invoked for those that have the specified global attribute (its value is not considered).
The EPMPostPublishDelegate can be invoked by the user for any Representation previously published by these Authoring Applications.
<rules xmlns="http://www.ptc.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ptc.com PublishRulesSchema.xsd">
<param-set name="Share with Arbortext">
<post-publish
name="delegate">com.ptc.wvs.server.publish.EPMPostPublishDelegate</
post-publish>
<post-publish name=”type”>DynamicDocument</post-publish>
<post-publish name="cad-authoring-application">ARBORTEXT</
post-publish>
<post-publish name="cad-type">PUB_CADVIEWABLE</post-publish>
<post-publish name="name">GDD from {AUTHORING_APP} {EPM_NUMBER}</
post-publish>
<post-publish name="published-content-link">create</post-publish>
</param-set>

<authoring-application name="PROE">
<epm-iba iba="PUBLISH TO ARBORTEXT">
<publish on="checkin" param-set="Share with Arbortext"/>
<publish on="create-representation" param-set="Share with
Arbortext"/>
<publish on="schedule" param-set="Share with Arbortext"/>
</epm-iba>

<publish on="checkin"/>
<publish on="create-representation"/>
<publish on="schedule"/>
<publish on="manual-post" param-set="Share with Arbortext"/>
</authoring-application>

<authoring-application name="SOLIDWORKS">
<epm-iba iba="PUBLISH TO ARBORTEXT">
<publish on="checkin" param-set="Share with Arbortext"/>
<publish on="create-representation" param-set="Share with
Arbortext"/>
<publish on="schedule" param-set="Share with Arbortext"/>
</epm-iba>

<publish on="checkin"/>
<publish on="create-representation"/>
<publish on="schedule"/>
<publish on="manual-post" param-set="Share with Arbortext"/>
</authoring-application>
</rules>
Defining Publish Rules for VCS Publishing for Output Formats like Arbortext
A param-set needs to be defined in the publishing rules and this param-set needs to be specified for all output formats for which VCS publishing is to be used. Following is an example of a param-set added to the SamplePublishingRules.xml file located at <WT_HOME>.
To enable VCS publishing, update the publishing rules as follows:
1. Define a VCS param-set in the publishing rules for Arbortext. An example of param-set for VCS is as follows:
\codebase\com\ptc\arbortext\windchill\worker
Here the parameters that were earlier passed in the worker configuration files are now included in the param-set.
2. Specify this param-set for publishing rules of specific output formats to be published using VCS.
For example:

<publish on=“create-representation” output=“PDF” param-set= “Publish Arbortext DynamicDocument VCS”/>
This publishing rule will create representation in PDF output using VCS publishing.
3. Upload this updated file for Publishing Rules in Windchill Visualization Configuration Administration.
Было ли это полезно?