com.ptc.windchill.esi.esidoc
Class ESIDocUtility

java.lang.Object
  extended by com.ptc.windchill.esi.esidoc.ESIDocUtility
All Implemented Interfaces:
Externalizable, Serializable

public final class ESIDocUtility
extends Object
implements Externalizable



Supported API: true

Extendable: false

See Also:
Serialized Form

Method Summary
 Collection getDocLinks(Collection documents, Collection partDocInfo)
          Given a Collection of ESITargetAssociations and a Collection of PartDocInfo objects, return a Collection of ESITargetAssocations whose persistable object was found from the contents of both inout arguments.
 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
 Collection[] retrievePartDocDifferences(WTPart currentPart, WTPart previousPart)
          This method compares the set of WTDocuments and EPMDocuments that are associated with the two given WTPart iterations and returns an array of QueryResult objects.
 Collection retrievePartDocInformation(WTPart part)
          Returns Collection of PartDocInfo objects that provide information about the WTDocument and EPMDocuments associated with the given WTPart

Supported API: true
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getESIDoc

public final 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 final 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

getDocLinks

public final Collection getDocLinks(Collection documents,
                                    Collection partDocInfo)
                             throws WTException
Given a Collection of ESITargetAssociations and a Collection of PartDocInfo objects, return a Collection of ESITargetAssocations whose persistable object was found from the contents of both inout arguments. Do the following for each entry in the partDocInfo argument :
  1. Obtain document from the entry.
  2. Obtain an iterator from the documents collection. For each ESITargetAssociation entry in the documents collection:
    • Obtain the document, which is the persistable object in the ESITargetAssociation entry
    • If the document is the same as the one obtained from the partDocInfo entry:
      1. Create a new ESIQueryTargetAssociation object.
      2. Store the document link from the partDocInfo entry in the new ESIQueryTargetAssociation object.
      3. Store the ESITarget from the documents entry in the new ESIQueryTargetAssociation object.
      4. Add the new ESIQueryTargetAssociation object to the result.
Return the result of the double iteration.

Supported API: true

Parameters:
documents -
partDocInfo -
Returns:
Collection
Throws:
WTException

retrievePartDocInformation

public final Collection retrievePartDocInformation(WTPart part)
                                            throws WTException
Returns Collection of PartDocInfo objects that provide information about the WTDocument and EPMDocuments associated with the given WTPart

Supported API: true

Parameters:
part -
Returns:
Collection
Throws:
WTException

retrievePartDocDifferences

public final Collection[] retrievePartDocDifferences(WTPart currentPart,
                                                     WTPart previousPart)
                                              throws WTException
This method compares the set of WTDocuments and EPMDocuments that are associated with the two given WTPart iterations and returns an array of QueryResult objects.

Element 0 of the array is a Collection of PartDocInfo objects that provide information about the documents that are associated with the current part but are not associated with the previous part. In the ESI scenario, this would represent the set of documents that have been added to the part since the last time the part had been sent to ERP.

Element 1 of the array is a Collection of PartDocInfo objects that provide information about the documents that are associated with the previous part but are not associated with the current part. In the ESI scenario, this would represent the set of documents that have been deleted from the part since the last time the part had been sent to ERP.

Element 2 of the array is a Collection of PartDocInfo objects that provide information about the documents that are associated with both the previous part and current part.

Supported API: true

Parameters:
currentPart -
previousPart -
Returns:
Collection[]
Throws:
WTException