Package wt.folder
Interface FolderService
- All Known Implementing Classes:
StandardFolderService
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
Modifier and TypeMethodDescriptionaddShortcut(Folder folder, CabinetBased target) Add a shortcut to aFolderedobject to the specifiedFolder.changeFolder(WTValuedMap targets_to_destinations) Move a set of FolderEntry objects to new folders as designated by their mappings in the WTValuedMap parameter.changeFolder(FolderEntry entry, Folder new_folder) Move a FolderEntry from one folder to another.createPersonalCabinet(WTPrincipal principal) Create a cabinet in the User administrative domain for the specified Principal.createPersonalCabinet(WTPrincipal principal, AdminDomainRef domain_ref) Create a cabinet in the specified domain for the specified Principal.createSubFolder(String path) Create a SubFolder with the supplied path.createSubFolder(String path, AdminDomainRef domainRef) Deprecated.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.findCabinets(AccessPermission permission, boolean shared_cabinets_only) Deprecated.Replaced bygetContainerToCabinetsMap(WTCollection,boolean)findFolderContents(Folder folder) Returns all instances ofFolderEntryin the givenFolder.findFolderContents(Folder folder, Class entry_class) Deprecated.Replaced bygetFolderToContentsMap(WTSet,Class,boolean)findShortcuts(CabinetBased target) Return all theShortcuts to the specified object.findSubFolders(Folder folder) finds all theSubFoldersof the specifiedfolder
Supported API: truefindSubFolders(Folder folder, AccessPermission permission) Deprecated.Replaced bygetParentToSubFoldersMap(WTCollection)getCabinet(String name) Deprecated.Replaced bygetCabinetsByName(WTList containers,List names)getCabinetBasedToFolderMap(WTCollection objects) Get the parent folders for the given collection of CabinetBased objects.getCabinetBasedToLocationMap(WTCollection objects) Get the locations for the given CabinetBased objects.getCabinetBasedToPathMap(WTCollection objects) Get the paths for the given CabinetBased objects.getCabinetsByName(WTList containers, List names) Get the cabinets that correspond to the given name/container pairs.getContainerToCabinetNamesMap(WTCollection containers, boolean shared_only) Get a mapping of the given containers to thei names of their accessible cabinets
Supported API: truegetContainerToCabinetsMap(WTCollection containers, boolean shared_only) Get a mapping of the given containers to their accessible cabinets
Supported API: trueDeprecated.Replaced bygetFoldersByPath(WTList, List)getFolder(String path, WTContainerRef container)
Supported API: trueDeprecated.Replaced bygetCabinetBasedToFolderMap(WTCollection)getFolder(FolderEntry member) gets theFolderthat the specifiedmemberbelongs to
Supported API: truegetFolderEntry(String path) Return a FolderEntry object for the given path.getFolders(List cabinetBasedObjects) Deprecated.Replaced bygetCabinetBasedToFolderMap(WTCollection)getFoldersByPath(WTList containers, List paths) Get the folders that correspond to the given path/container pairs.getFolderToContentsMap(WTSet folders, Class entry_class, boolean include_shared) Get the contents of the given set of folders.getFolderToContentsRefMap(WTSet folders, Class entry_class, boolean include_shared) Get the object identifiers (oid) of contents of the given set of folders.getObjsInPersonalCabinets(WTCollection objsToCheck) Given an input WTCollection of CabinetBased objects, this routine returns the subset which reside in personal cabinets.getParentToSubFoldersMap(WTCollection parents) Get a mapping of parent folders to WTSets of their subfolders
Supported API: truegetPersonalCabinet(WTPrincipal principal) Return the personal cabinet for the specified Principal.
-
Method Details
-
addShortcut
Add a shortcut to aFolderedobject to the specifiedFolder.
Supported API: true- Parameters:
folder-target-- Returns:
- Shortcut
- Throws:
WTException
-
changeFolder
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 hasinheritedDomain=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
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
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
Returns all instances ofFolderEntryin the givenFolder.
Supported API: true- Parameters:
folder-- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
findFolderContents
Deprecated.Replaced bygetFolderToContentsMap(WTSet,Class,boolean)Returns all instances ofentry_classin the givenFolder.
Supported API: true- Parameters:
folder-entry_class-- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
findShortcuts
Return all theShortcuts to the specified object.
Supported API: true- Parameters:
target-- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
findSubFolders
finds all theSubFoldersof the specifiedfolder
Supported API: true- Parameters:
folder- aFolderobject- Returns:
- QueryResult
- Throws:
WTException- if a low level error occurs- See Also:
-
getCabinet
Deprecated.Replaced bygetCabinetsByName(WTList containers,List names)gets theCabinetthat has the specified name
Supported API: true- Parameters:
name- the name of aCabinet- Returns:
- Cabinet
- Throws:
FolderNotFoundException- if there is noCabinetwith the specified nameWTException- if a low level error occurs
-
getFolder
gets theFolderthat the specifiedmemberbelongs to
Supported API: true- Parameters:
member-- Returns:
nullif thememberhas not been assigned to aFolderyet- Throws:
WTException- if a low level error occurs- See Also:
-
getFolder
Deprecated.Replaced bygetFoldersByPath(WTList, List)gets theFolderobject that has the specifiedpath
Supported API: true- Parameters:
path- aFolderpath, e.g. "/Design/Gagets"- Returns:
- Folder
- Throws:
FolderNotFoundException- if there is noFolderwith the specified pathWTException- if a low level error occurs
-
getFolder
Supported API: true- Parameters:
path-container-- Returns:
- Folder
- Throws:
WTException- See Also:
-
getFolderEntry
Return a FolderEntry object for the given path.
Supported API: true- Parameters:
path-- Returns:
- FolderEntry
- Throws:
WTException
-
getPersonalCabinet
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:
WTExceptionFolderNotFoundException- See Also:
-
#getUserToCabinetsMap
-
getFolder
Deprecated.Replaced bygetCabinetBasedToFolderMap(WTCollection)Returns the Folder object that this object is a member of.
Supported API: true- Parameters:
member-- Returns:
- Folder
- Throws:
WTException
-
createSubFolder
Deprecated.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
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 Deprecated.Replaced bygetParentToSubFoldersMap(WTCollection)finds all theSubFoldersof the specifiedfolderthat the current user has the specifiedpermissionto access
Supported API: true- Parameters:
folder- aFolderobjectpermission- 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 Deprecated.Replaced bygetContainerToCabinetsMap(WTCollection,boolean)Find allCabinetsthat the current user has the specifiedpermissionto access. Optionally can return only sharedCabinets, excluding personalCabinets.
Supported API: true- Parameters:
permission- one of the permission constants defined in wt.access.AccessPermissionshared_cabinets_only- iftrueonly shared cabinets are returned, else iffalseall cabinets are returned- Returns:
- QueryResult
- Throws:
WTException- if a low level error occurs- See Also:
-
getFolders
Deprecated.Replaced bygetCabinetBasedToFolderMap(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
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
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 haveinheritedDomain=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 inshared_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 inshared_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
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
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 foldersWTException
-
getCabinetBasedToLocationMap
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 foldersWTException
-
getCabinetBasedToPathMap
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 foldersWTException
-
getCabinetsByName
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 cabinetsWTException
-
getFoldersByPath
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 foldersWTException
-
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 inentry_class- The class of FolderEntry to look for within the given foldersinclude_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 inentry_class- The class of FolderEntry to look for within the given foldersinclude_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
-
createSubFolder(String,AdminDomainRef,WTContainerRef)