Class DocumentQueryDelegate

java.lang.Object
com.ptc.windchill.esi.delegate.DocumentQueryDelegate
All Implemented Interfaces:
InfDocumentQueryDelegate

public class DocumentQueryDelegate extends Object implements InfDocumentQueryDelegate
Represents document information identified for export by the retrievePartDocInformation and retrievePartDocDifferences methods of the WTPartService.

Supported API: true

Extendable: true
  • Method Details

    • addReferenceDocPDI

      public void addReferenceDocPDI(RevisionControlled part, Hashtable hash, boolean workingIncluded) throws WTException, ConfigException
      Fetches reference document associations for the input object, creates a PartDocInfo instance for each such association and adds them to the input Hashtable.

      Supported API: true
      Specified by:
      addReferenceDocPDI in interface InfDocumentQueryDelegate
      Parameters:
      part - Input RevisionControlled object for which to fetch reference document associations.
      hash - Input Hashtable to add the created PartDocInfo objects to.
      workingIncluded - Determines whether or not working copies are to be included in the output; this is simply passed in to the initialize() API.
      Throws:
      WTException
      ConfigException
    • addDescribeDocumentPDI

      public boolean addDescribeDocumentPDI(RevisionControlled revisionControlled, Hashtable hash, boolean workingIncluded) throws WTException
      Fetches described by document associations for the input object, creates a PartDocInfo instance for each such association and adds them to the input Hashtable.

      Supported API: true
      Specified by:
      addDescribeDocumentPDI in interface InfDocumentQueryDelegate
      Parameters:
      revisionControlled - Input RevisionControlled object for which to fetch described by document associations.
      hash - Input Hashtable to add the created PartDocInfo objects to.
      workingIncluded - Determines whether or not working copies are to be included in the output; this is simply passed in to the initialize() API.
      Returns:
      A true, if the input object has at least one CAD document associated to it; a false, otherwise.
      Throws:
      WTException
    • addBuildHistoryPDI

      public boolean addBuildHistoryPDI(RevisionControlled revisionControlled, Hashtable hash) throws WTException
      Fetches built by (or BuildHistory) document associations for the input object, creates a PartDocInfo instance for each such association and adds them to the input Hashtable.

      Supported API: true
      Specified by:
      addBuildHistoryPDI in interface InfDocumentQueryDelegate
      Parameters:
      revisionControlled - Input RevisionControlled object for which to fetch BuildHistory document associations.
      hash - Input Hashtable to add the created PartDocInfo objects to.
      Returns:
      return A true, if the input object has at least one CAD document associated to it, via a BuildHistory association; a false, otherwise.
      Throws:
      WTException
    • addCalculatedDrawings

      public void addCalculatedDrawings(RevisionControlled rcObj, Hashtable table) throws WTException
      Fetches the calculated drawings for the input RevisionControlled object and adds these to the input Hashtable as appropriate.

      Supported API: true
      Specified by:
      addCalculatedDrawings in interface InfDocumentQueryDelegate
      Parameters:
      rcObj - RevisionControlled object (such as a WTPart) for which to add calculated drawings.
      table - Hashtable to which to add the calculated drawings. See the Javadoc for getCalculatedDrawings() for more information on its contents.
      Throws:
      WTException - if any of the invoked methods throws an exception.
    • getCalculatedDrawings

      public static Collection<EPMDocument> getCalculatedDrawings(RevisionControlled rcObj, Hashtable table) throws WTException
      Fetches the calculated drawings for the input RevisionControlled object, stores them in a collection and returns it to the caller.

      Supported API: true
      Parameters:
      rcObj - RevisionControlled object (such as a WTPart) for which to fetch calculated drawings.
      table - Hashtable of keys and values, where each key is a string holding the object ID of a given document, and each value is the corresponding PartDocInfo object. Only those drawings that do not already exist in this Hashtable are returned.
      Returns:
      Collection of EPMDocuments that represent calculated drawings. A calculated drawing is one that is not directly associated to a RevisionControlled object, but to a CAD model which in turn is associated to the RevisionControlled object.
      Throws:
      WTException - if any of the invoked methods throws an exception.
    • addCalculatedDrawings

      public void addCalculatedDrawings(Collection<EPMDocument> dwgs, Hashtable table) throws WTException
      Adds the drawings in the input collection to the input Hashtable as appropriate.

      Supported API: true
      Specified by:
      addCalculatedDrawings in interface InfDocumentQueryDelegate
      Parameters:
      dwgs - Input collection of calculated drawings.
      table - Hashtable to which to add the drawings. Only those drawings for which an associated CAD model exists in the Hashtable are added.
      Throws:
      WTException - if any of the invoked methods throws an exception.
    • addReferenceDocPDI

      public void addReferenceDocPDI(RevisionControlled revControlledObj, Map<Object,PartDocInfo> documentInfoMap, boolean workingIncluded, boolean isEnterpriseDataMergeWithPart) throws WTException, ConfigException
      Fetches reference document associations for the input object, creates a PartDocInfo instance for each such association and adds them to the input HashMap.If the preference "Reference Document Configuration Specification State" is set to multiple LCS values, and this results in multiple versions of the same document being fetched, only the latest version of the document is added to the HashMap

      Supported API: true
      Specified by:
      addReferenceDocPDI in interface InfDocumentQueryDelegate
      Parameters:
      revControlledObj - Input RevisionControlled object for which to fetch reference document associations.
      documentInfoMap - Input map to add the created PartDocInfo objects to.
      workingIncluded - Determines whether or not working copies are to be included in the output; this is simply passed in to the initialize() API.
      isEnterpriseDataMergeWithPart - Determines if enterprise data is merged with part in the ESI response.
      revControlledObjrevControlledObj - Input RevisionControlled object for which to fetch reference document associations.
      Throws:
      WTException - , ConfigException
      ConfigException
    • addDescribeDocumentPDI

      public boolean addDescribeDocumentPDI(RevisionControlled revisionControlled, Map<Object,PartDocInfo> documentInfoMap, boolean workingIncluded, boolean isEnterpriseDataMergeWithPart) throws WTException
      Fetches described by document associations for the input object, creates a PartDocInfo instance for each such association and adds them to the input Hashtable.

      Supported API: true
      Specified by:
      addDescribeDocumentPDI in interface InfDocumentQueryDelegate
      Parameters:
      revisionControlled - Input RevisionControlled object for which to fetch described by document associations.
      documentInfoMap - Input map to add the created PartDocInfo objects to.
      workingIncluded - Determines whether or not working copies are to be included in the output; this is simply passed in to the initialize() API.
      Returns:
      A true, if the input object has at least one CAD document associated to it; a false, otherwise.
      Throws:
      WTException
    • addBuildHistoryPDI

      public boolean addBuildHistoryPDI(RevisionControlled revisionControlled, Map<Object,PartDocInfo> documentInfoMap, boolean isEnterpriseDataMergeWithPart) throws WTException
      Fetches built by (or BuildHistory) document associations for the input object, creates a PartDocInfo instance for each such association and adds them to the input Hashtable.

      Supported API: true
      Specified by:
      addBuildHistoryPDI in interface InfDocumentQueryDelegate
      Parameters:
      revisionControlled - Input RevisionControlled object for which to fetch BuildHistory document associations.
      documentInfoMap - Input map to add the created PartDocInfo objects to.
      Returns:
      return A true, if the input object has at least one CAD document associated to it, via a BuildHistory association; a false, otherwise.
      Throws:
      WTException
    • addCalculatedDrawings

      public void addCalculatedDrawings(RevisionControlled rcObj, Map<Object,PartDocInfo> documentInfoMap, boolean isEnterpriseDataMergeWithPart) throws WTException
      Fetches the calculated drawings for the input RevisionControlled object and adds these to the input Map as appropriate.

      Supported API: true
      Specified by:
      addCalculatedDrawings in interface InfDocumentQueryDelegate
      Parameters:
      rcObj - RevisionControlled object (such as a WTPart) for which to add calculated drawings.
      documentInfoMap - Input Map to which to add the calculated drawings. See the Javadoc for getCalculatedDrawings() for more information on its contents.
      isEnterpriseDataMergeWithPart - Specifies whether or not to send EnterpriseData and Part information together. It is simply passed in to the downstream APIs.
      Throws:
      WTException - if any of the invoked methods throws an exception.
    • addCalculatedDrawings

      public void addCalculatedDrawings(Collection<EPMDocument> dwgs, Map<Object,PartDocInfo> documentInfoMap, boolean isEnterpriseDataMergeWithPart) throws WTException
      Adds the drawings in the input Collection to the input Map as appropriate.

      Supported API: true
      Specified by:
      addCalculatedDrawings in interface InfDocumentQueryDelegate
      Parameters:
      dwgs - Input Collection of calculated drawings.
      documentInfoMap - Input Map to which to add the drawings. Only those drawings for which an associated CAD model exists in the Map are added.
      isEnterpriseDataMergeWithPart - Specifies whether or not to send EnterpriseData and Part information together. It is currently not used.
      Throws:
      WTException - if any of the invoked methods throws an exception.
    • checkAndAddToCollection

      @Deprecated public static void checkAndAddToCollection(Map map, Persistable epmDoc, Collection dwgs) throws WTException
      Deprecated.
      Use checkAndAddToCollection(Map, Persistable, Collection, Boolean) instead.
      Adds the input Persistable to the input Collection after performing certain checks as appropriate.

      Supported API: true
      Parameters:
      map - Input Map whose contents are used in performing certain checks.
      epmDoc - Input Persistable to be added to the Collection. It is added provided it is an EPMDocument object, and it does not already figure in the input Map.
      dwgs - Input Collection to add the input Persistable to.
      Throws:
      WTException - if the input Persistable is not an EPMDocument object.
    • checkAndAddToCollection

      public static void checkAndAddToCollection(Map map, Persistable epmDoc, Collection dwgs, Boolean isEnterpriseDataMergeWithPart) throws WTException
      Adds the input Persistable to the input Collection after performing certain checks as appropriate.

      Supported API: true
      Parameters:
      map - Input Map whose contents are used in performing certain checks.
      epmDoc - Input Persistable to be added to the Collection. It is added provided it is an EPMDocument object, and it does not already figure in the input Map.
      dwgs - Input Collection to add the input Persistable to.
      isEnterpriseDataMergeWithPart - Is true if Part and EnterpriseData elements are to be sent separately in the ESI response; is false otherwise. Can be null. The argument is simply passed to a downstream API. A better name has to be chosen for this parameter considering that the current name is completely misleading.
      Throws:
      WTException - if the input Persistable is not an EPMDocument object.
    • getCalculatedDrawings

      public static Collection<EPMDocument> getCalculatedDrawings(RevisionControlled rcObj, Map inputMap, boolean isEnterpriseDataMergeWithPart) throws WTException
      Fetches the calculated drawings for the input RevisionControlled object, stores them in a collection and returns it to the caller.

      Supported API: true
      Parameters:
      rcObj - RevisionControlled object (such as a WTPart) for which to fetch calculated drawings.
      inputMap - Input Map of keys and values, where each key is a string holding the object ID of a given document, and each value is the corresponding PartDocInfo object. Only those drawings that do not already exist in this Map are returned.
      isEnterpriseDataMergeWithPart - Specifies whether or not to send EnterpriseData and Part information together. The argument is simply passed to a downstream API.
      Returns:
      Collection of EPMDocuments that represent calculated drawings. A calculated drawing is one that is not directly associated to a RevisionControlled object, but to a CAD model which in turn is associated to the RevisionControlled object.
      Throws:
      WTException - if any of the invoked methods throws an exception.
    • getRefDocumentLinks

      public Map<Object,PartDocInfo> getRefDocumentLinks(Set<ObjectReference> enterpriseDatas, WTPart part, boolean isEnterpriseDataMergeWithPart) throws WTException
      Returns Map of Reference Document Links associated with EnterpriseData objects.

      Supported API: true
      Specified by:
      getRefDocumentLinks in interface InfDocumentQueryDelegate
      Parameters:
      enterpriseDatas - - Set of Enterprise data objects associated with part
      part - - The part with which EnterpriseData objects are associated.
      isEnterpriseDataMergeWithPart - - Flag that indicates whether enterprise data object is rendered in separate element or merged in part eleement. When value is 'true' then enterprise data object will be rendered in separate eleemnt in part group in response file otherwise enterprise data attributes will be merged with part element.
      Returns:
      - The map of Document Links associated with EnterpriseData objects.
      Throws:
      WTException
    • getRefDocuments

      public static Map<WTDocumentMaster,WTDocument> getRefDocuments(Set<ObjectReference> enterpriseDatas, WTPart part, ConfigSpec config_spec) throws WTException
      Returns Map of Document Links associated with EnterpriseData objects with are associated with part. DocumentMaster is the key and Document iteration is value in the map.

      Supported API: true
      Parameters:
      part - - The part with which EnterpriseData objects are associated.
      enterpriseDataRef - - Set of Enterprise data object reference associated with which Referenced document objects may be associated.
      Returns:
      - The map of Documents associated with EnterpriseData objects.
      Throws:
      WTException
    • getDescribeDocumentLinks

      public Map<Object,PartDocInfo> getDescribeDocumentLinks(Set<ObjectReference> enterpriseDatas, WTPart part, boolean isEnterpriseDataMergeWithPart) throws WTException
      Returns Map of Describe Document Links associated with EnterpriseData objects.

      Supported API: true
      Specified by:
      getDescribeDocumentLinks in interface InfDocumentQueryDelegate
      Parameters:
      enterpriseDatas - - Set of Enterprise data objects associated with part
      part - - The part with which EnterpriseData objects are associated.
      isEnterpriseDataMergeWithPart - - Flag that indicates whether enterprise data object is rendered in separate element or merged in part eleement. When value is 'true' then enterprise data object will be rendered in separate eleemnt in part group in response file otherwise enterprise data attributes will be merged with part element.
      Returns:
      - Map of Document Links associated with EnterpriseData objects.
      Throws:
      WTException
    • getCADDocumentLinks

      public Map<Object,PartDocInfo> getCADDocumentLinks(Set<ObjectReference> enterpriseDatas, WTPart part, boolean isEnterpriseDataMergeWithPart) throws WTException
      Returns Map of CAD Document Links associated with EnterpriseData objects.

      Supported API: true
      Specified by:
      getCADDocumentLinks in interface InfDocumentQueryDelegate
      Parameters:
      enterpriseDatas - - Set of Enterprise data objects associated with part
      part - - The part with which EnterpriseData objects are associated.
      isEnterpriseDataMergeWithPart - - Flag that indicates whether enterprise data object is rendered in separate element or merged in part eleement. When value is 'true' then enterprise data object will be rendered in separate eleemnt in part group in response file otherwise enterprise data attributes will be merged with part element.
      Returns:
      - The map of Document Links associated with EnterpriseData objects.
      Throws:
      WTException
    • isEnterpriseDataMergeWithPart

      public boolean isEnterpriseDataMergeWithPart()
      Lets the caller know if Enterprise Data merge with Part group or not
      Returns 'true' when if Enterprise Data is not merge with part
      Supported API: true
      Specified by:
      isEnterpriseDataMergeWithPart in interface InfDocumentQueryDelegate
      Returns:
      - Returns 'true' if Enterprise Data is not merge with part *
    • setEnterpriseDataMergeWithPart

      public void setEnterpriseDataMergeWithPart(boolean isEnterpriseDataMergeWithPart)
      Sets if enterprise data object is merged with part or rendered separately. Supported API: true
      Specified by:
      setEnterpriseDataMergeWithPart in interface InfDocumentQueryDelegate
      Parameters:
      isEnterpriseDataMergeWithPart - - When value is 'true' then enterprise data object will be rendered in separate eleemnt in part group in response file otherwise enterprise data attributes will be merged with part element.
    • getTarget

      public Collection<ESITarget> getTarget()
      Returns the ESITarget object for the association

      Supported API: true
      Specified by:
      getTarget in interface InfDocumentQueryDelegate
      Returns:
      ESITarget
    • setTarget

      public void setTarget(Collection<ESITarget> tgts)
      Sets the ESITarget object for the association Supported API: true
      Specified by:
      setTarget in interface InfDocumentQueryDelegate
    • getPrimaryBusinessObject

      public Releasable getPrimaryBusinessObject()
      Gets the value of the attribute primaryBusinessObject. This is the object that was released by the user, or the Change Notice that was automatically associated to the released object when the preference "Automatically Generate Change Notice" has a value "Yes".

      Supported API: true
      Specified by:
      getPrimaryBusinessObject in interface InfDocumentQueryDelegate
      Returns:
      A Releasable object that represents the primary business object in the given release.
    • setPrimaryBusinessObject

      public void setPrimaryBusinessObject(Releasable obj)
      Sets the attribute primaryBusinessObject to the input object. Supported API: true
      Specified by:
      setPrimaryBusinessObject in interface InfDocumentQueryDelegate
      Parameters:
      obj - - Releasable object to set the attribute to.