Package wt.folder

Interface FolderService

All Known Implementing Classes:
StandardFolderService

@RemoteInterface public interface FolderService
Defines foldering related business operations.

All CabinetBased objects have a path made by constructing the path for their parent Folder with their name. All paths begin with the root character ('/') followed by a Cabinet name, followed by folder separator character ('/'), followed by the name of the Foldered object.

Supported API: true

Extendable: false

  • Method Details

    • addShortcut

      Shortcut addShortcut(Folder folder, CabinetBased target) throws WTException
      Add a shortcut to a Foldered object to the specified Folder.

      Supported API: true
      Parameters:
      folder -
      target -
      Returns:
      Shortcut
      Throws:
      WTException
    • changeFolder

      FolderEntry changeFolder(FolderEntry entry, Folder new_folder) throws WTException
      Move a FolderEntry from one folder to another. The user must have modify permission to both the source and destination folders. In addition, if the FolderEntry has inheritedDomain=true, then the user must have create permission in the domain of the destination folder. Additionally, for Iterated objects, only the latest iteration can be moved from one folder to another. If the destination folder is in a different Cabinet, has a different AdministrativeDomain, or has different Ownership than the source folder, then all historical iterations of the Iterated object being moved will have their cabinet, domain and ownership updated accordingly to match the destination folder. Note: This API should not be used when moving objects between containers; use the moveAllObjects() API from the ContainerMoveService instead.

      Supported API: true
      Parameters:
      entry -
      new_folder -
      Returns:
      FolderEntry
      Throws:
      WTException
      See Also:
    • createPersonalCabinet

      Cabinet createPersonalCabinet(WTPrincipal principal) throws WTException
      Create a cabinet in the User administrative domain for the specified Principal. The owner will be the principal. The Principal must already exist.

      Supported API: true
      Parameters:
      principal -
      Returns:
      Cabinet
      Throws:
      WTException
    • createSubFolder

      SubFolder createSubFolder(String path) throws WTException
      Create a SubFolder with the supplied path. The parent Folders must previously exist.

      Supported API: true
      Parameters:
      path -
      Returns:
      SubFolder
      Throws:
      WTException
      See Also:
    • findFolderContents

      QueryResult findFolderContents(Folder folder) throws WTException
      Returns all instances of FolderEntry in the given Folder.

      Supported API: true
      Parameters:
      folder -
      Returns:
      QueryResult
      Throws:
      WTException
      See Also:
    • findFolderContents

      @Deprecated QueryResult findFolderContents(Folder folder, Class entry_class) throws WTException
      Returns all instances of entry_class in the given Folder.

      Supported API: true
      Parameters:
      folder -
      entry_class -
      Returns:
      QueryResult
      Throws:
      WTException
      See Also:
    • findShortcuts

      QueryResult findShortcuts(CabinetBased target) throws WTException
      Return all the Shortcuts to the specified object.

      Supported API: true
      Parameters:
      target -
      Returns:
      QueryResult
      Throws:
      WTException
      See Also:
    • findSubFolders

      QueryResult findSubFolders(Folder folder) throws WTException
      finds all the SubFolders of the specified folder

      Supported API: true
      Parameters:
      folder - a Folder object
      Returns:
      QueryResult
      Throws:
      WTException - if a low level error occurs
      See Also:
    • getCabinet

      gets the Cabinet that has the specified name

      Supported API: true
      Parameters:
      name - the name of a Cabinet
      Returns:
      Cabinet
      Throws:
      FolderNotFoundException - if there is no Cabinet with the specified name
      WTException - if a low level error occurs
    • getFolder

      Folder getFolder(FolderEntry member) throws WTException
      gets the Folder that the specified member belongs to

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

      Deprecated.
      gets the Folder object that has the specified path

      Supported API: true
      Parameters:
      path - a Folder path, e.g. "/Design/Gagets"
      Returns:
      Folder
      Throws:
      FolderNotFoundException - if there is no Folder with the specified path
      WTException - if a low level error occurs
    • getFolder

      Folder getFolder(String path, WTContainerRef container) throws WTException


      Supported API: true
      Parameters:
      path -
      container -
      Returns:
      Folder
      Throws:
      WTException
      See Also:
    • getFolderEntry

      FolderEntry getFolderEntry(String path) throws WTException
      Return a FolderEntry object for the given path.

      Supported API: true
      Parameters:
      path -
      Returns:
      FolderEntry
      Throws:
      WTException
    • getPersonalCabinet

      Cabinet getPersonalCabinet(WTPrincipal principal) throws WTException, FolderNotFoundException
      Return the personal cabinet for the specified Principal. If no principal is specified, the session principal is assumed.

      Supported API: true
      Parameters:
      principal -
      Returns:
      Cabinet
      Throws:
      WTException
      FolderNotFoundException
      See Also:
      • #getUserToCabinetsMap
    • getFolder

      @Deprecated Folder getFolder(Foldered member) throws WTException
      Returns the Folder object that this object is a member of.

      Supported API: true
      Parameters:
      member -
      Returns:
      Folder
      Throws:
      WTException
    • createSubFolder

      @Deprecated SubFolder createSubFolder(String path, AdminDomainRef domainRef) throws WTException
      Create a SubFolder with the supplied path, and administered in the domain specified by domainRef. The parent Folders and the AdministrativeDomain must previously exist. The SubFolder's inheritedDomain flag will be set to false.



      Supported API: true

      Parameters:
      path -
      domainRef -
      Returns:
      SubFolder
      Throws:
      WTException
      See Also:
    • createSubFolder

      SubFolder createSubFolder(String path, AdminDomainRef domain_ref, WTContainerRef container_ref) throws WTException
      Create a SubFolder in the container specified by container_ref, with the supplied path, and administered in the domain specified by domain_ref. The parent Folders, WTContainer, and AdministrativeDomain must previously exist. The SubFolder's inheritedDomain flag will be set to false.

      Supported API: true
      Parameters:
      path -
      domain_ref -
      container_ref -
      Returns:
      SubFolder
      Throws:
      WTException
    • createPersonalCabinet

      Cabinet createPersonalCabinet(WTPrincipal principal, AdminDomainRef domain_ref) throws WTException
      Create a cabinet in the specified domain for the specified Principal. The Cabinet's name will be set to the principal's name, and the principal will be its owner. The Principal and the AdministrativeDomain must already exist.

      Supported API: true
      Parameters:
      principal -
      domain_ref -
      Returns:
      Cabinet
      Throws:
      WTException
    • findSubFolders

      @Deprecated QueryResult findSubFolders(Folder folder, AccessPermission permission) throws WTException
      finds all the SubFolders of the specified folder that the current user has the specified permission to access

      Supported API: true
      Parameters:
      folder - a Folder object
      permission - one of the permission constants defined in wt.access.AccessPermission
      Returns:
      QueryResult
      Throws:
      WTException - if a low level error occurs
      See Also:
    • findCabinets

      @Deprecated QueryResult findCabinets(AccessPermission permission, boolean shared_cabinets_only) throws WTException
      Find all Cabinets that the current user has the specified permission to access. Optionally can return only shared Cabinets, excluding personal Cabinets.

      Supported API: true
      Parameters:
      permission - one of the permission constants defined in wt.access.AccessPermission
      shared_cabinets_only - if true only shared cabinets are returned, else if false all cabinets are returned
      Returns:
      QueryResult
      Throws:
      WTException - if a low level error occurs
      See Also:
    • getFolders

      @Deprecated HashMap getFolders(List cabinetBasedObjects) throws WTException
      Returns the Folders for a set of CabinetBased objects. The objects are supplied by the caller in a java.util.List; their corresponding Folders are returned in a java.util.HashMap, keyed by the wt.fc.ObjectIdentifier's of the CabinetBased objects. The returned HashMap will contain all the Folder's which were successfully retrieved. For elements whose Folder could not be retrieved, the HashMap will contain the wt.util.WTException which resulted.

      Supported API: true
      Parameters:
      cabinetBasedObjects -
      Returns:
      HashMap
      Throws:
      WTException
    • getObjsInPersonalCabinets

      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 is a multi-object form of FolderHelper.inPersonalCabinet().

      Supported API: true

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

      WTSet changeFolder(WTValuedMap targets_to_destinations) throws WTException
      Move a set of FolderEntry objects to new folders as designated by their mappings in the WTValuedMap parameter. The user must have modify permission to the source and destination folders for each object. In addition, if any of the FolderEntrys have inheritedDomain=true, then the user must have create permission in the domain of the destination folder. Additionally, for Iterated objects, only the latest iteration can be moved from one folder to another. If the destination folder is in a different Cabinet, has a different AdministrativeDomain, or has different Ownership than the source folder, then all historical iterations of the Iterated object being moved will have their cabinet, domain and ownership updated accordingly to match the destination folder. Note: This API should not be used when moving objects between containers; use the moveAllObjects() API from the ContainerMoveService instead.

      Supported API: true
      Parameters:
      targets_to_destinations -
      Returns:
      The set of FolderEntrys that were moved to new folders.
      Throws:
      WTException
    • getContainerToCabinetsMap

      WTKeyedMap getContainerToCabinetsMap(WTCollection containers, boolean shared_only) throws WTException
      Get a mapping of the given containers to their accessible cabinets

      Supported API: true
      Parameters:
      containers - The containers to search in
      shared_only - Whether or not to limit the result to shared cabinets
      Returns:
      A map of containers to WTSets of their cabinets
      Throws:
      WTException
    • getContainerToCabinetNamesMap

      WTKeyedMap getContainerToCabinetNamesMap(WTCollection containers, boolean shared_only) throws WTException
      Get a mapping of the given containers to thei names of their accessible cabinets

      Supported API: true
      Parameters:
      containers - The containers to search in
      shared_only - Whether or not only shared cabinet names should be included
      Returns:
      A map of containers to Sets of their cabinet names
      Throws:
      WTException
    • getParentToSubFoldersMap

      WTKeyedMap getParentToSubFoldersMap(WTCollection parents) throws WTException
      Get a mapping of parent folders to WTSets of their subfolders

      Supported API: true
      Parameters:
      parents - The parent folders to search in
      Returns:
      A map of the parent folders to WTSets of their subfolders
      Throws:
      WTException
    • getCabinetBasedToFolderMap

      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.

      Supported API: true
      Parameters:
      objects - The CabinetBased objects to find folders for
      Returns:
      A mapping of the objects to their parent folders
      Throws:
      FolderNotFoundException - If the current user doesn't have the required permission to any of the resulting folders
      WTException
    • getCabinetBasedToLocationMap

      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.

      Supported API: true
      Parameters:
      objects - The CabinetBased objects to find locations for
      Returns:
      A mapping of CabinetBased objects to locations
      Throws:
      FolderNotFoundException - If the current user doesn't have read access to any of the objects'' ancestor folders
      WTException
    • getCabinetBasedToPathMap

      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

      Supported API: true
      Parameters:
      objects - The CabinetBased objects to find paths for
      Returns:
      A mapping of CabinetBased objects to paths
      Throws:
      FolderNotFoundException - If the current user doesn't have read access to any of the objects' ancestor folders
      WTException
    • getCabinetsByName

      WTList getCabinetsByName(WTList containers, List names) throws WTException
      Get the cabinets that correspond to the given name/container pairs. This API needs to be list-based since neither the names nor the containers can provide a unique key for use in a map

      Supported API: true
      Parameters:
      containers - The containers within which the corresponding name should be looked for. This may either contain one container per name or a single container that is used with all names.
      names - The cabinet names to find folders for
      Returns:
      A WTList of Cabinets corresponding to the order in the name/container list
      Throws:
      FolderNotFoundException - If any of the cabinets can't be found, or if the current user doesn't have read access to any of the cabinets
      WTException
    • getFoldersByPath

      WTList getFoldersByPath(WTList containers, List paths) throws WTException
      Get the folders that correspond to the given path/container pairs. This API needs to be list-based since neither the paths nor the containers can provide a unique key for use in a map

      Supported API: true
      Parameters:
      containers - The containers within which the corresponding path should be looked for. This may either contain one container per path or a single container that is used with all paths.
      paths - The folder paths to find folders for
      Returns:
      A WTList of Folders corresponding to the order in the path/container list
      Throws:
      FolderNotFoundException - If any of the folders can't be found, or if the current user doesn't have read access to any of the requested folders -or- to any of their parent folders
      WTException
    • getFolderToContentsMap

      WTKeyedMap getFolderToContentsMap(WTSet folders, Class entry_class, boolean include_shared) throws WTException
      Get the contents of the given set of folders.

      Supported API: true
      Parameters:
      folders - The folders to search in
      entry_class - The class of FolderEntry to look for within the given folders
      include_shared - Whether or not objects that are shared into the folders are included in the result
      Returns:
      A WTKeyedMap of parent folders to WTSets of their contents
      Throws:
      WTException
    • getFolderToContentsRefMap

      WTKeyedMap getFolderToContentsRefMap(WTSet folders, Class entry_class, boolean include_shared) throws WTException
      Get the object identifiers (oid) of contents of the given set of folders. This returns deflated collection. Caller of this API needs to inflate if needed.

      Supported API: true
      Parameters:
      folders - The folders to search in
      entry_class - The class of FolderEntry to look for within the given folders
      include_shared - Whether or not objects that are shared into the folders are included in the result
      Returns:
      A WTKeyedMap of oids parent folders to WTSets oids of their contents
      Throws:
      WTException