其他 Windchill 功能 > 製造流程管理 > 自訂產品結構總管 (PSE) > 自訂 PSE 結構查詢
  
自訂 PSE 結構查詢
目標
您想要自訂 PSE「新建查詢」對話方塊,以納入 WTPart 子類型,並允許建立參照子類型可重新使用屬性的查詢。
背景
從「檢視」->「查詢」->「新建查詢」選單項目啟動的對話方塊可供使用者建構查詢,此查詢會找出結構中符合指定條件的物件。現成組態允許查詢 WTPart 的特定屬性。
客戶將用自己的屬性建立自己的 WTPart 子類型。欲在查詢中使用這些項目,即需要自訂 PSE XML 檔案。
範圍/適用性/假設
由於這些變更是針對 PSE XML 檔案所做的,因此它們適用於所有 PSE 使用者。
預期結果
您可能想要將可變 WTPart "myPart" 納入可搜尋的類型,並允許查詢 "myCost" 和 "myDescription" 屬性。由於「最終項目」、「泛用」和「參考位置」與此類型不相關,因此系統會將它們從「內容」下拉選單中移除。
解決方案
<Windchill>/codebase/config/logicrepository/xml/explorer/structure
explorer/ExplorerSearchableTypes.xml
中新增相應的元素群組
元素群組將針對 "myPart" 類型定義 AttributeGroup (id="ptc.wnc.exp.QuerySearchableAttrs) 的 CellDefinition (新增項與移除項)。
必備知識
欲達成此目標,您需瞭解下列事項:
XML 檔案自訂的管理
解決方案元素
元素
類型
描述 (Description)
ExplorerSearcha bleTypes.xml
XML 檔案
保留將會顯示在「新建查詢」對話方塊中的類型和屬性的定義。
位於:
<Windchill>/codebase/config/logicrepositor
y/xml/structureexplore
LogicContext
XML 元素
指定待套用定義的應用程式和資料類型
AttributeGroup
XML 元素
PSE 會找出 ID 為 ptc.wnc.exp.QuerySearchableAttres 的屬性群組,並使用類型繼承來尋找所有將要顯示的內容 (CellDefinition)。
CellDefinition
XML 元素
將會顯示的內容的 ID。
Placement remove="true"
XML 元素
Remove=true 用於阻止內容因繼承而顯示。
程序
編輯檔案 ExplorerSearchableTypes.xml,在最後一行 </LogicRepository> 之前插入下列各行:
<!-- New Query definition for subtype myPart -->
<ExplorerElementGroup>
<LogicContext application="ptc.wnc.StructureExplorer"
dataType="com.aprilia.www.myPart"/>
<AttributeGroup id="ptc.wnc.exp.QuerySearchableAttrs" displayMode="view">
<!-- Remove the following that would otherwise be inherited from WTPart
Definition -->
<CellDefinition id="endItem">
<Placement remove="true"/>
</CellDefinition>
<CellDefinition id="genericType”>
<Placement remove="true"/>
</CellDefinition>
<CellDefinition id="referenceDesignator">
<Placement remove="true"/>
</CellDefinition>
<!-- Add the specific attributes of myPart -->
<CellDefinition id="myCost">
<AttributeDefinition attributeId="com.aprilia.www.myCost"/>
</CellDefinition>
<CellDefinition id="myDescription">
<AttributeDefinition attributeId="com.aprilia.www.myDescription"/>
</CellDefinition>
</AttributeGroup>
</ExplorerElementGroup>
重新啟動應用伺服器之後,會導致 "myPart" 顯示在「類型」下拉選單中,同時移除「最終項目」、「泛用」和「參考位置」屬性項目及新增 "myCost" 和 "myDescription",如「預期結果」部份中所示。
或者,若要透過 XML 自訂對 PSE UI 的其他層面進行變更,可將這些額外的行新增至保留所有 "myPart" 自訂的 XML 檔案。
自訂點
將 WTPart 定義從 ExplorerSearchableTypes.xml 移除是有效操作,因此,零件不會顯示在類型下拉選單中。不過,子類型定義不會繼承任何內容定義,因此必須新增內容定義。