com.ptc.windchill.esi.esidoc
Class ESIDocumentRenderer

java.lang.Object
  extended by com.ptc.windchill.esi.rnd.ResponseRendererImpl
      extended by com.ptc.windchill.esi.esidoc.ESIDocumentRenderer
All Implemented Interfaces:
DocumentRenderer, ResponseRenderer, Serializable

public class ESIDocumentRenderer
extends ResponseRendererImpl
implements DocumentRenderer, Serializable

This is the ESI default implementation of DocumentRenderer.

Supported API: true

Extendable: true

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.
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.ResponseRendererImpl
adjustEffectivities, adjustObjectID, adjustTargets, buildUfidString, getBuilder, invokeQueryTask, mapElement, mapObject, render, setBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ptc.windchill.esi.rnd.ResponseRenderer
render
 

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

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 ResponseRendererImpl
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

setData

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

Supported API: true

Specified by:
setData in interface DocumentRenderer
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.