高级自定义 > 业务逻辑自定义 > 自定义部件结构浏览器 > 在 PSB 中显示自定义表格
  
在 PSB 中显示自定义表格
自定义表格可显示在 PSB 的“属性”选项卡上。以下过程用作在 PSB 中显示自定义表格的示例:
1. 对于此示例中,在 Windchill\codebase\netmarkets\jsp 中创建名为 customTable 的文件夹。
2. Windchill\codebase\netmarkets\jsp\customTable 文件夹中复制示例 customTable.jspcustomTable3.jsp。下文提供了 customTable.jspcustomTable3.jsp 的示例。
3. site.xconf 文件中添加以下特性:
<Property name="displayCustomJSPInAttributesTab" overridable="true" targetFile="codebase/wt.properties" value="customTable/customTable"/>
4. 从 Windchill shell 中运行 xconfmanager -Fp
5. 重新启动方法服务器。
6. 验证自定义表格是否显示在 PSB 的“属性”选项卡中。
示例
customTable.jsp
<% request.setAttribute(NmAction.SHOW_CONTEXT_INFO, "false"); %>
<%@ page import="wt.part.WTPart,
com.ptc.windchill.enterprise.part.partResource"%>
<%@ include file="/netmarkets/jsp/util/begin.jspf"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.ptc.com/windchill/taglib/components" prefix="jca"%>
<%@ taglib uri="http://www.ptc.com/windchill/taglib/fmt" prefix="fmt"%>
<%--> Get resource bundle. <--%>
<fmt:setLocale value="${localeBean.locale}"/>
<fmt:setBundle basename="com.ptc.windchill.enterprise.part.partResource" />
<%--> Table 1 - Reference Documents <--%>
<fmt:message var="relatedReferenceDocTableLabel" key="<%= partResource.REFERENCES_DOC_TABLE_HEADER %>" />
<jca:describeTable var="relatedRefDocs"
id="part.relatedPartsReferencesDocuments.list"
type="wt.doc.WTDocument"
label="${relatedReferenceDocTableLabel}"
configurable="true" >
<jca:setComponentProperty key="selectable" value="true"/>
<jca:describeColumn id="type_icon" />
<jca:describeColumn id="number"/>
<jca:describeColumn id="version" />
<jca:describeColumn id="infoPageAction" sortable="false" />
<jca:describeColumn id="name" />
<jca:describeColumn id="containerName" />
<jca:describeColumn id="state" />
<jca:describeColumn id="lastModified"/>
<jca:describeColumn id="nmActions">
<jca:setComponentProperty key="actionModel"
value="relatedParts DescRef actions"/>
</jca:describeColumn>
</jca:describeTable>
<%-->Get a component model for our table<--%>
<jca:getModel var="tableModelRefDocs"
descriptor="${relatedRefDocs}"
serviceName="com.ptc.windchill.enterprise.part.commands.PartDocServiceCommand"
methodName="getAssociatedReferenceDocuments" >
<jca:addServiceArgument type="wt.part.WTPart"
value="${param.oid}" />
</jca:getModel>
<%-->Get the NmHTMLTable from the command<--%>
<jca:renderTable model="${tableModelRefDocs}"
helpContext="doc_references" showCount="true" />
<%--> Table 2 - Described by Documents <--%>
<fmt:message var="relatedDescribedDocTableLabel" key="<%= partResource.DESCRIBED_BY_DOC_TABLE_HEADER %>" />
<jca:describeTable var="relatedDescibeDocs"
id="part.relatedPartsDescribedByDocuments.list"
type="wt.doc.WTDocument"
label="${relatedDescribedDocTableLabel}"
configurable="true" >
<jca:setComponentProperty key="selectable" value="true"/>
<jca:describeColumn id="type_icon" />
<jca:describeColumn id="number"/>
<jca:describeColumn id="version" />
<jca:describeColumn id="infoPageAction" sortable="false" />
<jca:describeColumn id="name" />
<jca:describeColumn id="containerName" />
<jca:describeColumn id="state" />
<jca:describeColumn id="lastModified"/>
<jca:describeColumn id="nmActions">
<jca:setComponentProperty key="actionModel" value="relatedParts DescRef actions"/>
</jca:describeColumn>
</jca:describeTable>
<%-->Get a component model for our table<--%>
<jca:getModel var="tableModelDescDocs" descriptor="${relatedDescibeDocs}"
serviceName="com.ptc.windchill.enterprise.part.commands.PartDocServiceCommand"
methodName="getAssociatedDescribeDocuments" >
<jca:addServiceArgument type="wt.part.WTPart" value="${param.oid}" />
value="${param.oid}" />
</jca:getModel>

<%-->Get the NmHTMLTable from the command<--%>
<jca:renderTable model="${tableModelDescDocs}" helpContext="doc_described_by_ref" showCount="true" />
<%@ include file="/netmarkets/jsp/customTable/customTable3.jsp"%>
<%@ include file="/netmarkets/jsp/util/end.jspf"%>
示例
customTable3.jsp
<%-->Get the Described By relation NmHTMLTable from the command<--%>
<jca:describeTable var="described" id="part.relatedPartsDescribedByCADDocuments.list" type="wt.epm.EPMDocument"
label="${describedByCADDocTableHeader}"
configurable="true">
<jca:describeColumn id="type_icon"/>
<jca:describeColumn id="number"/>
<jca:describeColumn id="CADName"/>
<jca:describeColumn id="version" />
<jca:describeColumn id="infoPageAction" />
<jca:describeColumn id="name"/>
<jca:describeColumn id="containerName"/>
<jca:describeColumn id="association"/>
<jca:describeColumn id="state"/>
<jca:describeColumn id="lastModified"/>
<jca:describeColumn id="nmActions">
<jca:setComponentProperty key="actionModel" value="EMPTY_ACTION_MODEL"/>
</jca:describeColumn>
</jca:describeTable>
<%-->Get a component model for our table<--%>
<jca:getModel var="tableModelDesc" descriptor="${described}"
serviceName="com.ptc.windchill.enterprise.part.commands.PartDocServiceCommand"
methodName="getAssociatedCADDocuments" >
<jca:addServiceArgument type="wt.part.WTPart" value="${param.oid}"/>
</jca:getModel>
<%-->Get the NmHTMLTable from the command<--%>
<jca:renderTable model="${tableModelDesc}" pageLimit="0" showCount="true" helpContext="cad_doc_described_by_ref" />