高度なカスタマイズ > ビジネスロジックのカスタマイズ > Windchill で標準を使用したデータ交換 > EXPRESS を使用した STEP データ交換 > STEP Foundation > メタデータマッピングの設定 > プリファレンス定義の設定
  
プリファレンス定義の設定
ここでは 2 つのアプローチが考えられます。
1. <Windchill>\codebase\registry\ixb\mapping IXMappingConfiguration.xml ファイルで設定されているマッピングごとに個別のプリファレンス定義を設定する必要があります。これらのプリファレンス定義はすべて、プリファレンスのインポートユーティリティを使用して組み合わせたりロードしたりできます。ロード可能なプリファレンス定義は、以下に示すように、それぞれインポート可能ファイルで設定されます。
<PreferenceDefinition>
<name>R_objectContainerPath</name>
<!-identifier of the preference definition,
unique in the system-->
<visibility>HIDDEN</visibility>
<!-should be HIDDEN to avoid it showing up in the UI -->
<categoryName>FederationMapping</categoryName>
<!- it would be always FederationMapping -->
<displayName>R_objectContainerPath</displayName>
<description>Mapping for the containerPath </description>
<fullDescription> Mapping for the containerPath
</fullDescription>
<defaultValue></defaultValue>
<!-can have no value, but schema needs this element
to be specified -->
<handler>com.ptc.windchill.enterprise.preference.handler.
MultiValueMapPreferenceHandler:</handler>
<!-always MultiValuePreferenceHandler -->
<defaultComments>Mapping Test for
objectContainerPath</defaultComments>
<clientOverride>true</clientOverride>
<!-if true, implies one can override the value -->
</PreferenceDefinition>
また、スキーマに適合しています。
<!ELEMENT PreferenceDefinition ( name, ObjectID?, BACInfo?, visibility,
categoryName, displayName, description, fullDescription, defaultValue,
handler, defaultComments?, clientOverride?, clientDelegate?, clientData?)>
* 
サンプルファイルは、システム内の次の場所にあります。..\IX_LOAD\prog_examples\Mappings\src\mappings-pref.xml
このため、プリファレンス定義は特定のプリファレンスクライアントにリンクされる必要があります。これを行うには、次のエントリを同じローダーファイルに追加します。前述の "renault-preference-definition.xml" を参照してください。
<LinkPreferenceClientDefinition>
<name>R_objectContainerPath</name>
<!-identifier of the preference definition to be linked -->
<clientName>
536416322-1456322554305-2141932519-203-136-220-10
</clientName>
<!-name of the preference client to link to. This preference
client is implicitly created by the same utility that creates
the CollaborationSourceInfo and usually has the same name as
‘guid’ parameter provided to that utility.
This client name identifies the source system for which mappings
have been defined. One can relate the definition to multiple
client names and hence multiple source systems -->
</LinkPreferenceClientDefinition>
2. CSV フォーマットのマッピングはすべて、このサンプルのように設定できます。このように設定した後、次のようにマッピングコンバータユーティリティを使用して、インポート可能なプリファレンス定義ファイルを生成します。
* 
サンプルファイルは、システム内の次の場所にあります。..\IX_LOAD\prog_examples\Mappings\src\mappings.csv
windchill wt.ixb.publicforapps.extendedmapping.tools.Metadat aMappingConverter -csvtoxml "e:\ptc\mapping-test\mappings.csv" null mappings-pref true
mappings-pref は、後でインポートされる出力 XML ファイル名です。
プリファレンス定義をシステムにインポートするコマンドは、次のとおりです。
windchill wt.preference.ImportPreferences -importfile=e:\ptc\mapping-test\mappings-pref.xml -overwriteValueConflicts -user=wcadmin -password=wcadmin
* 
"-usage" オプションを使用して、このユーティリティの詳細を確認します。
windchill wt.preference.ImportPreferences -usage