Class BOMReportHelper
java.lang.Object
com.ptc.core.query.report.bom.common.BOMReportHelper
Helper class to hide remote forwarding to BOMReportService. Exposes ability to produce several BOM reports as XML
with XSLT styling. These report (unless otherwise noted) allow additional data to be collected via QueryBuilder
ReportTemplate's (and/or implementations of Reportable) and correlated in to the results.
Various methods throughout this class take Object or Object[] arguments which are called "references". This ambiguous terminology and typing requires some explanation. [This arose to provide backward API compatibility while supporting new data constraints.]
For "part" references, each of these objects can be any of the following:
- Object or version reference string for a WTPartMaster or WTPart
- ObjectIdentifier or WTReference for a WTPartMaster or WTPart
- WTPartMaster
- WTPart
- Part number [deprecated]
WARNING: Use of part numbers in this context in Windchill instances wherein WTPartMaster numbers are not globally unique can lead to results based on invalid input: '<'span any part whose number matches that specified! It is therefore suggested that such references be converted to one of the other forms.For "report" references, each of these objects can be any of the following:
- Object reference string for a ReportTemplate
- ObjectIdentifier or ObjectReference for a ReportTemplate
- Class which implements Reportable interface
- ReportTemplate
- String array containing the SOAP class and method (in that order) of a report task
- Name of class which implements Reportable interface [deprecated]
- Name of ReportTemplate [deprecated]
WARNING: Use of ReportTemplate names in this context in Windchill instances wherein ReportTemplate names are not globally unique can lead to results based on any ReportTemplate whose number matches that specified! Moreover, due to flexible logic required to allow all of these types of references, ReportTemplate name and Reportable class name references passed to these methods cannot be resolved as efficiently as the other forms of references. It is therefore suggested that such references be converted to one of the other forms.
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanclientSupportsXSLT(String userAgentHeader) Determines whether the given browser client supports XSLT transformations.static Object[]getReportObjectsAndTypes(WTContainerRef containerRef, String propertiesResource) Get a set of report objects and their types from a properties file resource.static StringgetXSLTChainContentType(String[] xsltUrlStrings, boolean doTransformOnClient) Get Content-Type HTTP header value for results produced by the other methods in this class for the given XSLT transformations and knowledge as to whether they are to be done on the client or server.static voidproduceBOMReport(Object rootPartRef, NavigationCriteria navCriteria, Object[] reportRefs, int[] reportTypes, Properties reportInputs, Locale locale, int levelLimit, String[] xsltUrlStrings, boolean doTransformOnClient, WriterProxy writerProxy) Produce a hierarchical BOM report for a given part and a given set of ReportTemplates or other Reportables by producing XML data and transforming it with one or more specified XSLT stylesheets.static voidproduceConsolidatedBOMReport(Object[] rootPartRefs, double[] partQuantities, NavigationCriteria navCriteria, Object[] reportRefs, int[] reportTypes, Properties reportInputs, Locale locale, int levelLimit, String[] xsltUrlStrings, boolean doTransformOnClient, WriterProxy writerProxy) Deprecated.static voidproduceMultiBOMDiffReport(Object[] rootPartRefs, NavigationCriteria[] navCriteria, Object[] reportRefs, int[] reportTypes, Properties reportInputs, Locale locale, int levelLimit, String[] xsltUrlStrings, boolean doTransformOnClient, WriterProxy writerProxy) Deprecated.Will be deleted in next releasestatic voidproduceMultiBOMReport(Object[] rootPartRefs, NavigationCriteria[] navCriteria, Object[] reportRefs, int[] reportTypes, Properties reportInputs, Locale locale, int levelLimit, String[] xsltUrlStrings, boolean doTransformOnClient, WriterProxy writerProxy) Deprecated.seeMultiLevelBOMReportTreeBuilderWill be deleted in next release
-
Method Details
-
getXSLTChainContentType
public static String getXSLTChainContentType(String[] xsltUrlStrings, boolean doTransformOnClient) throws WTException Get Content-Type HTTP header value for results produced by the other methods in this class for the given XSLT transformations and knowledge as to whether they are to be done on the client or server.
Supported API: true- Parameters:
xsltUrlStrings- Same value as that to be passed to produce*Report methoddoTransformOnClient- Same value as that to be passed to produce*Report method- Returns:
- Content-Type HTTP header string
- Throws:
WTException- Encapsulates any client or server tracked exception that may have occurred.
-
getReportObjectsAndTypes
public static Object[] getReportObjectsAndTypes(WTContainerRef containerRef, String propertiesResource) throws WTException Get a set of report objects and their types from a properties file resource. The properties file has the following format:
Example:report.1.type={report type number} - AND - report.1.name={report template name} - OR - report.1.class={implementation of Reportable interface} - OR - report.1.soapClass={name of report task SOAP class} - AND - report.1.soapMethod={name of report task SOAP method} report.2...
Notes:report.1.name=test report.1.type=1 report.2.class=com.myco.MyReportableClass report.2.type=3 report.3.soapClass=WCTYPE|com.ptc.windchill.enterprise.report.ReportTask report.3.soapMethod=MyReportTaskMethod report.3.type=2- Reports should meet qualifications laid out in package Javadoc for com.ptc.core.query.report.bom.common.
- Report type numbers are defined in the package Javadoc for com.ptc.core.query.report.bom.common
- Reports are searched for by name by up the container tree from the container indicated.
- Numbers of report entries do not need to be consecutive.
Supported API: true- Parameters:
containerRef- Reference to container to base search incontainerRef- Resource path (ala getResourceAsStream()) to properties file to read- Returns:
- Array of objects with 2 elements; first element is Object[] of report elements and the second is int[] of report types.
- Throws:
WTException- Encapsulates any client or server tracked exception that may have occurred.
-
clientSupportsXSLT
Determines whether the given browser client supports XSLT transformations. Currently only recognizes IE 6.0 and higher as XSLT-capable.
Supported API: true- Parameters:
userAgentHeader- Value of HTTP "User-Agent" header- Returns:
- Whether given client supports client-side XSLT transformations
-
SingleLevelConsolidatedBOMTableBuilderWill be deleted in next release