Package com.ptc.windchill.esi.esipart
Class ESIWTPartRenderer
java.lang.Object
com.ptc.windchill.esi.rnd.BasicESIRenderer
com.ptc.windchill.esi.enterprisedata.ESIAbstractEDRenderer
com.ptc.windchill.esi.esipart.ESIWTPartRenderer
- All Implemented Interfaces:
ESIRenderer,com.ptc.windchill.esi.translation.ESITranslationRenderer
- Direct Known Subclasses:
ESIMadeFromObjectRenderer
public class ESIWTPartRenderer
extends ESIAbstractEDRenderer
implements com.ptc.windchill.esi.translation.ESITranslationRenderer
This class has methods to render a stand-alone part and build the relevant portions of the ESI response.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThe following is an inner class intended to be used only by this outer class (or subclasses thereof). -
Field Summary
Fields inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
adapterName, authentication, currentTarget, DELIMITER, objectTypeDefs, OPTIONSVARIANTS_HELPER_CLASS_STRING, SEPARATOR, taskHelper, XML_META_NAME -
Method Summary
Modifier and TypeMethodDescriptionprotected com.infoengine.object.factory.ElementadjustAlternateElement(com.infoengine.object.factory.Element element, String group, WTPart part, Collection targets) Allow subclasses to fix the contents of an element.protected com.infoengine.object.factory.ElementadjustPartElement(com.infoengine.object.factory.Element element, String group, WTPart part, List<Eff>[] effs, Collection targets) Allow subclasses to fix the contents of an element.protected com.infoengine.object.factory.ElementadjustPartElement(com.infoengine.object.factory.Element element, String group, WTPart part, Eff[] effs, Collection targets) Allows subclasses to fix the contents of an I*E element.protected voidOutput generator for the class.protected PersistableReturns the context object to be used for fetching the option set information.com.infoengine.object.IeCollectiongetPart(String objectID, ESITransaction txn, Collection<ESITarget> tgts, String auth, String wcAdapter, boolean useECNDTAttrs) Creates a VdbBuilder instance for the input transaction, renders the input part and creates release activities as appropriate for each of the distribution targets in tgts.com.infoengine.object.IeCollectiongetPart(String objectID, ESITransaction txn, Collection<ESITarget> tgts, String auth, String wcAdapter, boolean useECNDTAttrs, Persistable enterpriseDataObj, Collection enterpriseDataObjects, Collection partObjects) Creates a VdbBuilder instance for the input transaction, renders the input part and creates release activities as appropriate for each of the distribution targets in tgts.voidgetPart(WTPart root, Collection<WTPart> children, boolean alternates, boolean documents, String auth, String wcAdapter, VdbBuilder builder) GetPart RPC processor when called from GetBOM or getECN RPC.voidgetPart(WTPart root, Collection<WTPart> children, boolean alternates, boolean documents, String auth, String wcAdapter, VdbBuilder builder, ESIAbstractStructureRenderer bomRenderer) An overloaded version that may be called from getBOM() or getECN().voidgetPart(WTPart root, Collection<WTPart> children, boolean alternates, boolean documents, String auth, String wcAdapter, VdbBuilder builder, Collection enterpriseDataObjects) GetPart RPC processor when called from GetBOM or getECN RPC.protected CollectiongetParts()Gets the value of the attribute: parts; The list of parts that are to be rendered.protected Collection<ESITargetAssociation> getPreviousExportedIterations(Collection<ESITargetAssociation> currTargetAssoc) Returns the previous exported iteration for each part and target combination from the input target associations.protected WTPartgetRoot()Gets the value of the attribute: root; The base part of a tree of product structures.protected PersistableReturns the root object to be used for fetching the option set information.protected StringGets the value of the attribute: transactionID; The idNumber attribute value of an ESITransaction that is to be associated with this renderer.protected booleanGets the value of the attribute: alternatesRequired; Should the renderer obtain the alternates to the parts that are to be rendered?
Supported API: trueprotected booleanGets the value of the attribute: documentsRequired; Should the renderer call the document renderer?
Supported API: trueprotected booleanDeprecated.API and implementation will be replaced in future relase.voidsetData(Collection enterpriseDataObjects) Establish the renderer's state so that it can process requests.voidsetData(Persistable enterpriseData) Establish the renderer's state so that it can process requests.voidsetData(WTPart root, Collection<WTPart> parts, boolean buildAlts, boolean buildDocs, String auth, String wcAdapter, String transactionID) Establish the renderer's state so that it can process requests.voidsetData(WTPart root, Collection<WTPart> parts, boolean buildAlts, boolean buildDocs, String auth, String wcAdapter, String transactionID, ESIAbstractStructureRenderer abstractStructureRender) Establish the renderer's state so that it can process requests.protected voidvalidate()Make sure the object is ready to process.Methods inherited from class com.ptc.windchill.esi.enterprisedata.ESIAbstractEDRenderer
adjustElementForPartVersions, adjustEnterpriseDataElement, adjustPFDElement, clearAdjustedPartGroupAfterMapping, configureED, getAdjustedPartGroupAfterMapping, getEnterpriseDataElementMap, getEnterpriseDataElementMap, getEnterpriseDataPlantFunctionalDataElementMap, getEnterpriseDataPlantFunctionalDataElementMap, mapEnterpriseData, setAdjustedPartGroupAfterMappingMethods inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
addAtt, adjustConfigurableAndCollapsibleAtts, adjustDateEffCxt, adjustDateEffectivities, adjustEffectivities, adjustLotNumberEffCxt, adjustLotNumberEffectivities, adjustObjectID, adjustSerialNumberEffCxt, adjustSerialNumberEffectivities, adjustTargets, buildUfidString, evaluateBussinessRule, fetchLatestEffectivities, formatDateEffectivityElement, getAdapterName, getAssignedVariantSpec, getAssignedVariantSpec, getAUMRenderer, getAuth, getBuilder, getEffectivityElementMap, getEffectivityHandler, getEffectivityTargetAttributes, getElements, getERPMaterialAttributeList, getERPMaterialAttributeList, getERPMaterialTargetAttributes, getFormatedDate, getGroupInfo, getGroupInfo, getGroupInfo, getMap, getMap, getMapInfo, getMapInfo, getMapInfo, getNavigationFilter, getObjectTypeDefs, getPlantSpecificAttributeList, getPlantSpecificAttributeList, getPlantSpecificTargetAttributes, getPreviousObject, getPreviousPublishedEffectivity, getTargetsFromAssns, getTargetUtility, getTransactionUtility, getUnwantedAttributes, getVersionRefObjectRefMap, getWCAttributeList, getWCAttributeList, initEffectivityHandler, initializeElementForGroup, invokeQueryTask, invokeQueryTask, invokeQueryTask, invokeQueryTaskForObjects, isExpressionToBePublished, isGroupAvailable, isPublishAssocOptionSetFlagEnabled, mapDateEffectivities, mapEffectivities, mapEffectivityAttributes, mapEffectivityElement, mapEffectivityParentElement, mapElement, mapElement, mapElement, mapElementWithEffectivityAttrs, mapLotNumberEffectivities, mapObject, mapObject, mapSerialNumberEffectivities, mergeElements, overrideAttrValue, populateDateEffectivityInfo, populateEffectivityInfo, processBussinessRulesWithAnd, processBussinessRuleValidationResultSet, processNoMatchingVersionFound, removeAttributesNotRequired, removeUnwantedEffectivityAttributes, render, renderAssociatedSkinnyVariantSpec, renderAssociatedVariantSpec, renderAssocOptionSetLinks, renderAssocSkinnyVariantSpec, renderAssocVariantSpec, renderATONavigationFilter, renderChoiceRules, renderEffectivities, renderEffectivities, renderExpressions, renderOptionSets, renderRoleBObjectOfModuleVariantLink, setAttrValue, setAttrValue, setAttrValues, setBuilder, setCurrentTarget, setCurrentTarget, setCurrentTargetFromTgtAssocs, setEffectivityHandler, setObjectTypeDefs, setObjectTypeDefs, setObjectTypeDefsFromObj, setStartEndEffAttr, setTransactionUtility, shallPublishAssocOptionSet, shouldRenderEffectivityElementInPartElement, shouldUseOldEffectivityBehaviour, storeCurrentAndItsPreviousObject, storeCurrentAndItsPreviousObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ptc.windchill.esi.translation.ESITranslationRenderer
adjustElementForTranslationSpecificAttrs
-
Method Details
-
getParts
Gets the value of the attribute: parts; The list of parts that are to be rendered.
Supported API: true- Returns:
- Collection
-
getRoot
Gets the value of the attribute: root; The base part of a tree of product structures.
Supported API: true- Returns:
- WTPart
-
isAlternatesRequired
protected boolean isAlternatesRequired()Gets the value of the attribute: alternatesRequired; Should the renderer obtain the alternates to the parts that are to be rendered?
Supported API: true- Returns:
- boolean
-
isDocumentsRequired
protected boolean isDocumentsRequired()Gets the value of the attribute: documentsRequired; Should the renderer call the document renderer?
Supported API: true- Returns:
- boolean
-
getTransactionID
Gets the value of the attribute: transactionID; The idNumber attribute value of an ESITransaction that is to be associated with this renderer.
Supported API: true- Returns:
- String
-
validate
Make sure the object is ready to process. If root, auth, or wcAdapter are null, throws an exception.
Supported API: true- Specified by:
validatein classBasicESIRenderer- Throws:
ESIRendererException
-
buildGroups
Output generator for the class. Does the following:- Obtains the contents of the parts collection.
- Finds the ESI targets associated with the parts. Trims the collection of targets to contain only that associated with the currently processed ESI transaction.
- Finds the most current released version of the part for the above fetched target.
- Compares the current version to the most current version. If they are the same and the effectivity has not changed, the part is ignored.
- If the part is not ignored, calls the Windchill Adapter to obtain all the attributes of the part.
- Maps the result of the Windchill Adapter call.
- Calls adjustPartElement().
- If documents are required, calls the document renderer.
Supported API: true- Specified by:
buildGroupsin classBasicESIRenderer- Throws:
ESIRendererException
-
getPreviousExportedIterations
protected Collection<ESITargetAssociation> getPreviousExportedIterations(Collection<ESITargetAssociation> currTargetAssoc) throws WTException Returns the previous exported iteration for each part and target combination from the input target associations. Invokes the APIESITransactionUtility.latestPartExport(Collection).
Supported API: true- Parameters:
currTargetAssoc- - Collection of target associations. Typically, the target association between the part being processed and the current target.- Returns:
- Collection of target associations between the previous exported iteration and the current target.
- Throws:
WTException
-
adjustPartElement
protected com.infoengine.object.factory.Element adjustPartElement(com.infoengine.object.factory.Element element, String group, WTPart part, List<Eff>[] effs, Collection targets) throws ESIRendererException Allow subclasses to fix the contents of an element.
Supported API: true- Parameters:
element-group-part-effs- May be null.targets- Collection of ESITarget objects.- Returns:
- Element
- Throws:
ESIRendererException
-
adjustPartElement
protected com.infoengine.object.factory.Element adjustPartElement(com.infoengine.object.factory.Element element, String group, WTPart part, Eff[] effs, Collection targets) throws ESIRendererException Allows subclasses to fix the contents of an I*E element. This overloaded version differs from the other version in that it takes an array of Eff instances rather than a single Eff object.
Supported API: true- Parameters:
element- I*E Element whose contents need to be fixed.group- Name of the group in ESI response for which to adjust the I*E element.part- WTPart instance that is relevant to the operation.effs- Array of Effs containing the latest date, serial number and lot number effectivity values associated with the passed part.targets- Collection of ESITarget objects.- Returns:
- Element
- Throws:
ESIRendererException
-
adjustAlternateElement
protected com.infoengine.object.factory.Element adjustAlternateElement(com.infoengine.object.factory.Element element, String group, WTPart part, Collection targets) throws ESIRendererException Allow subclasses to fix the contents of an element.
Supported API: true- Parameters:
element-group-part-targets- Collection of ESITarget objects.- Returns:
- Element
- Throws:
ESIRendererException
-
getPart
public void getPart(WTPart root, Collection<WTPart> children, boolean alternates, boolean documents, String auth, String wcAdapter, VdbBuilder builder) throws WTException GetPart RPC processor when called from GetBOM or getECN RPC. Validates arguments then creates a VDBBuilder if one hasn't already been provided. Creates a PartRenderer. Passes control to the renderer. Does not call asVDB() on the renderer because the caller of this method is responsible to do that.
Supported API: true- Parameters:
root- The primary part for the BOM. Needed if target assignments are implicit.children- A collection of WTParts that are to be released. These parts are presumed to not be the root.alternates- true or false. If true, will return alternates parts for the part in question.documents- true or false. If true, will return the documents for the part in question. If alternates is true, will return the documents for the alternate parts.auth- This parameter contains authentication information from I*EwcAdapter- This parameter contains the name of the Windchill adapter.builder-- Throws:
WTException
-
getPart
public void getPart(WTPart root, Collection<WTPart> children, boolean alternates, boolean documents, String auth, String wcAdapter, VdbBuilder builder, Collection enterpriseDataObjects) throws WTException GetPart RPC processor when called from GetBOM or getECN RPC. Validates arguments then creates a VDBBuilder if one hasn't already been provided. Creates a PartRenderer. Passes control to the renderer. Does not call asVDB() on the renderer because the caller of this method is responsible to do that.
Supported API: true- Parameters:
root- The primary part for the BOM. Needed if target assignments are implicit.children- A collection of WTParts that are to be released. These parts are presumed to not be the root.alternates- true or false. If true, will return alternates parts for the part in question.documents- true or false. If true, will return the documents for the part in question. If alternates is true, will return the documents for the alternate parts.auth- This parameter contains authentication information from I*EwcAdapter- This parameter contains the name of the Windchill adapter.builder-- Throws:
WTException
-
setData
public void setData(WTPart root, Collection<WTPart> parts, boolean buildAlts, boolean buildDocs, String auth, String wcAdapter, String transactionID) Establish the renderer's state so that it can process requests.
Supported API: true- Parameters:
root- - The primary part to process. May not be null. If multiple parts are to be processed, the - renderer will use the root as the base part for target determination.parts- - A collection of additional parts to process. May be empty.buildAlts- - Specifies whether or not alternates associated to the part are to be returned by the renderer.buildDocs- - Specifies whether or not documents associated to the part are to be returned by the renderer.auth- - Info*Engine authentication information to use when executing a query task.wcAdapter- - Windchill adapter instance name to use when executing a webject.transactionID- Optional transaction ID to pass to the VDB builder.
-
setData
Establish the renderer's state so that it can process requests.
Supported API: true- Parameters:
enterpriseData- - Enterprise Data object associated with WTPart.
-
setData
Establish the renderer's state so that it can process requests.
Supported API: true- Parameters:
enterpriseDataObjects- - Collection of Enterprise Data objects associated with WTPart.
-
getPart
public void getPart(WTPart root, Collection<WTPart> children, boolean alternates, boolean documents, String auth, String wcAdapter, VdbBuilder builder, ESIAbstractStructureRenderer bomRenderer) throws WTException An overloaded version that may be called from getBOM() or getECN(). Invokes render() but does not call asVDB() since the caller of this method is responsible for doing that.
Supported API: true- Parameters:
root- The primary part for the BOM. Needed if target assignments are implicit.children- A collection of WTParts that are to be released. These parts are presumed to not be the root.alternates- true or false. If true, will return alternates parts for the part in question.documents- true or false. If true, will return the documents for the part in question. If alternates is true, will return the documents for the alternate parts.auth- This parameter contains authentication information from I*EwcAdapter- This parameter contains the name of the Windchill adapter.builder- VdbBuilder instance to be populated with the rendered part information.bomRenderer- ESIBOMRenderer instance; this is used for processing alternate parts that are assemblies themselves.- Throws:
WTException
-
setData
public void setData(WTPart root, Collection<WTPart> parts, boolean buildAlts, boolean buildDocs, String auth, String wcAdapter, String transactionID, ESIAbstractStructureRenderer abstractStructureRender) Establish the renderer's state so that it can process requests. This is an overloaded version that takes in an ESIBOMRenderer instance besides other parameters.
Supported API: true- Parameters:
root- The primary part to process. May not be null. If multiple parts are to be processed, the renderer will use the root as the base part for target determination.parts- A collection of additional parts to process. May be empty.buildAlts- Specifies whether or not alternates associated to the part are to be returned by the renderer.buildDocs- Specifies whether or not documents associated to the part are to be returned by the renderer.auth- Info*Engine authentication information to use when executing a query task.wcAdapter- Windchill adapter instance name to use when executing a webject.transactionID- Optional transaction ID to pass to the VDB builder.abstractStructureRender- ESIBOMRenderer instance that was used for rendering the BOM whose parts are being processed by this renderer.
-
getPart
public com.infoengine.object.IeCollection getPart(String objectID, ESITransaction txn, Collection<ESITarget> tgts, String auth, String wcAdapter, boolean useECNDTAttrs) throws WTException Creates a VdbBuilder instance for the input transaction, renders the input part and creates release activities as appropriate for each of the distribution targets in tgts. The settings pertaining to ESI response generation for a given distribution target are fetched from the target itself. Returns the rendered output as an Info*Engine collection to the caller.
Supported API: true- Parameters:
objectID- UFID of the part to be rendered.txn- ESITransaction object that represents the delivery of data to the distribution targets in tgts; will be null when the method is invoked for the Preview functionality.tgts- Collection of distribution targets that represent a given destination, such as an ERP instance.auth- This parameter contains authentication information required for executing certain Windchill adapter webjects as part of the rendering process.wcAdapter- This parameter contains the name of the Windchill adapter instance.useECNDTAttrs- If true, distribution target attributes that figure in the ECN Settings section will be used for the response generation; otherwise, attributes that figure in the Part Section will be used. For example, a true will be passed for this parameter when the method is invoked for the Preview functionality and the preference "Automatically Generate Change Notice" has a value "Yes".- Returns:
- IeCollection The Info*Engine collection that holds the ESI response.
- Throws:
WTException- - if any of the invoked methods throws this exception.
-
getPart
public com.infoengine.object.IeCollection getPart(String objectID, ESITransaction txn, Collection<ESITarget> tgts, String auth, String wcAdapter, boolean useECNDTAttrs, Persistable enterpriseDataObj, Collection enterpriseDataObjects, Collection partObjects) throws WTException Creates a VdbBuilder instance for the input transaction, renders the input part and creates release activities as appropriate for each of the distribution targets in tgts. The settings pertaining to ESI response generation for a given distribution target are fetched from the target itself. Returns the rendered output as an Info*Engine collection to the caller.
Supported API: true- Parameters:
objectID- UFID of the part to be rendered.txn- ESITransaction object that represents the delivery of data to the distribution targets in tgts; will be null when the method is invoked for the Preview functionality.tgts- Collection of distribution targets that represent a given destination, such as an ERP instance.auth- This parameter contains authentication information required for executing certain Windchill adapter webjects as part of the rendering process.wcAdapter- This parameter contains the name of the Windchill adapter instance.useECNDTAttrs- If true, distribution target attributes that figure in the ECN Settings section will be used for the response generation; otherwise, attributes that figure in the Part Section will be used. For example, a true will be passed for this parameter when the method is invoked for the Preview functionality and the preference "Automatically Generate Change Notice" has a value "Yes".- Returns:
- IeCollection The Info*Engine collection that holds the ESI response.
- Throws:
WTException- - if any of the invoked methods throws this exception.
-
getRootToFetchOpionSetInfo
Returns the root object to be used for fetching the option set information. This method is intended to be overridden by a customizer if they want to use a different root other than the input part. It returns the input part by default. The renderer "com.ptc.windchill.esi.ov.ChoiceMappableChoiceLinkRenderer" uses this object to find the appropriate option set for the current part being rendered. Check the java doc of this renderer for more information.
Supported API: true- Parameters:
part- - WTPart- Returns:
-
getContextToFetchOptionSetInfo
Returns the context object to be used for fetching the option set information. This method is intended to be overridden by a customizer if they want to use a different context other than the input part. It returns the input part by default. The renderer "com.ptc.windchill.esi.ov.ChoiceMappableChoiceLinkRenderer" uses this object to render appropriate context information in the response. Check the java doc of this renderer for more information.
Supported API: true- Parameters:
part- - WTPart- Returns:
-
renderCurrentAlternates
Deprecated.API and implementation will be replaced in future relase.
Supported API: trueIndicates renderer how alternates should be render. When API returns 'true' all current alternates will be rendered as added alternates. OOTB API returns 'true' or 'false' based on the optional property "com.ptc.windchill.esi.RenderCurrentAlternates"- Returns:
- - The value of the property "com.ptc.windchill.esi.RenderCurrentAlternates".
-