Class ESIEPMDocumentRenderer

All Implemented Interfaces:
ESIRenderer, ESIDocumentsRendererInterface

public class ESIEPMDocumentRenderer extends ESIAbstractDocumentsRenderer implements ESIDocumentsRendererInterface
This class renders a CAD Document structure.

Supported API: true

Extendable: true
  • Method Details

    • getEPMDocument

      public com.infoengine.object.IeCollection getEPMDocument(String objectID, ESITransaction txn, Collection<ESITarget> targets, Map<ESITarget,Map<String,Object>> paramMap, String auth, String wcAdapter) throws ESIRendererException, WTException
      Renders the input EPM document structure and returns the output as an Info*Engine collection to the caller. Additionally it creates release activities for each of the distribution targets in targets collection if the transaction parameter is not a null.

      Supported API: true
      Parameters:
      objectID - - UFID of the header of the CAD document structure to be rendered.
      txn - - ESITransaction object that represents the delivery of data to the distribution targets in targets collection; if null, release activities will not be created.
      targets - - Collection of distribution targets that represent a given destination, such as an ERP instance.
      paramMap - - Map holding ESITarget objects as keys and certain Maps as values; each value Map holds the names of certain parameters (that are used for navigating the CAD document structure and for generating the ESI response) and their values. If a certain parameter is not found in the value Map, its value is fetched from the corresponding target.
      The value Map holds the following parameter names as keys:
      • ESIEPMDocument_DeltaFlag - Specifies whether or not incremental changes to the CAD document structure need to be calculated; can take a value "true" or "false".
      • ESIEPMDocument_MultiLevelFlag - The number of levels in the CAD document structure to be rendered.
      • ESIEPMDocument_ContentSelection - The type of the content to be rendered. Valid values are denoted by the constants ESIConst.EPMDOC_ALLCONTENT, ESIConst.EPMDOC_CADCONTENT, ESIConst.EPMDOC_REPRESENTATIONS.
      • ESIEPMDocument_RepresentationCollectionFilter - Filter to be applied on representations. Any string is a valid value.
      • ESIEPMDocument_SavedFilter - Navigation criteria to be applied on the CAD structure.
      • ESIEPMDocument_UseDefaultRepresentations - Specifies whether or not to fetch only default representations.
      auth - - Authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      wcAdapter - - Name of the Windchill adapter instance.
      Returns:
      The Info*Engine collection that holds the ESI response.
      Throws:
      ESIRendererException - if any of the invoked methods throws this exception.
      WTException - if any of the invoked methods throws this exception.
    • setData

      protected void setData(Object objectInfo, ESITarget target, Map<String,Object> paramsMap, String auth, String wcAdapter, String txnNumber) throws WTException
      Establishes the state of the renderer. It sets the values of the various member variables used for navigating and rendering a CAD structure.

      Supported API: true
      Parameters:
      objectInfo - - UFID/document object of the header of the CAD structure to be rendered.
      target - - Distribution target object to be used for fetching various attributes required for navigating and rendering the CAD structure.
      paramsMap - - Used to pass in various parameters required for navigating and rendering EPM structure. If a certain parameter is not found in this map, then it will be fetched from the target. Check the Javadoc of getDocument(String, ESITransactionFacade, Collection, Map, String, String) & getDocument(Document, Map, String, String, VdbBuilder) method for all the valid parameters.
      auth - - Authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      wcAdapter - - Name of the Windchill adapter instance.
      txnNumber - - Number of the ESITransaction object.
      Throws:
      WTException - if any of the invoked methods throws this exception.
    • buildGroups

      protected void buildGroups() throws ESIRendererException
      Builds the renderer output. Does the following:
      1. Obtains the list of assembly nodes from the CAD structure. Uses the services of a TreeNavigator if multiLevel > 0.
      2. For each EPM document obtained:
        • Fetches the latest released version for each associated target.
        • For each fetched version, current version pair, obtains the difference from object comparison framework. If there is no previous version, that object is considered as getting published for the first time. Hence difference wont be calculated.
        • Calls buildGroups() method of ESIAbstractDocumentsRenderer.
        • Overrides renderAssemblyNodes() method for processing the assembly nodes to render representations.
        • Overrides renderLeaves() method for processing the leaf nodes to render representations.
        • Calls renderRepresentations() method for processing Representations.


      Supported API: true
      Overrides:
      buildGroups in class ESIAbstractDocumentsRenderer
      Throws:
      ESIRendererException - Throws ESI Renderer exception if filed to render specified object.
      See Also:
    • renderAssemblyNodes

      protected void renderAssemblyNodes(Set<Persistable>[] assemblyNodeDiffArray, Map<Persistable,Persistable> currentAndPreviousExpObjects) throws ESIRendererException
      Overrides renderAssemblyNodes method of ESIAbstractDocumentsRenderer to collect document objects for which representations need to be rendered.
      1. Calls renderAssemblyNodes() of ESIAbstractDocumentsRenderer
      2. Updates internal collection to render representation by calling addDocumentsToRenderRepresentations

      Supported API: true
      Overrides:
      renderAssemblyNodes in class ESIAbstractDocumentsRenderer
      Parameters:
      assemblyNodeDiffArray - - An array of Persistable object set each element in array represents objects as follows.
      0th element in array contains all added assembly nodes.
      1st element in array contains all changed assembly nodes.
      2nd element in array contains all unchanged assembly nodes.
      currentAndPreviousExpObjects - - The map containing current iteration as key and previously published iteration as value.
      Throws:
      ESIRendererException
      See Also:
    • addDocumentsToRenderRepresentations

      protected void addDocumentsToRenderRepresentations(Set<Persistable>[] documentDiffArray)
      Adds document nodes for rendering associated representations.

      Supported API: true
      Parameters:
      documentDiffArray - - An array of set containing candidate documents for rendering reprentations
    • renderLeaves

      protected void renderLeaves(Set<Persistable>[] leafDiffArray, Map<Persistable,Persistable> currentAndPreviousExpObjects) throws ESIRendererException
      Overrides renderLeaves method of ESIAbstractDocumentsRenderer to collect document objects for which representations need to be rendered.
      *
      1. Calls renderLeaves() of ESIAbstractDocumentsRenderer
      2. Updates internal collection to render representation by calling addDocumentsToRenderRepresentations

      Supported API: true
      Overrides:
      renderLeaves in class ESIAbstractDocumentsRenderer
      Parameters:
      leafDiffArray - - An array of Persistable object set each element in array represents objects as follows.
      0th element in array contains all added leaf nodes.
      1st element in array contains all changed leaf nodes.
      2nd element in array contains all unchanged leaf nodes.
      currentAndPreviousExpObjects - - The map containing current iteration as key and previously published iteration as value.
      Supported API: true
      Throws:
      ESIRendererException
      See Also:
    • renderRepresentations

      protected void renderRepresentations(Set<EPMDocument> epmDocs) throws WTException
      Renders all the representations associated with the input EPM documents. Finds all the representations associated with the input documents and for each such representation, it invokes mapRepresentationElement() and adds the returned InfoEngine element to the VdbBuilder instance associated with this renderer.

      Supported API: true
      Parameters:
      epmDocs - - Set of EPMDocuments for which representation need to be rendered.
      Throws:
      WTException
    • mapRepresentationElement

      protected com.infoengine.object.factory.Element mapRepresentationElement(String groupName, Representation representation, Representable representable, com.infoengine.object.factory.Element representationElem, Collection<ESITarget> targets) throws ESIRendererException
      Performs the required mapping of attributes for the given representation.

      Supported API: true
      Parameters:
      groupName - - Name of the group in the ESI response for which to perform the mapping.
      representation - - Representation instance for which to perform the attribute mapping.
      representable - - Representable object.
      representationElem - - An InfoEngine elements of the representation objects.
      targets - - Collection of ESITarget instances. These will be used to add distribution target related attributes to the output I*E element.
      Returns:
      InfoEngine element having required attributes and their values for the input representation object.
      Throws:
      ESIRendererException
    • adjustRepresentationElement

      protected com.infoengine.object.factory.Element adjustRepresentationElement(com.infoengine.object.factory.Element element, String groupName, Representation representation, Representable representable, Collection<ESITarget> targets)
      Allows subclasses to fix the contents of an element before it is added to the output group(s). Default behavior is to simply return the argument.

      Supported API: true
      Parameters:
      element - - InfoEngine element whose contents are to be fixed.
      groupName - - InfoEngine group name. The input element will be added to this group in the ESI response.
      representation - - Representation object.
      representable - - Representable object.
      targets - - Collection of ESITarget objects.
      Returns:
      InfoEngine element having fixed data.
    • compareEPMDocuments

      protected static Set<Persistable>[] compareEPMDocuments(EPMDocument currentIteration, EPMDocument previousIteration) throws WTException
      Compares two iterations of a CAD Document. In the returned array of HashSets, the elements at indices 0, 1, 2 and 3 contain all the added, deleted, changed and unchanged links respectively. This method returns wt.epm.structure.EPMMemberLink and wt.epm.structure.EPMReferenceLink objects only.

      Supported API: true
      Parameters:
      currentIteration - - Currently published iteration of a CAD Document.
      previousIteration - - A previously published iteration of a CAD Document.
      Returns:
      An array of Sets containing the difference information between the input CAD document iterations.
      Throws:
      WTException
    • getDocument

      public com.infoengine.object.IeCollection getDocument(String objectID, ESITransactionFacade txn, Collection<? extends ESITargetFacade> targets, Map<? extends ESITargetFacade,Map<String,Object>> paramMap, String auth, String wcAdapter) throws WTException
      Returns the rendered output as an Info*Engine collection to the caller. Calls getEPMDocument(String, ESITransaction, Collection, Map, String, String) method.

      Supported API: true
      Specified by:
      getDocument in interface ESIDocumentsRendererInterface
      Parameters:
      objectID - - UFID of the header of the CAD document structure to be rendered.
      txn - - ESITransaction object that represents the delivery of data to the distribution targets in targets collection; if null, release activities will not be created.
      targets - - Collection of distribution targets that represent a given destination, such as an ERP instance.
      paramMap - - Map holding ESITarget objects as keys and certain Maps as values; each value Map holds the names of certain parameters (that are used for navigating the CAD document structure and for generating the ESI response) and their values. If a certain parameter is not found in the value Map, its value is fetched from the corresponding target.
      The value Map holds the following parameter names as keys:
      • ESIEPMDocument_DeltaFlag - Specifies whether or not incremental changes to the CAD document structure need to be calculated; can take a value "true" or "false".
      • ESIEPMDocument_MultiLevelFlag - The number of levels in the CAD document structure to be rendered.
      • ESIEPMDocument_ContentSelection - The type of the content to be rendered. Valid values are denoted by the constants ESIConst.EPMDOC_ALLCONTENT, ESIConst.EPMDOC_CADCONTENT, ESIConst.EPMDOC_REPRESENTATIONS.
      • ESIEPMDocument_RepresentationCollectionFilter - Filter to be applied on representations. Any string is a valid value.
      • ESIEPMDocument_SavedFilter - Navigation criteria to be applied on the CAD structure.
      • ESIEPMDocument_UseDefaultRepresentations - Specifies whether or not to fetch only default representations.
      auth - - Authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      wcAdapter - - Name of the Windchill adapter instance.
      Returns:
      The Info*Engine collection that holds the ESI response.
      Throws:
      WTException - if any of the invoked methods throws this exception. (non-Javadoc)
      See Also:
    • getDocument

      public void getDocument(Document document, Map<? extends ESITargetFacade,Map<String,Object>> paramMap, String auth, String wcAdapter, VdbBuilder vdbBuilder) throws WTException
      Adds the rendered output VdbBuilder specified by the caller. This method is typically called by other renderer to render CAD document structure along with other caller object

      Supported API: true
      Parameters:
      document - - The header CAD document of the CAD document structure to be rendered.
      paramMap - - Map holding ESITarget objects as keys and certain Maps as values; each value Map holds the names of certain parameters (that are used for navigating the CAD document structure and for generating the ESI response) and their values. If a certain parameter is not found in the value Map, its value is fetched from the corresponding target.
      The value Map holds the following parameter names as keys:
      • ESIEPMDocument_DeltaFlag - Specifies whether or not incremental changes to the CAD document structure need to be calculated; can take a value "true" or "false".
      • ESIEPMDocument_MultiLevelFlag - The number of levels in the CAD document structure to be rendered.
      • ESIEPMDocument_ContentSelection - The type of the content to be rendered. Valid values are denoted by the constants ESIConst.EPMDOC_ALLCONTENT, ESIConst.EPMDOC_CADCONTENT, ESIConst.EPMDOC_REPRESENTATIONS.
      • ESIEPMDocument_RepresentationCollectionFilter - Filter to be applied on representations. Any string is a valid value.
      • ESIEPMDocument_SavedFilter - Navigation criteria to be applied on the CAD structure.
      • ESIEPMDocument_UseDefaultRepresentations - Specifies whether or not to fetch only default representations.
      auth - - Authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      wcAdapter - - Name of the Windchill adapter instance.
      vdbBuilder - - An instance of VdbBuilder from other renderer.
      Throws:
      WTException - if any of the invoked methods throws this exception.
      See Also:
    • compareDocuments

      public Set<Persistable>[] compareDocuments(Document currentIteration, Document previousIteration) throws WTException
      Compares two iterations of a CAD Document. In the returned array of HashSets, the elements at indices 0, 1, 2 and 3 contain all the added, deleted, changed and unchanged links respectively. This method returns wt.epm.structure.EPMMemberLink and wt.epm.structure.EPMReferenceLink objects only.

      Supported API: true
      Specified by:
      compareDocuments in class ESIAbstractDocumentsRenderer
      Parameters:
      currentIteration - - Currently published iteration of a CAD Document.
      previousIteration - - A previously published iteration of a CAD Document.
      Returns:
      An array of Sets containing the difference information between the input CAD document iterations.
      Throws:
      WTException
      See Also:
    • getDeltaFlagName

      protected String getDeltaFlagName()
      Returns the delta flag name on the target for the CAD Document i.e ESIEPMDocument_DeltaFlag.

      Supported API: true
      Specified by:
      getDeltaFlagName in class ESIAbstractDocumentsRenderer
      Returns:
      The delta flag name.
      See Also:
    • getNumberOfLevelsFlagName

      protected String getNumberOfLevelsFlagName()
      Returns the flag name on the target for the CAD Document that governs number of levels CAD structure to be rendered i.e ESIEPMDocument_MultiLevelFlag.

      Supported API: true
      Specified by:
      getNumberOfLevelsFlagName in class ESIAbstractDocumentsRenderer
      Returns:
      The number of levels flag name.
      See Also:
    • getFilterFlagName

      protected String getFilterFlagName()
      Returns the flag name on the target for the CAD Document that specified saved filter to be used for CAD structure to be rendered i.e ESIEPMDocument_SavedFilter.

      Supported API: true
      Specified by:
      getFilterFlagName in class ESIAbstractDocumentsRenderer
      Returns:
      The navigation filter flag name.
      See Also:
    • getReferencedDocumentFlagName

      protected String getReferencedDocumentFlagName()
      Returns the flag name on the target for the CAD Document that specified whether or not reference CAD Document should be rendered while rendering CAD Document i.e ESIEPMReferenceDocument_Flag.

      Supported API: true
      Specified by:
      getReferencedDocumentFlagName in class ESIAbstractDocumentsRenderer
      Returns:
      The reference document flag name.
      See Also:
    • getAssemblyHeaderReleaseClass

      protected String getAssemblyHeaderReleaseClass(Persistable cadAssemblyHeader) throws WTException
      Returns the Release Class for CAD document assembly objects

      Supported API: true
      Specified by:
      getAssemblyHeaderReleaseClass in class ESIAbstractDocumentsRenderer
      Parameters:
      cadAssemblyHeader - - The CAD document assembly object.
      Returns:
      The Release Class for CAD document assembly Objects
      Throws:
      WTException
    • getLeafReleaseClass

      protected String getLeafReleaseClass(Persistable leaf) throws WTException
      Returns the Release Class for leaf Objects

      Supported API: true
      Specified by:
      getLeafReleaseClass in class ESIAbstractDocumentsRenderer
      Parameters:
      leaf - - The leaf object.
      Returns:
      The Release Class for leaf Objects
      Throws:
      WTException
    • getStructureLinkClass

      protected Class<? extends ObjectToObjectLink> getStructureLinkClass()
      Returns the association class that defines structure. As this is a CAD Document structure returns class for EPMMemberLink

      Supported API: true
      Specified by:
      getStructureLinkClass in class ESIAbstractDocumentsRenderer
      Returns:
      The link class that defines structure.
      See Also:
    • getReferencedLinkClass

      protected Class<? extends ObjectToObjectLink> getReferencedLinkClass()
      Returns the association class that defines referenced association. As this is a CAD Document returns class for EPMReferenceLink

      Supported API: true
      Specified by:
      getReferencedLinkClass in class ESIAbstractDocumentsRenderer
      Returns:
      The link class that defines reference association.
      See Also:
    • getAddedDocumentsGroupName

      protected String getAddedDocumentsGroupName()
      Returns the Logical group name for the AddedDocuments group.

      Supported API: true
      Specified by:
      getAddedDocumentsGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the added documents objects.
      See Also:
    • getChangedDocumentsGroupName

      protected String getChangedDocumentsGroupName()
      Returns the Logical group name for the ChangedDocuments group.

      Supported API: true
      Specified by:
      getChangedDocumentsGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the changed documents objects.
      See Also:
    • getUnchangedDocumentsGroupName

      protected String getUnchangedDocumentsGroupName()
      Returns the Logical group name for the UnchangedDocuments group.

      Supported API: true
      Specified by:
      getUnchangedDocumentsGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the unchanged documents objects.
      See Also:
    • getDeletdDocumentsGroupName

      protected String getDeletdDocumentsGroupName()
      Returns the Logical group name for the DeletdDocuments group.

      Supported API: true
      Specified by:
      getDeletdDocumentsGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the deleted documents objects.
      See Also:
    • getAddedDocumentStructLinksGroupName

      protected String getAddedDocumentStructLinksGroupName()
      Returns the Logical group name for the AddedDocument Member Links group.

      Supported API: true
      Specified by:
      getAddedDocumentStructLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the added document's structure links objects.
      See Also:
    • getChangedDocumentStructLinksGroupName

      protected String getChangedDocumentStructLinksGroupName()
      Returns the Logical group name for the ChangedDocument Member Links group.

      Supported API: true
      Specified by:
      getChangedDocumentStructLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the changed document's structure links objects.
      See Also:
    • getUnchangedDocumentStructLinksGroupName

      protected String getUnchangedDocumentStructLinksGroupName()
      Returns the Logical group name for the UnchangedDocument Member Links group.

      Supported API: true
      Specified by:
      getUnchangedDocumentStructLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the unchanged document's structure links objects.
      See Also:
    • getDeletedDocumentStructLinksGroupName

      protected String getDeletedDocumentStructLinksGroupName()
      Returns the Logical group name for the DeletedDocument Member Links group.

      Supported API: true
      Specified by:
      getDeletedDocumentStructLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the deleted document's structure links objects.
      See Also:
    • getAddedDocumentRefLinksGroupName

      protected String getAddedDocumentRefLinksGroupName()
      Returns the Logical group name for the AddedDocument Reference Links group.

      Supported API: true
      Specified by:
      getAddedDocumentRefLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the added document's reference links objects.
      See Also:
    • getChangedDocumentRefLinksGroupName

      protected String getChangedDocumentRefLinksGroupName()
      Returns the Logical group name for the ChangedDocument Reference Links group.

      Supported API: true
      Specified by:
      getChangedDocumentRefLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the changed document's reference links objects.
      See Also:
    • getUnchangedDocumentRefLinksGroupName

      protected String getUnchangedDocumentRefLinksGroupName()
      Returns the Logical group name for the UnchangedDocument Reference Links group.

      Supported API: true
      Specified by:
      getUnchangedDocumentRefLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the unchanged document's reference links objects.
      See Also:
    • getDeletedDocumentRefLinksGroupName

      protected String getDeletedDocumentRefLinksGroupName()
      Returns the Logical group name for the DeletedDocument Reference Links group.

      Supported API: true
      Specified by:
      getDeletedDocumentRefLinksGroupName in class ESIAbstractDocumentsRenderer
      Returns:
      the group name for the deleted document's reference links objects.
      See Also:
    • getIsAssemblyAttValue

      protected String getIsAssemblyAttValue(Document document)
      Returns 'true' when specified document is EPMDocument is assembly otherwise 'false'.

      Supported API: true
      Specified by:
      getIsAssemblyAttValue in class ESIAbstractDocumentsRenderer
      Parameters:
      document - - The document for which it needs to determine value for IsAssembly attribute
      Returns:
      the value that need to be set for 'IsAssembly' attribute
      See Also: