com.ptc.windchill.esi.rnd
Class BasicESIRenderer

java.lang.Object
  extended by com.ptc.windchill.esi.rnd.BasicESIRenderer
All Implemented Interfaces:
ESIRenderer
Direct Known Subclasses:
ESIBOMHeaderRenderer, ESIBOMRenderer, ESIBOMSubordinateRenderer, ESIDocumentsRenderer, ESIECNHeaderRenderer, ESIWTChangeOrder2Renderer, ESIWTPartRenderer

public abstract class BasicESIRenderer
extends Object
implements ESIRenderer

A repository for convenience methods which are useful in many renderers.

Supported API: true

Extendable: true


Method Summary
protected  void adjustDateEffectivities(com.infoengine.object.factory.Element element, Eff eff)
          Adds date effectivity information to an Element based on the date effectivity of the WTPart.
protected  void adjustEffectivities(com.infoengine.object.factory.Element element, Eff eff)
          Adds date effectivity information to an Element based on the date effectivity of the WTPart.
protected  void adjustEffectivities(com.infoengine.object.factory.Element element, Eff[] effs)
          Invokes an appropriate method for each of the elements that figure in the passed array of Effs.
protected  void adjustLotNumberEffCxt(com.infoengine.object.factory.Element element, Eff eff)
          Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the lot number effectivity context part number attribute on the passed I*E element.
protected  void adjustLotNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff)
          It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end lot number effectivity in the passed I*E element to the fetched start and end values respectively.
protected  void adjustObjectID(com.infoengine.object.factory.Element element, String objectID)
          If the Info*Engine element argument has an "objectID" attribute, change its value to the value of the objectID argument.
protected  void adjustSerialNumberEffCxt(com.infoengine.object.factory.Element element, Eff eff)
          Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the serial number effectivity context part number attribute on the passed I*E element.
protected  void adjustSerialNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff)
          It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end serial number effectivity in the passed I*E element to the fetched start and end values respectively.
protected  void adjustTargets(com.infoengine.object.factory.Element element, Collection targets)
          For each entry in the targets argument, create a new Info*Engine Att object and add it to the element argument.
protected abstract  void buildGroups()
          Abstract method that forces subclasses to implement buildGroups.
protected  String buildUfidString(Collection objects, String completeUFIDString, Class objectType)
          This method will build the ufid string of Object ids for the I*E task.
 VdbBuilder getBuilder()
          Gets the value of the attribute: builder.
protected  com.infoengine.object.IeCollection invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter)
          This method will call the I*E task specfied by the task name.
protected  com.infoengine.object.IeCollection invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter, String groupName)
          This method will call the I*E task specfied by the task name.
protected  com.infoengine.object.IeCollection invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter, String groupName, String attrList)
          This method will call the I*E task specfied by the task name.
protected  com.infoengine.object.factory.Element mapElement(String groupName, com.infoengine.object.factory.Element element)
          Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input.
protected  com.infoengine.object.factory.Element mapObject(String groupName, Object object)
          Calls the ESI mapper to create an Info*Engine Element using an object as input.
protected  com.infoengine.object.factory.Element mapObject(String groupName, Object object, Collection softTypes)
          Calls the ESI mapper to create an Info*Engine Element using an object as input.
 void render(VdbBuilder builder)
          This is a template method for ESI Services renderers.
 void setBuilder(VdbBuilder a_Builder)
          Sets the value of the attribute: builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBuilder

public VdbBuilder getBuilder()
Gets the value of the attribute: builder.

Supported API: true

Returns:
VdbBuilder

setBuilder

public void setBuilder(VdbBuilder a_Builder)
Sets the value of the attribute: builder.

Supported API: true

Parameters:
a_Builder -

adjustEffectivities

protected void adjustEffectivities(com.infoengine.object.factory.Element element,
                                   Eff eff)
                            throws com.ptc.windchill.esi.rnd.ESIRendererException
Adds date effectivity information to an Element based on the date effectivity of the WTPart. Does the following:
  1. Reads ESI properties to find the name for the effectivity end date Att of the argument Element and the name of the effectivity start date Att of the argument Element. If either of those Atts are missing, or contain a value they are ignored.
  2. Gets an ESIEffectivityHandler from the ESIEffectivityHandlerFactory.
  3. Gets a DateEff from the effectivity handler. If the result is not null:
    • Obtains the appropriate format from ESI properties
    • Formats and adds the start date to the appropriate Att
    • If the end date is present in the DateEff, formats it and adds it to the appropriate Att
This method is deprecated at X-10. Use the method adjustDateEffectivities() instead.

Supported API: true

Parameters:
element - The element to be updated.
eff - The effectivity object to add to the element.
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

adjustDateEffectivities

protected void adjustDateEffectivities(com.infoengine.object.factory.Element element,
                                       Eff eff)
                                throws com.ptc.windchill.esi.rnd.ESIRendererException
Adds date effectivity information to an Element based on the date effectivity of the WTPart. Does the following:
  1. Reads ESI properties to find the name for the effectivity end date Att of the argument Element and the name of the effectivity start date Att of the argument Element. If either of those Atts are missing, or contain a value they are ignored.
  2. Gets an ESIEffectivityHandler from the ESIEffectivityHandlerFactory.
  3. Gets a DateEff from the effectivity handler. If the result is not null:
    • Obtains the appropriate format from ESI properties
    • Formats and adds the start date to the appropriate Att
    • If the end date is present in the DateEff, formats it and adds it to the appropriate Att


Supported API: true

Parameters:
element - The I*E element to be updated.
eff - The Eff instance to look up for the date effectivity values to add to the I*E element.
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

adjustSerialNumberEffectivities

protected void adjustSerialNumberEffectivities(com.infoengine.object.factory.Element element,
                                               Eff eff)
It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end serial number effectivity in the passed I*E element to the fetched start and end values respectively. The relevant attribute names (for start and end serial number effectivity) are fetched from certain ESI properties. Also, the attributes are set provided they exist in the passed I*E element and are not set to any value at the time of executing the method. Besides setting the attributes for start and end serial number effectivity, the method calls adjustSerialNumberEffCxt() to populate the serial number effectivity context part number attribute on the passed I*E element.

Supported API: true

Parameters:
element - The I*E Element whose serial number effectivity attributes are to be updated.
eff - The Eff instance to look up for the serial number effectivity values to add to the I*E Element.

adjustSerialNumberEffCxt

protected void adjustSerialNumberEffCxt(com.infoengine.object.factory.Element element,
                                        Eff eff)
Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the serial number effectivity context part number attribute on the passed I*E element. The name of the attribute is fetched from a certain ESI property.

Supported API: true

Parameters:
element - The I*E Element whose serial number effectivity context part number attribute needs to be updated.
eff - The Eff instance to look up for the serial number effectivity context - the part number associated with the fetched context is then used for setting the relevant attribute on the passed I*E element.

adjustLotNumberEffectivities

protected void adjustLotNumberEffectivities(com.infoengine.object.factory.Element element,
                                            Eff eff)
It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end lot number effectivity in the passed I*E element to the fetched start and end values respectively. The relevant attribute names (for start and end lot number effectivity) are fetched from certain ESI properties. Also, the attributes are set provided they exist in the passed I*E element and are not set to any value at the time of executing the method. Besides setting the attributes for start and end lot number effectivity, the method calls adjustLotNumberEffCxt() to populate the lot number effectivity context part number attribute on the passed I*E element.

Supported API: true

Parameters:
element - The I*E Element whose lot number effectivity attributes are to be updated.
eff - The Eff instance to look up for the lot number effectivity values to add to the I*E Element.

adjustLotNumberEffCxt

protected void adjustLotNumberEffCxt(com.infoengine.object.factory.Element element,
                                     Eff eff)
Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the lot number effectivity context part number attribute on the passed I*E element. The name of the attribute is fetched from a certain ESI property.

Supported API: true

Parameters:
element - The I*E Element whose lot number effectivity context part number attribute needs to be updated.
eff - The Eff instance to look up for the lot number effectivity context - the part number associated with the fetched context is then used for setting the relevant attribute on the passed I*E element.

adjustEffectivities

protected void adjustEffectivities(com.infoengine.object.factory.Element element,
                                   Eff[] effs)
Invokes an appropriate method for each of the elements that figure in the passed array of Effs. The method invoked will be adjustDateEffectivies(), adjustSerialNumberEffectivities() or adjustLotNumberEffectivities(), according as the element encountered in the array is of type WTDatedEffectivity, ProductSerialNumberEffectivity or ProductLotNumberEffectivity respectively.

Supported API: true

Parameters:
element - The I*E Element whose date, serial number and lot number effectivity attributes are to be updated.
effs - An array of Effs to look up for date, serial number and lot number effectivity values to add to the passed I*E element.

adjustObjectID

protected void adjustObjectID(com.infoengine.object.factory.Element element,
                              String objectID)
                       throws com.ptc.windchill.esi.rnd.ESIRendererException
If the Info*Engine element argument has an "objectID" attribute, change its value to the value of the objectID argument.

Supported API: true

Parameters:
element - The element to be updated.
objectID - The value to assign to the objectID attribute of the element argument.
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

adjustTargets

protected void adjustTargets(com.infoengine.object.factory.Element element,
                             Collection targets)
                      throws com.ptc.windchill.esi.rnd.ESIRendererException
For each entry in the targets argument, create a new Info*Engine Att object and add it to the element argument.

Supported API: true

Parameters:
element - The Info*Engine element that is to be updated.
targets - A collection of ESITarget objects.
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

buildGroups

protected abstract void buildGroups()
                             throws com.ptc.windchill.esi.rnd.ESIRendererException
Abstract method that forces subclasses to implement buildGroups. The concrete method is expected to navigate the object of interest and to create I*E groups of Elements and Atts. When completed with the construction of the groups, the concrete class is expected to add the constructed groups into the IeCollection that this object created. ESI renderers use the services of a VdbBuilder to create and render the output.

Supported API: true

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

buildUfidString

protected String buildUfidString(Collection objects,
                                 String completeUFIDString,
                                 Class objectType)
                          throws WTException
This method will build the ufid string of Object ids for the I*E task. The ufids will be returned delimited by "~" character.

Supported API: true

Parameters:
objects - Collection of persistable objects.
completeUFIDString - String of UFIDs from a previous call
objectType - The class of the persistable object. Used to return only objects of that type.
Returns:
String
Throws:
WTException

invokeQueryTask

protected com.infoengine.object.IeCollection invokeQueryTask(String taskName,
                                                             String className,
                                                             String ufids,
                                                             String auth,
                                                             String wcAdapter)
                                                      throws WTException
This method will call the I*E task specfied by the task name. The I*E collection from the task is returned.

Supported API: true

Parameters:
taskName - The URL location and name of the task to be executed.
className - The Windchill class to run the I*E task on. This is the "Type" parameter in the Webject call.
ufids - This is a list of object ids to run the task with.
auth - This is the I*E authorization to run the task.
wcAdapter - Windchill adapter instance where the task will be executed.
Returns:
IeCollection
Throws:
WTException

invokeQueryTask

protected com.infoengine.object.IeCollection invokeQueryTask(String taskName,
                                                             String className,
                                                             String ufids,
                                                             String auth,
                                                             String wcAdapter,
                                                             String groupName)
                                                      throws WTException
This method will call the I*E task specfied by the task name. The I*E collection from the task is returned.

Supported API: true

Parameters:
taskName - The URL location and name of the task to be executed.
className - The Windchill class to run the I*E task on. This is the "Type" parameter in the Webject call.
ufids - This is a list of object ids to run the task with.
auth - This is the I*E authorization to run the task.
wcAdapter - Windchill adapter instance where the task will be executed.
groupName - The output group name.
Returns:
IeCollection
Throws:
WTException

invokeQueryTask

protected com.infoengine.object.IeCollection invokeQueryTask(String taskName,
                                                             String className,
                                                             String ufids,
                                                             String auth,
                                                             String wcAdapter,
                                                             String groupName,
                                                             String attrList)
                                                      throws WTException
This method will call the I*E task specfied by the task name. The I*E collection from the task is returned.

Supported API: true

Parameters:
taskName - The URL location and name of the task to be executed.
className - The Windchill class to run the I*E task on. This is the "Type" parameter in the Webject call.
ufids - This is a list of object ids to run the task with.
auth - This is the I*E authorization to run the task.
wcAdapter - Windchill adapter instance where the task will be executed.
groupName - The output group name.
attrList - The source attribute list (ie. windchill attributes) excluding 'obid' in map file.
Returns:
IeCollection
Throws:
WTException

mapElement

protected com.infoengine.object.factory.Element mapElement(String groupName,
                                                           com.infoengine.object.factory.Element element)
                                                    throws com.ptc.windchill.esi.rnd.ESIRendererException
Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input. Obtains the map information using the logical group name in the groupName argument.

Supported API: true

Parameters:
groupName - The logical VDB group name.
element - The Info*Engine Element to map.
Returns:
Element
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

mapObject

protected com.infoengine.object.factory.Element mapObject(String groupName,
                                                          Object object)
                                                   throws com.ptc.windchill.esi.rnd.ESIRendererException
Calls the ESI mapper to create an Info*Engine Element using an object as input. Obtains the map information using the logical group name in the groupName argument.

Supported API: true

Parameters:
groupName - The logical group name. Used to obtain the appropriate map information.
object - The object that is to be rendered as an Info*Engine element.
Returns:
Element
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

render

public void render(VdbBuilder builder)
            throws com.ptc.windchill.esi.rnd.ESIRendererException
This is a template method for ESI Services renderers. It saves the argument and then calls validate() and buildGroups().

Supported API: true

Specified by:
render in interface ESIRenderer
Parameters:
builder - The VDB builder to use when rendering output.
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException

mapObject

protected com.infoengine.object.factory.Element mapObject(String groupName,
                                                          Object object,
                                                          Collection softTypes)
                                                   throws com.ptc.windchill.esi.rnd.ESIRendererException
Calls the ESI mapper to create an Info*Engine Element using an object as input. Obtains the map information using the logical group name in the groupName argument. An additional parameter softTypes is passed to the method. This vector will be populated with all those attributes that do not have a getter method.

Supported API: true

Parameters:
groupName - The logical group name. Used to obtain the appropriate map information.
object - The object that is to be rendered as an Info*Engine element.
Returns:
Element
Throws:
com.ptc.windchill.esi.rnd.ESIRendererException