Package wt.folder

Class FolderHelper

java.lang.Object
wt.folder.FolderHelper

public final class FolderHelper extends Object
This class provides access to the Windchill foldering capability. The FolderHelper contains direct static methods which provide access to information which is stored within all Foldered and CabinetResident objects. It also provides access to the remote interface of the FolderService itself.

Supported API: true

Extendable: false
See Also:
  • Field Details

    • service

      public static final FolderService service


      Supported API: true
  • Method Details

    • assignLocation

      public static void assignLocation(FolderEntry new_entry, Folder location) throws WTException
      Assign the initial location of the foldered object. This is required before a Foldered object can be stored in the database. This may not be used after the first store.

      Supported API: true
      Parameters:
      new_entry -
      location -
      Throws:
      WTException
      See Also:
    • assignLocation

      @Deprecated public static void assignLocation(FolderEntry new_entry, String location) throws WTException, FolderNotFoundException
      Deprecated.
      Assign the initial location of the foldered object. This is required before a Foldered object can be stored in the database. This may not be used after the first store. The string location supplied must be a valid folderpath. The operation will make a client-server hit to validate the location.

      Supported API: true
      Parameters:
      new_entry -
      location -
      Throws:
      WTException
      FolderNotFoundException
    • getFolderPath

      public static String getFolderPath(CabinetBased object) throws WTException
      calculates the folder path of the specified entry

      Supported API: true
      Parameters:
      object -
      Returns:
      null if the object has not been assigned to a Folder yet
      Throws:
      WTException - if a low level error occurs
      See Also:
    • getLocation

      public static String getLocation(CabinetBased object) throws WTException
      calculates the location of a CabinetBased object where location is defined as the the folder path of the Folder that the object is part of

      Supported API: true
      Parameters:
      object -
      Returns:
      null if the object has not been assigned to a Folder yet
      Throws:
      WTException - if a low level error occurs
      See Also:
    • assignLocation

      public static void assignLocation(WTCollection entries, Folder folder) throws WTException
      Assigns a collection of FolderEntry objects to a given Folder.



      Supported API: true

      Parameters:
      entries -
      folder - Folder to assign objects to
      Throws:
      WTException
      See Also:
    • assignLocations

      public static void assignLocations(WTValuedMap entry_to_folder_map) throws WTException
      Assigns each FolderEntry key in the input map to the corresponding Folder map value. This is required before a Foldered object can be stored in the database. This may not be used after the first store.

      Supported API: true
      Parameters:
      entry_to_folder_map - map from FolderEntry objects to the Folders to which they are to be assigned
      Throws:
      WTException
    • getCabinetBasedToFolderMap

      public static WTValuedMap getCabinetBasedToFolderMap(WTCollection objects) throws WTException
      Get the parent folders for the given collection of CabinetBased objects. If any of the objects are Cabinets, then they are mapped to null.

      If any of the objects are Foldered, then the implementation will first check to see if their FolderingInfos contain a cached reference to their parent folder, and use the cached instance as the return value. So in some cases this API will not require a trip to the server.

      Supported API: true

      Parameters:
      objects - The CabinetBased objects to find folders for
      Returns:
      A mapping of the objects to their parent folders
      Throws:
      FolderNotFoundException
      WTException
    • getCabinetBasedToLocationMap

      public static WTKeyedMap getCabinetBasedToLocationMap(WTCollection objects) throws WTException
      Get the locations for the given CabinetBased objects. The current user must have read access to all of their ancestor folders.

      If any of the objects are Foldered, then the implementation will first check to see if their FolderingInfos contain a cached location, and use the cached location as the return value. So in some cases this API will not require a trip to the server.

      Supported API: true

      Parameters:
      objects - The CabinetBased objects to find locations for
      Returns:
      A mapping of CabinetBased objects to locations
      Throws:
      FolderNotFoundException
      WTException
    • getCabinetBasedToPathMap

      public static WTKeyedMap getCabinetBasedToPathMap(WTCollection objects) throws WTException
      Get the paths for the given CabinetBased objects. The path includes the folder location of the object along with its own name

      If any of the objects are Foldered, then the implementation will first check to see if their FolderingInfos contain a cached reference to their path, and use the cached path as the return value. So in some cases this API will not require a trip to the server.

      Supported API: true

      Parameters:
      objects - The CabinetBased objects to find paths for
      Returns:
      A mapping of CabinetBased objects to paths
      Throws:
      FolderNotFoundException
      WTException
    • getCabinetBasedToPathMapSecure

      public static WTKeyedMap getCabinetBasedToPathMapSecure(WTCollection objects) throws WTException
      Get the paths for the given CabinetBased objects. The path includes the folder location of the object along with its own name. If the current user does not have Read access permission for the object or any folder in the folder path, no entry is returned in the map for that object.

      If any of the objects are Foldered, then the implementation will first check to see if their FolderingInfos contain a cached reference to their path, and use the cached path as the return value. So in some cases this API will not require a trip to the server.

      Supported API: true

      Parameters:
      objects - The CabinetBased objects to find paths for
      Returns:
      A mapping of CabinetBased objects to paths
      Throws:
      FolderNotFoundException
      WTException
    • getCabinetBasedToCabinetMap

      public static WTValuedMap getCabinetBasedToCabinetMap(WTCollection objects) throws WTException
      Get the cabinets for the given set of CabinetBased objects. Cabinets are mapped to a reference to themselves.

      This implementation will not inflate the resutling CabinetRefernece objects. To ensure the references are inflated, use FolderService.getCabinetBasedToCabinetMap(wt.fc.collections.WTCollection)

      Supported API: true

      Parameters:
      objects -
      Returns:
      A mapping of the CabinetBased objects to their cabinets
      Throws:
      WTException
    • getObjsInPersonalCabinets

      public static WTSet getObjsInPersonalCabinets(WTCollection objsToCheck) throws WTException
      Given an input WTCollection of CabinetBased objects, this routine returns the subset which reside in personal cabinets. Note that if non-CabinetBased objects are included in the input collection they are simply automatically excluded from the output collection as they have no associated Cabinet.

      This implementation will minimize client-server traffic by checking for inflated cabinet references on the input collection, and using the cached information if available.

      This is a multi-object form of inPersonalCabinet(CabinetBased).

      Supported API: true

      Parameters:
      objsToCheck - objects to determine which reside in a personal cabinet
      Returns:
      WTSet
      Throws:
      WTException
      See Also: