Class AbstractResourceRenderer

All Implemented Interfaces:
ESIRenderer, com.ptc.windchill.esi.translation.ESITranslationRenderer
Direct Known Subclasses:
ESIPlantStructureRenderer, ESIProcessMaterialRenderer, ESIResourceGroupStructureRenderer, ESISkillRenderer, ESIToolingRenderer, ESIWorkCenterRenderer

public abstract class AbstractResourceRenderer extends ESIAbstractStructureRenderer implements com.ptc.windchill.esi.translation.ESITranslationRenderer

Supported API: true

Extendable: false
  • Method Details

    • getOperationHolder

      protected MPMOperationHolder getOperationHolder()
      Gets the value of the attribute: root.

      Supported API: true
      Returns:
      MPMOperationHolder
    • getMpmResources

      protected Collection<MPMResource> getMpmResources()
      Gets the value of the attribute: mpmResources.

      Supported API: true
      Returns:
      Collection
    • getPlantOwned

      public MPMPlantOwned getPlantOwned()
      Gets the value of the attribute: plantOwned.

      Supported API: true
      Returns:
      the plantOwned
    • getResourceParent

      public MPMResource getResourceParent()
      Gets the value of the attribute: resourceParent.

      Supported API: true
      Returns:
      the resourceParent
    • getTransactionID

      @Deprecated protected int getTransactionID()
      Deprecated.
      Use
      invalid @link
      {@link #
      } instead of this API.


      Supported API: true
      Gets the value of the attribute: transactionID.
      Returns:
      int
    • getLevels

      @Deprecated protected int getLevels()
      Deprecated.
      Use ESIAbstractStructureRenderer.getMultiLevel() instead of this API.


      Supported API: true
      Gets the value of the attribute: multilevel; How many levels are we to traverse when extracting multi-level BOMs?
      Returns:
      int
    • setData

      public void setData(MPMOperationHolder root, MPMPlantOwned plantOwned, MPMResource resourceParent, Collection<MPMResource> mpmResources, Collection<ESITargetAssociation> processPlanTargetAssocs, boolean buildDocs, boolean delta, int levels, TreeNavigator treeNavigator, String auth, String wcAdapter, int transactionID, MPMOperation operation)
      Establish the renderer's state so that it can process requests.

      Supported API: true
      Parameters:
      root - - Top level process plan being rendered.
      plantOwned - - process plan/part to which the plant is associated. Not null only when the tools in the input "toolings" argument are part of a plant structure.
      resourceParent - - Plant/resource group in which the tooling objects in the input argument "toolings" resides.
      processPlanTargetAssocs - - Collection of target associations for the process plan.
      Note: This parameter is currently not used.
      buildDocs - - Specifies whether or not documents associated with the tooling objects are to be returned by the renderer.
      delta - - If "true", returns only the changes since the last successful export. Default is "true".
      levels - - Number of levels to be navigated.
      treeNavigator - - TreeNavigator instance; has relevance only if a structure holding the input tooling objects was already navigated by some other renderer.
      auth - - Info*Engine authentication information to use when executing a query task.
      wcAdapter - - Windchill adapter instance name to use when executing a webject.
      transactionID - - ID of the underlying ESI transaction.
      operation - - Operation to which the input tooling objects are associated.
      toolings - - Collection of tooling objects to process. May be empty.
    • setData

      public void setData(MPMPlantOwned plantOwnedObj, Collection<MPMResource> mpmResources, boolean publishDocuments, boolean delta, int levels, Collection<ESITargetAssociation> tgtAssociations, String auth, String adapter) throws ESIRendererException
      Set this renderer's member variables that are necessary for rendering plants i.e. MPMPlant objects.

      Supported API: true
      Parameters:
      plantOwnedObj - - Object to which the plants are assigned. part/process plan etc.
      publishDocuments - - Indicates whether or not the documents attached to the plant be published.
      levels - - Number of levels to be navigated.
      tgtAssociations - - Collection of target associations.
      auth - - Info*Engine authentication information to be used when invoking a query task.
      adapter - - Windchill adapter instance name to be used when executing a info*engine webject.
      plants - - Collection of plants which are to be rendered.
      publishDelta - - Indicates whether or not the difference in the plant be calculated. A false indicates the plant should be published as a added object though it is a changed object as per the release history.
      Throws:
      ESIRendererException - if any exception thrown by an ESIRenderer.
    • setData

      @Deprecated public void setData(MPMOperationHolder root, MPMPlantOwned plantOwned, MPMResource resourceParent, Collection<MPMResource> mpmResources, Collection<ESITargetAssociation> processPlanTargetAssocs, boolean buildDocs, String auth, String wcAdapter, int transactionID, MPMOperation operation)
      Establish the renderer's state so that it can process requests.
      Parameters:
      root - - Top level process plan being rendered.
      plantOwned - - process plan/part to which the plant is associated. Not null only when the process materials in the input "processMaterials" argument are part of plant structure.
      resourceParent - - Plant/resource group in which the process material objects in the input argument "processMaterials" resides.
      processPlanTargetAssocs - Collection of target associations for the process plan.
      Note: This parameter is currently not used.
      buildDocs - -Specifies whether or not documents associated with the process materials are to be returned by the renderer.
      auth - - Info*Engine authentication information to use when executing a query task.
      wcAdapter - - Windchill adapter instance name to use when executing a webject.
      transactionID - - ID of the underlying ESI transaction.
      operation - - MPMOperation object which is consuming the resources being rendered.
      processMaterials - - Collection of process material objects to process.
    • setOperation

      protected void setOperation(MPMOperation operation)
      Sets the operation which is consuming the tooling objects being rendered.

      Supported API: true
      Parameters:
      operation - - operation
    • getOperation

      protected MPMOperation getOperation()
      Returns the operation which is consuming the MPMResources being rendered.

      Supported API: true
      Returns:
      the mpm operation which is consuming the MPMResources being rendered.
    • validate

      protected void validate() throws ESIRendererException
      Make sure the object is ready to process. If authentication or adapterName is null, throws an exception.

      Supported API: true
      Specified by:
      validate in class BasicESIRenderer
      Throws:
      ESIRendererException - if any exception thrown by an ESIRenderer.
    • getTgtAssociations

      public Collection<ESITargetAssociation> getTgtAssociations()
      Returns collection of target associations.

      Supported API: true
      Returns:
      the tgtAssociations
    • adjustElement

      protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element element, String group, MPMResource mpmResource, MPMOperationHolder mpmOperationHolder, MPMPlantOwned mpmPlantOwned, MPMResource resourceParent, Eff[] effs, Collection<ESITarget> targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.

      Supported API: true
      Parameters:
      element - - The element to be updated.
      group - - The logical name of the group to which the element will be added.
      mpmResource - - MPMResource being processed.
      mpmOperationHolder - - Top level process plan being rendered.
      mpmPlantOwned - - process plan/part to which the plant is associated. Not null only when the input mpmResource is part of plant structure.
      resourceParent - - Plant/resource group in which the input mpmResource object resides.
      targets - - Collection of ESITarget objects associated with the mpmResource.
      eff - - Effectivity associated with mpmResource.
      Returns:
      Element
      Throws:
      ESIRendererException - if any exception thrown by an ESIRenderer.
    • adjustElement

      @Deprecated protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element element, String group, MPMResource mpmResource, MPMResource parentResource, MPMPlantOwned plantOwned, Collection<ESITarget> targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.
      Parameters:
      element - - The element to be updated.
      plantOwned - - The plant owing object for the resource grou could be process plan or MBOM part
      targets - Collection targets.
      groupName - - The logical name of the group to which the element will be added.
      resourceGroup - - The resource group.
      parentReource - - The parent rsource viz. plant, resource group under which resource group is defined.
      Returns:
      Updated element.
      Throws:
      ESIRendererException
    • adjustElement

      @Deprecated protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element element, String group, MPMResource mpmResource, MPMResource parentResource, Eff[] effs, Collection<ESITarget> targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.
      Parameters:
      element - - The element to be updated.
      group - - The logical name of the group to which the element will be added.
      parentResource - - Plant/ResourceGroup/WorkCenter under which this work center is defined.
      targets - - Collection of ESITarget objects associated with the work center.
      mpmWorkCenter - - Work center being processed.
      eff - - Effectivity associated with work center.
      Returns:
      Element
      Throws:
      ESIRendererException - if any exception thrown by an ESIRenderer.
    • adjustElement

      @Deprecated protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element element, String group, MPMResource plant, MPMPlantOwned plantOwnedObj, Collection<ESITarget> targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.
      Parameters:
      element - - The element to be updated.
      plant - - plant
      plantOwnedObj - process plan/part to which the input plant is associated.
      targets - Collection targets.
      groupName - - The logical name of the group to which the element will be added.
      Returns:
      Updated element.
      Throws:
      ESIRendererException
    • adjustElement

      @Deprecated protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element element, String group, MPMResource mpmResource, Eff[] effs, Collection<ESITarget> targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.
      Parameters:
      element - - The element to be updated.
      group - - The logical name of the group to which the element will be added.
      mpmResource - - MPMResource being processed.
      effs - - Effectivity associated with MPMResource.
      targets - - Collection of ESITarget objects associated with the MPMResource.
      Returns:
      Element
      Throws:
      ESIRendererException - if any exception thrown by an ESIRenderer.
    • getRootToFetchOptionSetInfo

      protected Persistable getRootToFetchOptionSetInfo(MPMOperationHolder mpmOperationHolder, MPMResource mpmResource)
      Returns the root object to be used for fetching the option set information. This method is intended to be overridden by a customizer if they want to use a different root than the default one. It returns the input operation holder (top-level process plan) if it is not null, and the input mpmResource otherwise. The renderer "com.ptc.windchill.esi.ov.ChoiceMappableChoiceLinkRenderer" uses this object to find the appropriate option set for the current mpmResource being rendered. Check the java doc of this renderer for more information.

      Supported API: true
      Parameters:
      mpmOperationHolder - - Top level process plan being rendered.
      mpmResource - - MPMResource being rendered.
      Returns:
      Root object to be used for fetching the option set information.
    • getContextToFetchOptionSetInfo

      protected Persistable getContextToFetchOptionSetInfo(MPMOperation mpmOperation, MPMResource mpmResource)
      Returns the context object to be used for fetching the option set information. This method is intended to be overridden by a customizer if they want to use a different context than the default one. It returns the input operation (which consumes the current mpmResource being rendered) if it is not null, and the input mpmResource otherwise. The renderer "com.ptc.windchill.esi.ov.ChoiceMappableChoiceLinkRenderer" uses this object to render appropriate context information in the response. Check the java doc of this renderer for more information.

      Supported API: true
      Parameters:
      mpmOperation - - Operation which is consuming the input mpmResource being rendered.
      mpmResource - - MPMResource being rendered.
      Returns:
      The object to be used for rendering context information in the response.
    • getPreviousExportedIterations

      protected Collection<ESITargetAssociation> getPreviousExportedIterations(Collection<ESITargetAssociation> currTargetAssoc, String releaseClass) throws WTException
      Returns the previous exported iteration for each resource group and target combination from the input target associations. Simply returns the output of the the API
      invalid reference
      ESITransactionUtility#latestObjectExport(Collection, String)
      .

      Supported API: true
      Parameters:
      currTargetAssoc - - Collection of target associations. Typically, the target association between the resource group being processed and the current target.
      releaseClass - - ESI release class (E.g.: com.ptc.windchill.esi.mpml.ResourceGroup) to be used for fetching appropriate ReleaseActivity objects while computing the previous exported iterations.
      Returns:
      Collection of target associations between the previous exported iteration and the current target.
      Throws:
      WTException - if any of the invoked methods throws this exception.
    • setData

      @Deprecated public void setData(MPMOperationHolder root, Collection<MPMResource> mpmResources, Collection<ESITargetAssociation> processPlanTargetAssocs, boolean buildDocs, String auth, String wcAdapter, int transactionID)
      Establish the renderer's state so that it can process requests.

      Supported API: true
      Parameters:
      root - - Top level process plan being rendered.
      mpmResources - - Collection of mpmResources objects to process. May be empty.
      processPlanTargetAssocs - - Collection of target associations for the process plan.
      Note: This parameter is currently not used.
      buildDocs - - Specifies whether or not documents associated with the mpmResource objects are to be returned by the renderer.
      auth - - Info*Engine authentication information to use when executing a query task.
      wcAdapter - - Windchill adapter instance name to use when executing a webject.
      transactionID - - ID of the underlying ESI transaction.
    • getResourceClass

      protected abstract Class getResourceClass()
      Returns the resource class of currently rendering resource.

      Supported API: true
      Returns:
      The resource class of currently rendering resource. For example : In case of Plant, returns MPMPlant.class.
    • getTaskURI

      protected abstract String getTaskURI()
      Returns the task URI.

      Supported API: true
      Returns:
      The task URI.
    • getResourceTypeId

      protected abstract String getResourceTypeId()
      Returns the resource type ID of currently rendering resource.

      Supported API: true
      Returns:
      The resource type ID of currently rendering resource. For example : In case of Tooling, returns ESIConst.TOOLING_TYPEID.