wt.folder
Interface FolderService


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 Summary
 Shortcut addShortcut(Folder folder, CabinetBased target)
          Add a shortcut to a Foldered object to the specified Folder.
 FolderEntry changeFolder(FolderEntry entry, Folder new_folder)
          Move a FolderEntry from one folder to another.
 WTSet changeFolder(WTValuedMap targets_to_destinations)
          Move a set of FolderEntry objects to new folders as designated by their mappings in the WTValuedMap parameter.
 Cabinet createPersonalCabinet(WTPrincipal principal)
          Create a cabinet in the User administrative domain for the specified Principal.
 Cabinet createPersonalCabinet(WTPrincipal principal, AdminDomainRef domain_ref)
          Create a cabinet in the specified domain for the specified Principal.
 SubFolder createSubFolder(String path)
          Create a SubFolder with the supplied path.
 SubFolder createSubFolder(String path, AdminDomainRef domainRef)
          Deprecated. Replaced by createSubFolder(String,AdminDomainRef,WTContainerRef)
 SubFolder createSubFolder(String path, AdminDomainRef domain_ref, WTContainerRef container_ref)
          Create a SubFolder in the container specified by container_ref, with the supplied path, and administered in the domain specified by domain_ref.
 QueryResult findCabinets(AccessPermission permission, boolean shared_cabinets_only)
          Deprecated. Replaced by #getContainerToCabinetsMap(WTCollection)
 QueryResult findFolderContents(Folder folder)
          Returns all instances of FolderEntry in the given Folder.
 QueryResult findFolderContents(Folder folder, Class entry_class)
          Deprecated. Replaced by #getFolderToContentsMap(WTSet,Class)
 QueryResult findShortcuts(CabinetBased target)
          Return all the Shortcuts to the specified object.
 QueryResult findSubFolders(Folder folder)
          finds all the SubFolders of the specified folder

Supported API: true
 QueryResult findSubFolders(Folder folder, AccessPermission permission)
          Deprecated. Replaced by getParentToSubFoldersMap(WTCollection)
 QueryResult findSubFolders(String folder, AccessPermission permission)
          Deprecated. replaced by getParentToSubFoldersMap(WTCollection)
 Cabinet getCabinet(String name)
          Deprecated. Replaced by #getCabinetsByName(WTCollection containers)
 Vector getCabinetNames()
          Deprecated. Replaced by #getContainerToCabinetNamesMap(WTCollection)
 Folder getFolder(Foldered member)
          Deprecated. Replaced by getCabinetBasedToFolderMap(WTCollection)
 Folder getFolder(FolderEntry member)
          gets the Folder that the specified member belongs to

Supported API: true
 Folder getFolder(String path)
          Deprecated. Replaced by getFoldersByPath(WTList, List)
 Folder getFolder(String path, WTContainerRef container)
          

Supported API: true
 FolderEntry getFolderEntry(String path)
          Return a FolderEntry object for the given path.
 Object[] getFolderPaths(CabinetBased[] objects)
          Deprecated. Replaced by getCabinetBasedToPathMap(WTCollection)
 HashMap getFolders(List cabinetBasedObjects)
          Deprecated. Replaced by getCabinetBasedToFolderMap(WTCollection)
 HashMap getFoldersByPath(List folderPaths)
          Deprecated. Replaced by getFoldersByPath(WTList, List)
 Object[] getLocations(CabinetBased[] objects)
          Deprecated. Replaced by getCabinetBasedToLocationMap(WTCollection)
 WTSet getObjsInPersonalCabinets(WTCollection objsToCheck)
          Given an input WTCollection of CabinetBased objects, this routine returns the subset which reside in personal cabinets.
 Cabinet getPersonalCabinet(WTPrincipal principal)
          Return the personal cabinet for the specified Principal.
 

Method Detail

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.

Supported API: true

Parameters:
entry -
new_folder -
Returns:
FolderEntry
Throws:
WTException
See Also:
changeFolder(WTValuedMap)

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:
SubFolder

getCabinetNames

Vector getCabinetNames()
                       throws WTException
Deprecated. Replaced by #getContainerToCabinetNamesMap(WTCollection)

gets the names of all Cabinets in the system to which the current user has read access

Supported API: true

Returns:
Vector a Vector of Cabinet names (Strings)
Throws:
WTException - if a low level error occurs

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:
getFolderToContentsMap(wt.fc.collections.WTSet, java.lang.Class, boolean)

findFolderContents

QueryResult findFolderContents(Folder folder,
                               Class entry_class)
                               throws WTException
Deprecated. Replaced by #getFolderToContentsMap(WTSet,Class)

Returns all instances of entry_class in the given Folder.

Supported API: true

Parameters:
folder -
entry_class -
Returns:
QueryResult
Throws:
WTException
See Also:
findFolderContents(Folder[],Class)

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:
Shortcut

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:
SubFolder, getParentToSubFoldersMap(wt.fc.collections.WTCollection)

getCabinet

Cabinet getCabinet(String name)
                   throws WTException,
                          FolderNotFoundException
Deprecated. Replaced by #getCabinetsByName(WTCollection containers)

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:
getCabinetBasedToFolderMap(wt.fc.collections.WTCollection)

getFolder

Folder getFolder(String path)
                 throws WTException,
                        FolderNotFoundException
Deprecated. Replaced by getFoldersByPath(WTList, List)

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:
getFoldersByPath(java.util.List)

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

Folder getFolder(Foldered member)
                 throws WTException
Deprecated. Replaced by getCabinetBasedToFolderMap(WTCollection)

Returns the Folder object that this object is a member of.

Supported API: true

Parameters:
member -
Returns:
Folder
Throws:
WTException

createSubFolder

SubFolder createSubFolder(String path,
                          AdminDomainRef domainRef)
                          throws WTException
Deprecated. Replaced by createSubFolder(String,AdminDomainRef,WTContainerRef)

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:
SubFolder

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

QueryResult findSubFolders(Folder folder,
                           AccessPermission permission)
                           throws WTException
Deprecated. Replaced by getParentToSubFoldersMap(WTCollection)

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:
SubFolder, AccessPermission

findSubFolders

QueryResult findSubFolders(String folder,
                           AccessPermission permission)
                           throws WTException,
                                  FolderNotFoundException
Deprecated. replaced by getParentToSubFoldersMap(WTCollection)

finds all the SubFolders of the folder, specified as a path, that the current user has the specified permission to access

Supported API: true

Parameters:
folder - a Folder path, e.g. "/Design/Gagets"
permission - one of the permission constants defined in wt.access.AccessPermission
Returns:
QueryResult
Throws:
FolderNotFoundException - if the specified folder doesn't exist
WTException - if a low level error occurs
See Also:
SubFolder, AccessPermission

findCabinets

QueryResult findCabinets(AccessPermission permission,
                         boolean shared_cabinets_only)
                         throws WTException
Deprecated. Replaced by #getContainerToCabinetsMap(WTCollection)

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:
Cabinet, AccessPermission

getFolderPaths

Object[] getFolderPaths(CabinetBased[] objects)
                        throws WTException
Deprecated. Replaced by getCabinetBasedToPathMap(WTCollection)

This function returns the folder paths corresponding to an array of CabinetBased objects. The paths are returned as String's. In cases where the path cannot be determined (typically because the caller has no read permission for the folder or because it hasn't been set), an object of class Exception will be returned in the corresponding position of the array.

Supported API: true

Parameters:
objects -
Returns:
Object[]
Throws:
WTException

getLocations

Object[] getLocations(CabinetBased[] objects)
                      throws WTException
Deprecated. Replaced by getCabinetBasedToLocationMap(WTCollection)

This function returns the folder locations corresponding to an array of CabinetBased objects. The locations are returned as String's. In cases where the location cannot be determined (typically because the caller has no read permission for the folder or because it hasn't been set), an object of class Exception will be returned in the corresponding position of the array. Implementation details: A local function, getMemberships(), is first called to retrieve all the object's FolderMembership's (if any). The associated Folders (if any) are attached to the FolderMembership's by this function, retrieving them from the Folder Cache wherever possible.

Supported API: true

Parameters:
objects -
Returns:
Object[]
Throws:
WTException

getFoldersByPath

HashMap getFoldersByPath(List folderPaths)
                         throws WTException
Deprecated. Replaced by getFoldersByPath(WTList, List)

Returns the Folders specified by a List of folder path String's; the Folders are returned in a java.util.HashMap, keyed by the path String's. 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:
folderPaths -
Returns:
HashMap
Throws:
WTException

getFolders

HashMap getFolders(List cabinetBasedObjects)
                   throws WTException
Deprecated. Replaced by getCabinetBasedToFolderMap(WTCollection)

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.

Supported API: true

Parameters:
targets_to_destinations -
Returns:
The set of FolderEntrys that were moved to new folders.
Throws:
WTException