Package com.ptc.windchill.esi.esidoc
Class ESIDocumentsRenderer
java.lang.Object
com.ptc.windchill.esi.rnd.BasicESIRenderer
com.ptc.windchill.esi.esidoc.ESIDocumentsRenderer
- All Implemented Interfaces:
ESIRenderer,ESIDocumentsRendererInterface
This class has methods to render documents associated to a RevisionControlled object (including those associated to
the relevant ERPMaterial object if the RevisionControlled object is a WTPart) and build the relevant portions of the
ESI response.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
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.ElementadjustDocLinkElement(com.infoengine.object.factory.Element element, String group, BinaryLink documentLink, Collection targets) Allow subclasses to fix the contents of an element.protected com.infoengine.object.factory.ElementadjustDocumentElement(com.infoengine.object.factory.Element element, String group, Document document, Collection targets) Allow subclasses to fix the contents of an element.protected com.infoengine.object.factory.ElementadjustDocumentElementForSCCUsages(com.infoengine.object.factory.Element element, String group, Document document, Collection targets) Allow subclasses to fix the contents of an element.protected voidCreates the Document output and may be invoked either for documents associated to RevisionControlled objects or for standalone documents.protected voidbuildGroups(RevisionControlled current, RevisionControlled previous, Collection<ESITarget> targets) Overloaded version of buildGroups() where the actual rendering of documents and document links is done.protected RevisionControlledGets the value of the attribute: currentPartIteration; The current iteration of the part associated with this document.com.infoengine.object.IeCollectiongetDocument(String objectID, ESITransaction txn, Collection<ESITarget> tgts, String auth, String wcAdapter) Creates a VdbBuilder instance for the input transaction, renders the input document and creates release activities as appropriate for each of the distribution targets in tgts.com.infoengine.object.IeCollectiongetDocument(String objectID, ESITransactionFacade txn, Collection<? extends ESITargetFacade> targets, Map<? extends ESITargetFacade, Map<String, Object>> paramMap, String auth, String wcAdapter) Returns the rendered output as an Info*Engine collection to the caller.protected Collection<Delta>[]getDocumentDeltas(Document document, Collection<ESITarget> targets) Returns an array of collections, each one holdingDeltaobjects.protected ESIDocUtilityGets the value of the attribute: docUtility (reference to an ESIDocUtility instance).voidgetESIDoc(Collection<ESITargetAssociation> previousTargetAssociations, Collection currentObjects, Collection<ESITarget> targetOrgs, String wcAdapter, String authorization, VdbBuilder builder) Match the previously published object iteration with the currently published object iteration and call the document renderer once for each match.protected RevisionControlledGets the value of the attribute: previousPartIteration; The last release iteration of the part associated with this document.protected Collection<ESITarget> Gets the value of the attribute: targets; A collection ESITarget objects.protected StringDeprecated.booleanisIncrementalDocAssociationsPublishEnabled(RevisionControlled currentObject) Returns the value of the preference "Publish Only Incremental Changes to Document Associations" based on the current object.protected voidProcesses a standalone document.voidSets the required attributes on this renderer instance.voidSets the required attributes on this renderer instance.voidsetData(RevisionControlled currentObject, RevisionControlled previousObject, Collection<ESITarget> esiTargets, String wcAdapter, String auth) Provide all necessary data to a Document Renderer.protected voidvalidate()Throws an exception if both currentPartIteration and document are null, or targets is null.Methods 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, storeCurrentAndItsPreviousObject
-
Method Details
-
getCurrentPartIteration
Gets the value of the attribute: currentPartIteration; The current iteration of the part associated with this document. No setter for this attribute - it must be set using setData().
Supported API: true- Returns:
- RevisionControlled
-
getPreviousPartIteration
Gets the value of the attribute: previousPartIteration; The last release iteration of the part associated with this document. No setter for this attribute - it must be set using setData().
Supported API: true- Returns:
- RevisionControlled
-
getTargets
Gets the value of the attribute: targets; A collection ESITarget objects. No setter for this attribute - it must be set using setData().
Supported API: true- Returns:
- Collection
-
getWcAdapter
Deprecated.Returns the value of the attribute adapterName. This attribute holds the name of the Windchill Adapter instance where the Query-Objects webject is to be executed.- Returns:
- The value stored in the field adapterName.
-
getDocUtility
Gets the value of the attribute: docUtility (reference to an ESIDocUtility instance). Do not access the attribute directly. Use the lazy-initializing getter.
Supported API: true- Returns:
- ESIDocUtility
-
setData
public void setData(RevisionControlled currentObject, RevisionControlled previousObject, Collection<ESITarget> esiTargets, String wcAdapter, String auth) throws ESIRendererException Provide all necessary data to a Document Renderer.
Supported API: true- Parameters:
currentObject- Currently published RevisionControlled object iteration for which to publish associated documents.previousObject- RevisionControlled object iteration that was previously published to a given distribution target. It is used for setting the instance variable previousPartIteration, provided the preference "Publish Only Incremental Changes to Document Associations" has a value "Yes".esiTargets- Collection of ESITargets to which documents associated with the current RevisionControlled object iteration are to be published. Strictly speaking, this will have just one ESITarget object.wcAdapter- Name of the Windchill adapter instance where the I*E task specified by the ESI preference "Query Document Task" will be executed.auth- Authentication information required for executing the I*E task specified by the ESI preference "Query Document Task".- Throws:
ESIRendererException
-
setData
Sets the required attributes on this renderer instance.
Supported API: true- Parameters:
doc- Document instance representing the standalone document being published.tgt- Currently processed distribution target to which the document is being published.auth- Authentication information required for executing the I*E task specified by the ESI preference "Query Document Task".wcAdapter- Name of the Windchill adapter instance where the I*E task specified by the ESI preference "Query Document Task" will be executed.
-
setData
Sets the required attributes on this renderer instance.
Supported API: true- Parameters:
auth- Authentication information required for executing the I*E task specified by the ESI preference "Query Document Task".wcAdapter- Name of the Windchill adapter instance where the I*E task specified by the ESI preference "Query Document Task" will be executed.
-
validate
Throws an exception if both currentPartIteration and document are null, or targets is null. This method may be overridden.
Supported API: true- Specified by:
validatein classBasicESIRenderer- Throws:
ESIRendererException
-
buildGroups
Creates the Document output and may be invoked either for documents associated to RevisionControlled objects or for standalone documents. Does the following when publishing associated documents:- If there is a previously published iteration of the RevisionControlled object, obtains the differences in
document associations between the currently and previously published iterations. Invokes
ESIDocUtility.retrievePartDocDifferences() to obtain the differences.
If there is no previously published iteration, obtains the documents from the current iteration by requesting them from ESIDocUtility.retrievePartDocInformation().
The result of calling the ESIDocUtility methods is an array of collections of PartDocInfo objects. - Obtains all the documents associated with the PartDocInfo objects.
- Obtains all the document links associated with the PartDocInfo objects.
- Separates the documents and document links on the basis of whether they were added, removed, changed, or unchanged.
- Invokes the Windchill adapter webject Query-Objects to obtain the data for the document and document link objects.
- Calls adjustObjectID(), adjustTargets(), adjustDocumentElement() and adjustDocLinkElement()
- Passes the resultant Info*Engine element to the VdbBuilder that is maintained by the base class.
Supported API: true- Specified by:
buildGroupsin classBasicESIRenderer- Throws:
ESIRendererException
- If there is a previously published iteration of the RevisionControlled object, obtains the differences in
document associations between the currently and previously published iterations. Invokes
ESIDocUtility.retrievePartDocDifferences() to obtain the differences.
-
processDocument
Processes a standalone document. It queries the database for the relevant data, fetches a PartDocInfo object for the document, builds the output and adds it to the VdbBuilder instance.
Supported API: true- Throws:
WTException- , if any of the invoked methods throws this exception.
-
adjustDocumentElement
protected com.infoengine.object.factory.Element adjustDocumentElement(com.infoengine.object.factory.Element element, String group, Document document, Collection targets) throws ESIRendererException Allow subclasses to fix the contents of an element. Default behavior is to return the element argument.
Supported API: true- Parameters:
element- The element to be adjusted.group- the logical group name of the VdbGroup that will contain the element.document- The document object that is being processsedtargets- Collection of ESITarget objects.- Returns:
- Element
- Throws:
ESIRendererException
-
adjustDocLinkElement
protected com.infoengine.object.factory.Element adjustDocLinkElement(com.infoengine.object.factory.Element element, String group, BinaryLink documentLink, Collection targets) throws ESIRendererException Allow subclasses to fix the contents of an element. Default behavior is to return the element argument.
Supported API: true- Parameters:
element- The element to be updated.group- The logical group name. Used by the VdbBuilder to identify a VdbGroup.documentLink- The object being mapped for output.targets- Collection of ESITarget objects.- Returns:
- Element
- Throws:
ESIRendererException
-
getESIDoc
public void getESIDoc(Collection<ESITargetAssociation> previousTargetAssociations, Collection currentObjects, Collection<ESITarget> targetOrgs, String wcAdapter, String authorization, VdbBuilder builder) throws WTException Match the previously published object iteration with the currently published object iteration and call the document renderer once for each match. This method is provided for use with the part and certain other renderers that process manufacturing objects.
Supported API: true- Parameters:
previousTargetAssociations- Collection of target associations for previously published RevisionControlled object iterations.currentObjects- Collection of currently published RevisionControlled object iterations.targetOrgs- Collection of ESITargets to which documents associated with the current RevisionControlled object iteration are to be published. Strictly speaking, this will have just one ESITarget object.wcAdapter- Name of the Windchill adapter instance to use for executing the I*E task specified by the ESI preference "Query Document Task".authorization- Authentication information required for executing the I*E task specified by the ESI preference "Query Document Task".builder- VdbBuilder instance to use when creating the output.- Throws:
WTException
-
getDocument
public com.infoengine.object.IeCollection getDocument(String objectID, ESITransaction txn, Collection<ESITarget> tgts, String auth, String wcAdapter) throws WTException Creates a VdbBuilder instance for the input transaction, renders the input document and creates release activities as appropriate for each of the distribution targets in tgts. Returns the rendered output as an Info*Engine collection to the caller.
Supported API: true- Parameters:
objectID- UFID of the input (standalone) document 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- Authentication information required for executing certain Windchill adapter webjects as part of the rendering process.wcAdapter- Name of the Windchill adapter instance to use.- Returns:
- IeCollection The Info*Engine collection that holds the ESI response.
- Throws:
WTException- - if any of the invoked methods throws this exception; ESIRendererException - if the document being rendered has not changed since it was last successfully published and the preference "Enforce Changes" has value "Yes".
-
buildGroups
protected void buildGroups(RevisionControlled current, RevisionControlled previous, Collection<ESITarget> targets) throws WTException Overloaded version of buildGroups() where the actual rendering of documents and document links is done. It is invoked by the other argumentless version.
Supported API: true- Parameters:
current- Currently published RevisionControlled object (such as a WTPart).previous- Previously published iteration of the RevisionControlled object.targets- Collection of ESITarget objects associated to the currently and previously published iterations.- Throws:
WTException- - if any of the invoked methods throws an exception.
-
isIncrementalDocAssociationsPublishEnabled
Returns the value of the preference "Publish Only Incremental Changes to Document Associations" based on the current object. Supported API: true- Parameters:
currentObject-- Returns:
- value of the preference "Publish Only Incremental Changes to Document Associations" according to the current object.
-
adjustDocumentElementForSCCUsages
protected com.infoengine.object.factory.Element adjustDocumentElementForSCCUsages(com.infoengine.object.factory.Element element, String group, Document document, Collection targets) throws ESIRendererException Allow subclasses to fix the contents of an element. Default behavior is to return the element argument.
Supported API: true- Parameters:
element- The element to be adjusted.group- the logical group name of the VdbGroup that will contain the element.document- The document object that is being processsedtargets- Collection of ESITarget objects.- Returns:
- Element
- Throws:
ESIRendererException
-
getDocumentDeltas
protected Collection<Delta>[] getDocumentDeltas(Document document, Collection<ESITarget> targets) throws WTException Returns an array of collections, each one holdingDeltaobjects.Deltaobject holds the previous exported iteration of a document and corresponding targets. The collection at index-0 contains added documents, index-1 contains changed and index-2 contains unchanged documents.
Supported API: true- Parameters:
document- - Input documenttargets- - Collection of distribution targets.- Returns:
- Array of collections.
- Throws:
WTException
-
getDocument
public com.infoengine.object.IeCollection getDocument(String objectID, ESITransactionFacade txn, Collection<? extends ESITargetFacade> targets, Map<? extends ESITargetFacade, Map<String, throws WTExceptionObject>> paramMap, String auth, String wcAdapter) Returns the rendered output as an Info*Engine collection to the caller. CallsgetDocument(String, ESITransaction, Collection, String, String)method.
Supported API: true- Specified by:
getDocumentin interfaceESIDocumentsRendererInterface- Parameters:
objectID- UFID of the input (standalone) document 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.targets- Collection of distribution targets that represent a given destination, such as an ERP instance.paramMap- Map holding ESITarget objects as keys and certain Maps as values;auth- Authentication information required for executing certain Windchill adapter webjects as part of the rendering process.wcAdapter- Name of the Windchill adapter instance to use.- Returns:
- IeCollection The Info*Engine collection that holds the ESI response.
- Throws:
WTException- - if any of the invoked methods throws this exception; ESIRendererException - if the document being rendered has not changed since it was last successfully published and the preference "Enforce Changes" has value "Yes". (non-Javadoc)- See Also:
-
BasicESIRenderer.getAdapterName()instead.Supported API: true