com.ptc.windchill.esi.esipart
Class ESIWTPartRenderer

java.lang.Object
  extended bycom.ptc.windchill.esi.rnd.BasicESIRenderer
      extended bycom.ptc.windchill.esi.esipart.ESIWTPartRenderer
All Implemented Interfaces:
ESIRenderer, Serializable

public class ESIWTPartRenderer
extends BasicESIRenderer
implements Serializable

This class renders a single part in DataResponse (ie. ) .

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
protected static String ADDED_ALTERNATEGROUP_NAME
           
protected static String ADDEDGROUP_NAME
           
protected static String ALT_TASK_URI
           
private  boolean alternatesRequired
           
private  String auth
           
protected static String CHANGEDGROUP_NAME
           
private static String CLASSNAME
           
protected static String DELETED_ALTERNATEGROUP_NAME
           
protected static String DELETEDGROUP_NAME
           
private  boolean documentsRequired
           
private  boolean isBom
           
protected static String MAP_FILE_PATH
           
protected static Class PART_CLASS
           
protected static Class PARTALTLINK_CLASS
           
private  Collection parts
           
protected static String PARTUFID_GROUP_NAME
           
protected static boolean requireChange
           
private static String RESOURCE
           
private  WTPart root
           
private  ESITargetUtility targetUtility
           
protected static String TASK_URI
           
private  TaskHelper taskHelper
           
private  String transactionID
           
private  ESITransactionUtility transactionUtility
           
protected static String UNCHANGEDGROUP_NAME
           
private  ESIPartUtility utility
           
private  String wcAdapter
           
protected static String wcAttList
           
 
Fields inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
adapterName, PART_CLASS_NAME, XML_META_NAME
 
Constructor Summary
ESIWTPartRenderer()
           
 
Method Summary
private  void addAlternateToElement(String grpName, Group grp, Collection partTargetAssociation)
           
private  void addPartToElement(String grpName, Group grp, Collection partTargetAssociation)
           
protected  Element adjustAlternateElement(Element element, String group, WTPart part, Collection targets)
          Allow subclasses to fix the contents of an element.
protected  Element adjustPartElement(Element element, String group, WTPart part, Eff eff, Collection targets)
          Allow subclasses to fix the contents of an element.
protected  void buildGroups()
          Output generator for the class.
protected  Collection[] findChangedParts(Collection currAssoc, Collection previousAssoc)
           
protected  String getAuth()
          Gets the value of the attribute: auth; Authentication information to pass to Windchill Adapter when executing query webjects.
private  Eff getLatestEffectivity(WTPart part)
           
 IeCollection getPart(String objectID, boolean alternates, boolean documents, String auth, String wcAdapter, String transactionID)
          GetPart RPC processor.
 void getPart(WTPart root, Collection children, boolean alternates, boolean documents, String auth, String wcAdapter, VdbBuilder builder)
          GetPart RPC processor when called from GetBOM or getECN RPC.
protected  Collection getParts()
          Gets the value of the attribute: parts; The list of parts that are to be rendered.
protected  WTPart getRoot()
          Gets the value of the attribute: root; The base part of a tree of product structures.
protected  String getTransactionID()
          Gets the value of the attribute: transactionID; The idNumber attribute value of an ESITransaction that is to be associated with this renderer.
protected  String getWcAdapter()
          Gets the value of the attribute: wcAdapter; The name of the Windchill Adapter where query object webjects are to execute.
protected  boolean isAlternatesRequired()
          Gets the value of the attribute: alternatesRequired; Should the renderer obtain the alternates to the parts that are to be rendered?

Supported API: true
protected  boolean isDocumentsRequired()
          Gets the value of the attribute: documentsRequired; Should the renderer call the document renderer?

Supported API: true
private  Element mapAlternateElement(String grpName, Element e, WTPart part, Collection targets)
           
private  Element mapPartElement(String grpName, Element e, WTPart part, Eff eff, Collection targets)
           
 void setData(WTPart root, Collection parts, boolean buildAlts, boolean buildDocs, String auth, String wcAdapter, String transactionID)
          Establish the renderer's state so that it can process requests.
 void setMetaValues(Group group)
           
protected  void validate()
          Make sure the object is ready to process.
 
Methods inherited from class com.ptc.windchill.esi.rnd.BasicESIRenderer
adjustEffectivities, adjustObjectID, adjustTargets, buildUfidString, getAdapterName, getAttsFromMapFile, getBuilder, getEffectivityHandler, getGroupInfo, getMap, getMapInfo, getTargetsFromAssns, getWCAttributeList, invokeQueryTask, invokeQueryTask, invokeQueryTask, mapElement, mapObject, render, setBuilder, setEffectivityHandler
 
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

parts

private Collection parts

root

private WTPart root

alternatesRequired

private boolean alternatesRequired

documentsRequired

private boolean documentsRequired

auth

private String auth

wcAdapter

private String wcAdapter

transactionID

private String transactionID

requireChange

protected static final boolean requireChange

PART_CLASS

protected static final Class PART_CLASS

PARTALTLINK_CLASS

protected static final Class PARTALTLINK_CLASS

TASK_URI

protected static final String TASK_URI

ALT_TASK_URI

protected static final String ALT_TASK_URI

PARTUFID_GROUP_NAME

protected static final String PARTUFID_GROUP_NAME
See Also:
Constant Field Values

MAP_FILE_PATH

protected static final String MAP_FILE_PATH

ADDEDGROUP_NAME

protected static final String ADDEDGROUP_NAME
See Also:
Constant Field Values

CHANGEDGROUP_NAME

protected static final String CHANGEDGROUP_NAME
See Also:
Constant Field Values

DELETEDGROUP_NAME

protected static final String DELETEDGROUP_NAME
See Also:
Constant Field Values

UNCHANGEDGROUP_NAME

protected static final String UNCHANGEDGROUP_NAME
See Also:
Constant Field Values

ADDED_ALTERNATEGROUP_NAME

protected static final String ADDED_ALTERNATEGROUP_NAME
See Also:
Constant Field Values

DELETED_ALTERNATEGROUP_NAME

protected static final String DELETED_ALTERNATEGROUP_NAME
See Also:
Constant Field Values

isBom

private boolean isBom

taskHelper

private TaskHelper taskHelper

targetUtility

private ESITargetUtility targetUtility

transactionUtility

private ESITransactionUtility transactionUtility

utility

private ESIPartUtility utility

wcAttList

protected static String wcAttList
Constructor Detail

ESIWTPartRenderer

public ESIWTPartRenderer()
Method Detail

getParts

protected Collection getParts()
Gets the value of the attribute: parts; The list of parts that are to be rendered.

Supported API: true

Returns:
Collection

getRoot

protected WTPart getRoot()
Gets the value of the attribute: root; The base part of a tree of product structures.

Supported API: true

Returns:
WTPart

isAlternatesRequired

protected boolean isAlternatesRequired()
Gets the value of the attribute: alternatesRequired; Should the renderer obtain the alternates to the parts that are to be rendered?

Supported API: true

Returns:
boolean

isDocumentsRequired

protected boolean isDocumentsRequired()
Gets the value of the attribute: documentsRequired; Should the renderer call the document renderer?

Supported API: true

Returns:
boolean

getAuth

protected String getAuth()
Gets the value of the attribute: auth; Authentication information to pass to Windchill Adapter when executing query webjects.

Supported API: true

Returns:
String

getWcAdapter

protected String getWcAdapter()
Gets the value of the attribute: wcAdapter; The name of the Windchill Adapter where query object webjects are to execute.

Supported API: true

Returns:
String

getTransactionID

protected String getTransactionID()
Gets the value of the attribute: transactionID; The idNumber attribute value of an ESITransaction that is to be associated with this renderer.

Supported API: true

Returns:
String

validate

protected void validate()
                 throws ESIRendererException
Make sure the object is ready to process. If root, auth, or wcAdapter are null, throws an exception.

Supported API: true

Specified by:
validate in class BasicESIRenderer
Throws:
ESIRendererException

buildGroups

protected void buildGroups()
                    throws ESIRendererException
Output generator for the class. Does the following:
  1. Obtains the contents of the parts collection.
  2. Finds the ESI targets associated with the parts.
  3. Finds the most current released version of the part for each target.
  4. Compares the current version to the most current version. If they are the same and the effectivity has not changed, the part is ignored.
  5. If the part is not ignored, calls the Windchill Adapter to obtain all the attributes of the part.
  6. Maps the result of the Windchill Adapter call.
  7. Calls adjustPartElement()
  8. If documents are required, calls the document renderer.


Supported API: true

Specified by:
buildGroups in class BasicESIRenderer
Throws:
ESIRendererException

adjustPartElement

protected Element adjustPartElement(Element element,
                                    String group,
                                    WTPart part,
                                    Eff eff,
                                    Collection targets)
                             throws ESIRendererException
Allow subclasses to fix the contents of an element.

Supported API: true

Parameters:
element -
group -
part -
eff - May be null.
targets - Collection of ESITarget objects.
Returns:
Element
Throws:
ESIRendererException

adjustAlternateElement

protected Element adjustAlternateElement(Element element,
                                         String group,
                                         WTPart part,
                                         Collection targets)
                                  throws ESIRendererException
Allow subclasses to fix the contents of an element.

Supported API: true

Parameters:
element -
group -
part -
targets - Collection of ESITarget objects.
Returns:
Element
Throws:
ESIRendererException

getPart

public IeCollection getPart(String objectID,
                            boolean alternates,
                            boolean documents,
                            String auth,
                            String wcAdapter,
                            String transactionID)
                     throws WTException
GetPart RPC processor.

Supported API: true

Parameters:
objectID - The UFID of the part that is desired.
alternates - true or false. If true, will return alternates parts for the part in question.
documents - true or false. If true, will return the documents for the part in question. If alternates is true, will return the documents for the alternate parts.
auth - This parameter contains authentication information from I*E.
wcAdapter - This parameter contains the name of the Windchill adapter.
transactionID - The TransactionID for this ObjectID.
Returns:
IeCollection
Throws:
WTException

getPart

public void getPart(WTPart root,
                    Collection children,
                    boolean alternates,
                    boolean documents,
                    String auth,
                    String wcAdapter,
                    VdbBuilder builder)
             throws WTException
GetPart RPC processor when called from GetBOM or getECN RPC. Validates arguments then creates a VDBBuilder if one hasn't already been provided. Creates a PartRenderer. Passes control to the renderer. Does not call asVDB() on the renderer because the caller of this method is responsible to do that.

Supported API: true

Parameters:
root - The primary part for the BOM. Needed if target assignments are implicit.
children - A collection of WTParts that are to be released. These parts are presumed to not be the root.
alternates - true or false. If true, will return alternates parts for the part in question.
documents - true or false. If true, will return the documents for the part in question. If alternates is true, will return the documents for the alternate parts.
auth - This parameter contains authentication information from I*E
wcAdapter - This parameter contains the name of the Windchill adapter.
builder -
Throws:
WTException

setData

public void setData(WTPart root,
                    Collection parts,
                    boolean buildAlts,
                    boolean buildDocs,
                    String auth,
                    String wcAdapter,
                    String transactionID)
Establish the renderer's state so that it can process requests.

Supported API: false

Parameters:
root - The primary part to process. May not be null. If multiple parts are to be processed, the renderer will use the root as the base part for target determination.
parts - A collection of additional parts to process. May be empty.
buildAlts - Are alternates to be returned by the renderer?
buildDocs - Are documents associated with the part to be returned by the renderer?
auth - Info*Engine authorization for invoking a webject.
wcAdapter - Windchill adapter instance to run the webject
transactionID - Optional transaction ID to pass to the VDB builder.

setMetaValues

public void setMetaValues(Group group)

addPartToElement

private void addPartToElement(String grpName,
                              Group grp,
                              Collection partTargetAssociation)
                       throws ESIRendererException
Throws:
ESIRendererException

findChangedParts

protected Collection[] findChangedParts(Collection currAssoc,
                                        Collection previousAssoc)
                                 throws ESIRendererException
Throws:
ESIRendererException

addAlternateToElement

private void addAlternateToElement(String grpName,
                                   Group grp,
                                   Collection partTargetAssociation)
                            throws ESIRendererException
Throws:
ESIRendererException

mapAlternateElement

private Element mapAlternateElement(String grpName,
                                    Element e,
                                    WTPart part,
                                    Collection targets)
                             throws ESIRendererException
Throws:
ESIRendererException

mapPartElement

private Element mapPartElement(String grpName,
                               Element e,
                               WTPart part,
                               Eff eff,
                               Collection targets)
                        throws ESIRendererException
Throws:
ESIRendererException

getLatestEffectivity

private Eff getLatestEffectivity(WTPart part)
                          throws ESIRendererException
Throws:
ESIRendererException