com.ptc.windchill.esi.esidoc
Class ESIDocUtility

java.lang.Object
  extended bycom.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

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  TaskHelper taskHelper
           
 
Constructor Summary
ESIDocUtility()
           
 
Method Summary
(package private)  Vector addDocsToVector(PartDocInfo pdi, boolean getDoc, Vector documents)
           
(package private)  Collection addElementstoResponse(Collection docs, Group docGrp)
           
(package private)  Collection addTargetsToDocument(Collection docs)
           
(package private)  Collection addTargetsToDocuments(Collection docs, Collection targets)
           
(package private)  Collection getAllDocuments(Collection[] partDocInfo, boolean getDoc)
          

Supported API: false
 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.
 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
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(ESIDocUtility thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 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
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

taskHelper

private TaskHelper taskHelper
Constructor Detail

ESIDocUtility

public ESIDocUtility()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ESIDocUtility thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getESIDoc

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

getAllDocuments

final Collection getAllDocuments(Collection[] partDocInfo,
                                 boolean getDoc)


Supported API: false

Parameters:
partDocInfo -
getDoc -
Returns:
Collection

addDocsToVector

final Vector addDocsToVector(PartDocInfo pdi,
                             boolean getDoc,
                             Vector documents)

addTargetsToDocuments

final Collection addTargetsToDocuments(Collection docs,
                                       Collection targets)
                                throws WTException
Throws:
WTException

addTargetsToDocument

final Collection addTargetsToDocument(Collection docs)

addElementstoResponse

final Collection addElementstoResponse(Collection docs,
                                       Group docGrp)
                                throws WTException
Throws:
WTException