エンタープライズ管理 > Windchill のエクスポートとインポート > インポートおよびエクスポートポリシー、マッピング規則、およびコンフリクトメッセージ > XSL ベースのポリシーファイル
  
XSL ベースのポリシーファイル
ポリシーファイルを作成して、エクスポートまたはインポートのプロセス (特定のプロセス、またはプロセスのセット) に対して適用できます。ポリシーファイルで設定する条件により、ユーザーインタフェースに備わっている一連の操作から特定の操作が選択され、適用されます。インポートで使用できる操作は、"無視"、"新しいオブジェクトの作成"、"オブジェクトの置き換え"、"ロック解除"、および "作業版数化" です。エクスポートでは、ポリシーファイルにより "ロック" 操作を適用できます。マッピング規則ファイルでプロパティを設定するには、そのファイルを編集します。その目的で xconfmanager ユーティリティを使用することはできません。グラフィカルユーザーインタフェースを使用して、またはマッピングファイル内で、プロパティを設定しない場合は、xconfmanager ユーティリティを使用して、プロパティを追加または編集します。
詳細については、xconfmanager ユーティリティの使用を参照してください。
ポリシーファイルの例
以下の例は、インポートおよびエクスポート用の XSL ベースのポリシーファイルの構文を示しています。この例には、ポリシーファイルの使用について説明するコメントが埋め込まれています。
インポート
<?xml version="1.0" ?>
<xsl.stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform"
version="2.0>
<!--
The following is a sample of a well-formed xsl. In the
cases where there are no specific actions to be
performed, the target xml (which is being transformed)
should be copied as it is, which is achieved by the
following:
<xsl:template match=@* | node()" priority="-9">
<xsl:copy><xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
-->
<xsl:template match="@* | node()" priority="-9">
<xsl:copy>
<xsl:apply-templates selecte="@* | node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="WTPart">
<actionInfo>
<action:PickExistingObject</action>
</actionInfo>
</xsl:template>
<xsl:template match="WTDocument">
<actionInfo>
<action>PickExistingObject</action>
<actionInfo>
</xsl:template>
<xsl:template match="EPMDocument">
<actionInfo>
<action>PickExistingObject</action>
</actionInfo>
</xsl:template>
</xsl:stylesheet>
エクスポート
<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version=2.0">
<xsl:output method="xml" indent="no" encoding=UTF-8" />
<!--
The syntax of Export Policy is standard XSL syntax. The
output of XSLT using the XSL policy file must have at
most one element of the form:
<actionInfo>
<action>...</action>
</actionInfo>
-->
<!--
The following is a sample of a well-formed xsl. In the
cases where there are no specific actions to be
performed, the target xml (which is being transformed)
should be copied as it is, which is the default action
that would transpire as shown in the uncommented section
below.
-->
<!--
<xsl:template match=@* | node()" priority="-9">
<xsl:copy><xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match=’WTPart’>
<actionInfo>
<action>Checkout</action>
</actionInfo>
</xsl:template>
<xsl:template match=’WTDocument’>
<actionInfo>
<xsl:choose>
<xsl:when test="number"’TESTDOC-1’">
<action>Checkout</action>
</xsl:when>
<xsl:otherwise>
<action>Lock</action>
</xsl:otherwise>
</xsl:choose>
</actionInfo>
<xsl:template>
-->
<!-- Copy everything as is by default -->
<xsl:template match=@* | node()" priority="-9">
<xsl:copy>
<xsl:apply-templates select=@* | node()" />
</xsl:copy>
<xsl:template>
</xsl:stylesheet>