com.ptc.windchill.esi.esidoc
Class ESIDocumentsRenderer

java.lang.Object
  extended by com.ptc.windchill.esi.rnd.BasicESIRenderer
      extended by com.ptc.windchill.esi.esidoc.ESIDocumentsRenderer
All Implemented Interfaces:
ESIRenderer, Serializable

public class ESIDocumentsRenderer
extends BasicESIRenderer
implements Serializable



Supported API: true

Extendable: false

See Also:
Serialized Form

Method Summary
protected  com.infoengine.object.factory.Element adjustDocLinkElement(com.infoengine.object.factory.Element element, String group, ObjectToObjectLink documentLink, Collection targets)
          Allow subclasses to fix the contents of an element.
protected  com.infoengine.object.factory.Element adjustDocumentElement(com.infoengine.object.factory.Element element, String group, Document document, Collection targets)
          Allow subclasses to fix the contents of an element.
protected  void buildGroups()
          Creates the Document output.
protected  String getAuth()
          Gets the value of the attribute: auth; The authentication information to pass to the Windchill Adapter when executing a query-objects task.
protected  WTPart getCurrentPartIteration()
          Gets the value of the attribute: currentPartIteration; The current iteration of the part associated with this document.
protected  ESIDocUtility getDocUtility()
          Gets the value of the attribute: docUtility; Reference to a ESIDocUtility.
 void getESIDoc(Collection previousParts, Collection currentParts, Collection targetOrgs, String wcAdapter, String authorization, VdbBuilder builder)
          match the previous parts with the current parts and call the document renderer once for each match.
 com.infoengine.object.IeCollection getESIDoc(WTPart previousPart, WTPart currentPart, Collection targetOrgs, String wcAdapter, String authorization, String transactionID)
          Given the current and previous iteration of a part this method will call the DocumentRenderer and create the elements in VdbBuilder

Supported API: true
protected  WTPart getPreviousPartIteration()
          Gets the value of the attribute: previousPartIteration; The last release iteration of the part associated with this document.
protected  Collection getTargets()
          Gets the value of the attribute: targets; A collection ESITarget objects.
protected  TaskHelper getTaskHelper()
          Gets the value of the attribute: taskHelper; Reference to a TaskHelper.
protected  ESITransactionUtility getTransactionUtility()
          Gets the value of the attribute: transactionUtility; Reference to a ESITransactionUtility.
protected  String getWcAdapter()
          Gets the value of the attribute: wcAdapter; The name of the Windchill Adapter where query-object tasks are to be executed.
 void setData(WTPart currentPart, WTPart previousPart, Collection targetOrgs, String wcAdapter, String authorization)
          Provide all necessary data to a DocumentRenderer.
protected  void validate()
          Throws an exception if currentPart or targets attributes are null.
 
Methods inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
adjustDateEffectivities, adjustEffectivities, adjustEffectivities, adjustLotNumberEffCxt, adjustLotNumberEffectivities, adjustObjectID, adjustSerialNumberEffCxt, adjustSerialNumberEffectivities, adjustTargets, buildUfidString, getBuilder, invokeQueryTask, invokeQueryTask, invokeQueryTask, mapElement, mapObject, mapObject, render, setBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrentPartIteration

protected WTPart 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:
WTPart

getPreviousPartIteration

protected WTPart 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:
WTPart

getTargets

protected Collection 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

protected String getWcAdapter()
Gets the value of the attribute: wcAdapter; The name of the Windchill Adapter where query-object tasks are to be executed. No setter for this attribute - it must be set using setData().

Supported API: true

Returns:
String

getAuth

protected String getAuth()
Gets the value of the attribute: auth; The authentication information to pass to the Windchill Adapter when executing a query-objects task. No setter for this attribute - it must be set using setData().

Supported API: true

Returns:
String

getTaskHelper

protected TaskHelper getTaskHelper()
Gets the value of the attribute: taskHelper; Reference to a TaskHelper. Do not access the attribute directly. Use the lazy-initialing getter.

Supported API: true

Returns:
TaskHelper

getDocUtility

protected ESIDocUtility getDocUtility()
Gets the value of the attribute: docUtility; Reference to a ESIDocUtility. Do not access the attribute directly. Use the lazy-initialing getter.

Supported API: true

Returns:
ESIDocUtility

getTransactionUtility

protected ESITransactionUtility getTransactionUtility()
Gets the value of the attribute: transactionUtility; Reference to a ESITransactionUtility. Do not access the attribute directly. Use the lazy-initialing getter.

Supported API: true

Returns:
ESITransactionUtility

setData

public void setData(WTPart currentPart,
                    WTPart previousPart,
                    Collection targetOrgs,
                    String wcAdapter,
                    String authorization)
Provide all necessary data to a DocumentRenderer.

Supported API: true

Parameters:
currentPart - Current part iteration
previousPart - previous part iteration.
targetOrgs - Contains the ESITargets that this document is being exported to.
wcAdapter - The name of the Windchill adapter where the query-object task will be executed.
authorization - The authorization for executing the query-object task.

validate

protected void validate()
                 throws com.ptc.windchill.esi.rnd.ESIRendererException
Throws an exception if currentPart or targets attributes are null. This method may be overridden.

Supported API: true

Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

buildGroups

protected void buildGroups()
                    throws com.ptc.windchill.esi.rnd.ESIRendererException
Creates the Document output. Does the following:
  1. If there is a previous iteration of the part, obtains the differences in document associations between the current part and the previous iteration of the part. Invokes ESIDocUtility.retrievePartDocDifferences() to obtain the differences.

    If there is no previous part iteration, obtains the documents from the current part iteration by requesting them from the ESIDocUtility.retrievePartDocInformation().

    The result of the ESIDocUtility methods is an array of collections of PartDocInfo objects.
  2. Obtains all of the documents associated with the PartDocInfo objects.
  3. Obtains all of the document links associated with the PartDocInfo objects.
  4. Separates the documents and document links on the basis of whether they were added, removed, changed, or unchanged.
  5. Invokes the Windchill adapter query-objects to obtain the data for the document and document link objects.
  6. calls adjustObjectID(), adjustTargets(), adjustDocumentElement() and adjustDocLinkElement()
  7. Passes the resultant Info*Engine element to the VdbBuilder that is maintained by the base class.


Supported API: true

Specified by:
buildGroups in class BasicESIRenderer
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

adjustDocumentElement

protected com.infoengine.object.factory.Element adjustDocumentElement(com.infoengine.object.factory.Element element,
                                                                      String group,
                                                                      Document document,
                                                                      Collection targets)
                                                               throws com.ptc.windchill.esi.rnd.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 processsed
targets - Collection of ESITarget objects.
Returns:
Element
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

adjustDocLinkElement

protected com.infoengine.object.factory.Element adjustDocLinkElement(com.infoengine.object.factory.Element element,
                                                                     String group,
                                                                     ObjectToObjectLink documentLink,
                                                                     Collection targets)
                                                              throws com.ptc.windchill.esi.rnd.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:
com.ptc.windchill.esi.rnd.ESIRendererException

getESIDoc

public com.infoengine.object.IeCollection getESIDoc(WTPart previousPart,
                                                    WTPart currentPart,
                                                    Collection targetOrgs,
                                                    String wcAdapter,
                                                    String authorization,
                                                    String transactionID)
                                             throws WTException
Given the current and previous iteration of a part this method will call the DocumentRenderer and create the elements in VdbBuilder

Supported API: true

Parameters:
previousPart -
currentPart -
targetOrgs -
wcAdapter -
authorization -
transactionID - The id of a transaction to be associated with the VDB builder created by this method.
Returns:
IeCollection
Throws:
WTException

getESIDoc

public void getESIDoc(Collection previousParts,
                      Collection currentParts,
                      Collection targetOrgs,
                      String wcAdapter,
                      String authorization,
                      VdbBuilder builder)
               throws WTException
match the previous parts with the current parts and call the document renderer once for each match. This method is provided for the convenience of the Part Renderer

Supported API: true

Parameters:
previousParts -
currentParts -
targetOrgs -
wcAdapter -
authorization -
builder -
Throws:
WTException