ピッカーの設定
ソリューション
カスタム JSP ページを記述し、アイテムピッカータグを使用してピッカーを表示します。itemPicker タグのパラメータを使用して、サーチするオブジェクトタイプとコンテナを設定します。
前提となる知識
この目的を達成するには、次のことを理解している必要があります。
HTML 形式、JSP、XML に関連した基本的な開発
ピッカーの共通コンポーネント
テーブルの共通コンポーネント
ビュー作成
手順 - ピッカーを起動し、サーチするオブジェクトを定義する
ピッカーは itemPicker タグを呼び出すことで JSP から起動できます。
<wctags:itemPicker id="customized_item_picker" objectType="WCTYPE|
wt.part.WTPart|org.r_and_d.mypart" componentId="customizedItemPickerForSoftPart "/>
objectType パラメータは、org.r_and_d_mypart タイプのオブジェクトにサーチを絞り込むよう指定します。
id パラメータの値は、指定されたページに一意な識別子でなければなりません。
componentId パラメータの値は、ピッカーに表示するサーチ基準の検索に使用されるキーです。
手順 - サーチするコンテナを定義する
特定のコンテナ内のオブジェクトにサーチを絞り込むには、ピッカータグの containerRef パラメータを使用します。このパラメータの値には、サーチするコンテナの 1 つ以上の WTContainerRef オブジェクトのコンマ区切りリストを文字列フォーマットで指定します。
コンテナの WTContainerRef は、コンテナを照会し、それぞれ WTContainer オブジェクトから WTContainerRef を取得することによってフェッチできます。
containerRef パラメータが指定されていない場合、すべてのコンテナがサーチされます。
<wctags: itemPicker id=" customized_item_picker”
objectType="WCTYPE|wt.part.WTPart|org.r_and_d.mypart"
containerRef=" OR: wt.pdmlink.PDMLinkProduct:33707”
componentId="customizedItemPickerForSoftPart" />
手順 - サーチ結果テーブルビューをカスタマイズする
サーチ結果テーブルにはテーブル共通コンポーネントが使用されるため、列表示は新しいテーブルビューの作成によって設定できます。
最初に、テーブルビューを定義する JCAConfigurableTable Java クラスを新規作成する必要があります。
次に、サービスプロパティエントリを *.properties.xconf ファイルに作成します。このエントリを使用して、"セレクタ" と呼ばれる識別子に基づいてテーブルビュークラスを検索できます。たとえば、テーブルビュークラスが CustomizedPartView の場合、サービスプロパティエントリは以下のようになります。
<Service context="default"
name="com.ptc.core.htmlcomp.tableview.ConfigurableTable">
<Option
serviceClass="com.ptc.netmarkets.search.views.CustomizedPartView" requestor="java.lang.Object"
selector="wt.part.WTPart.customizedSearchView "/>
</Service>
最後に、以下のようにピッカータグにセレクタを渡すと、サーチ結果テーブルがこのビューを使用してレンダーされます。
<wctags: itemPicker id=" customized_item_picker"
objectType="WCTYPE|wt.part.WTPart|org.r_and_d.mypart"
containerRef="<OR: wt.pdmlink.PDMLinkProduct:33707”
componentId="customizedItemPickerForSoftPart"
searchResultsViewId="wt.part.WTPart.customizedSearchView"/>
サンプルコード
<html>
<body>
<table>
<tr>
<%-- launching user picker--%>
<wctags:userPicker id="testUserPicker" label="MyUserPicker"
readOnlyPickerTextBox="false" editable="true" showSuggestion="true"
suggestMinChars="5" />
</tr>
<tr>
<%-- launching organization picker--%>
<wctags: organizationPicker id="orgPicker" label="MyOrgPicker"
readOnlyPickerTextBox="false" editable="true" showSuggestion="true"
suggestMinChars="3"/>
</tr>
<tr>
<%-- launching context picker--%>
<wctags: contextPicker id="contextPicker" label="MyContextPicker"
pickerTitle="ContextPicker" />
</tr>
<tr>
<%-- launching Item picker--%>
<wctags:itemPicker id="itemPicker" label="MyItemPicker"
pickerTitle="ItemPicker"/>
</tr>
<tr>
<%-- launching Item picker with exclude sub types and access
controller --%>
<wctags:itemPicker id="CustomizedItemPicker" label="CustomizedItemPicker"
pickerTitle="CustomizedItemPicker"excludeSubTypes="WCTYPE|wt.doc.WTDocument|
org.rnd.Minutes,WCTYPE|wt.doc.WTDocument|org.rnd.General"
customAccessController="com.ptc.windchill.
enterprise.search.server.LatestVersionAccessController"/>
</tr>
<tr>
<%-- launching Item Masterpicker--%>
<wctags:itemMasterPicker id="itemMasterPicker"
label="MyItemMasterPicker"/>
</tr>
<tr>
<%-- launching Item Masterpicker--%>
<wctags:genericPicker id="genericPicker"objectType="wt.part.WTPart"label
="Part Picker using generic" />
</tr>
<tr>
<%-- launching Item Masterpicker--%>
<wctags:genericPicker id="viewPicker" objectType="wt.vc.views.View" label="
View Picker
using generic" pickerType="tree" />
</tr>
<tr>
<%-- launching Recently Visited Context Picker- Single Select--%>
<wctags:contextPicker id="containerTypeListSingleSelect" label="
Recently Visited Context Picker-
Single Select" pickerTitle="ContextPicker" showRecentlyUsed="true"
displayAttribute="containerInfo.name"/>
</tr>
<tr>
<%-- launching Recently Visited Context Picker- Multi Select--%>
<wctags:contextPicker id="containerTypeListMultiSelect" label="Recently
Visited Context Picker- Multi Select" pickerTitle="ContextPicker"
showRecentlyUsed="true" displayAttribute="containerInfo.name"
showMultiSelectRecentlyUsed="true"/>
</tr>
</table>
</body>
</html>
これは役に立ちましたか?