Class PublishUtils

java.lang.Object
com.ptc.wvs.server.util.PublishUtils

public class PublishUtils extends Object
This is Utility class containing helper methods for Publishing activity

Supported API: true

Extendable: false
  • Method Details

    • getRefFromObject

      public static String getRefFromObject(Persistable obj)
      This method returns String reference for given Persistable object
      Parameters:
      obj - - persistable object for which String Reference is needed
      Returns:
      string representing reference to input persistable object.

      Supported API: true

      Extendable: false
    • getObjectFromRef

      public static Persistable getObjectFromRef(String refString)
      This method return Persistable object for given reference String
      Parameters:
      refString - string reference to persistable object
      Returns:
      persistable object representing string referenence.

      Supported API: true

      Extendable: false
    • getDefaultRepresentations

      public static WTValuedMap getDefaultRepresentations(WTCollection collection)
      Returns default representation for given collection of Representable
      Parameters:
      collection - - collection containing Representable
      Returns:
      map containing key as Representable and value as default representation

      Supported API: true

      Extendable: false
    • getRepresentations

      public static WTKeyedMap getRepresentations(WTCollection collection)
      This method return Map of Representable key to the list of corresponding representations
      Parameters:
      collection - containing Representable
      Returns:
      map of Representable key to the list of corresponding representations

      Supported API: true

      Extendable: false
    • findRepresentable

      public static WTValuedMap findRepresentable(WTCollection collection)
      Multi-object version of the API findRepresentable(Persistable)

      For each object in the input collection,

      1. if the input object is neither an EPMDocument nor a Representable, returns null.
      2. if the input object is not an EPMDocument but is a Representable, returns the object itself.
      3. if the input object is an EPMDocument, returns the WTPart whose owner link with the EPMDocument has the smallest BuildRuleID (and the smallest creation timestamp) among all the owner links the EPMDocument has.
      4. if no part is found, and the EPMDocument is a sandbox working copy, returns the WTPart from the build rule if that WTPart is also a sandbox working copy in the same container.
      5. returns null if above steps found nothing for the EPMDocument.
      Parameters:
      collection - - the input EPMDocuments.
      Returns:
      the Representables for the specified EPMDocuments, with the keys of the returned map a subset of the input collection.

      Supported API: true

      Extendable: false
    • getRepresentationForBuildObject

      public static WTKeyedMap getRepresentationForBuildObject(WTKeyedMap partsToUsageLinks) throws WTException
      This API find the representation associated to the cad document that was built for the parts WTPartUsageLink.

      Supported API: true
      Parameters:
      partsToUsageLinks - A map of parts to a collection of WTPartUsage links. There can only be one representation returned for each part so the code will use the first usage link in the collection when finding the EPM document of interest.
      Returns:
      A map of parts to the representation associated to the cad document that was build for the parts WTPartUsageLink.
      Throws:
      WTException - An exception that may be thrown in lower level code.