高度なカスタマイズ > サービスおよびインフラストラクチャのカスタマイズ > MPMLink のカスタマイズ > MPMLink ブラウザのカスタマイズ > BOM トランスフォーマセッション起動時のカスタムロジックの実装
  
BOM トランスフォーマセッション起動時のカスタムロジックの実装
最良事例の名前と分類
BOM トランスフォーマセッション起動時のカスタムロジックの実装
目的
BOM トランスフォーマセッション起動時のカスタムロジックの実装に関するカスタマイズガイドラインを示します。
前提となる知識
このベストプラクティスを適用するには、以下を理解しておく必要があります。
MPMLink と BOM 構造の基本知識
Java に関連した基本的な開発
*-actions.xml*-actionmodels.xml、および *.xconf ファイルのカスタマイズの管理
ソリューションエレメント
BOM トランスフォーマセッションの起動時にカスタムロジックを実装するには、次の手順を実行します。
1. com.ptc.windchill.baseclient.server.delegate.StructureBroswerDelegate インタフェースを拡張する新規カスタム委任を作成します。たとえば、新規委任が CustomStructureBroswerDelegate である場合、サンプルコードは次のとおりです。
public class CustomStructureBroswerDelegate implements StructureBroswerDelegate{
@Override
public void processBrowserLoad(NmCommandBean commandBean, HttpServletRequest request) throws WTException {
// customization code
}
@Override
public void processBrowserUnload(NmCommandBean commandBean, HttpServletRequest request) throws WTException {
// customization code
}
@Override
public void processBrowserPing(NmCommandBean commandBean, HttpServletRequest request) throws WTException {
// customization code
}
}
* 
public void processBrowserPing(NmCommandBean commandBean, HttpServletRequest request) throws WTException メソッドは、com.ptc.windchill.enterprise.associativity.part.mpml.mapsb_ping プロパティで true 値を指定した場合にのみ呼び出されます。このプロパティは、MAPSB.wt.properties.xconf にある com/ptc/windchill/enterprise/associativity/part/mpml/mapsb にあります。このプロパティのデフォルト値は false です。
2. com/ptc/windchill/enterprise/associativity/part/mpml/mapsb/MAPSB-service.properties.xconf ファイルの StructureBroswerDelegate のエントリを更新し、serviceClass を新しく追加したカスタム実装で更新します。たとえば、カスタム委任 CustomStructureBroswerDelegate を使用する場合、サンプルコードは次のとおりです。
<Service context="default" name="com.ptc.windchill.baseclient.server.delegate.StructureBroswerDelegate">
<Option serviceClass="com.custom.delegate.CustomStructureBroswerDelegate" requestor="null" selector="mapsb" cardinality="singleton"/>
</Service>