|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.folder.FolderLogic
Server-only utility class with multi-object implementations
of the core folder operations. Access controls are applied
to the results of these methods unless otherwise documented.
Supported API: false
Extendable: false
Nested Class Summary | |
private static class |
FolderLogic.FolderChange
Utility class used to manage the folder change operation |
private static class |
FolderLogic.FolderPropertyApplier
Utilty class used by both changeFolder and prepareForCheckin to update the membership and related cookies of a collection of entries |
private static class |
FolderLogic.PathData
Utility class used by getFoldersByPath |
Field Summary | |
private static String |
BRANCH_ID
|
private static String |
CABINET_ID
|
private static String |
CLASSNAME
|
private static boolean |
DEBUG
|
private static String |
DOMAIN_ID
|
private static boolean |
FEEDBACK
|
private static String |
FOLDER_SEPARATOR_STRING
|
private static Map |
ITERATED_FOLDER_ENTRY_CACHE
|
private static RefreshSpec |
LINK_ONLY_NO_ACCESS
|
private static RefreshSpec |
LOCK_NO_ACCESS
|
private static DebugWriter |
LOG
|
private static String |
RESOURCE
|
private static String |
SHARED_OBJECT
|
private static String |
SHARED_VERSION
|
private static String |
TARGET_CONTAINER
|
private static String |
TARGET_FOLDER_CLASSNAME
|
private static String |
TARGET_FOLDER_ID
|
Constructor Summary | |
(package private) |
FolderLogic()
|
Method Summary | |
(package private) static WTSet |
changeFolders(WTValuedMap targets_to_destinations,
StandardFolderService service)
Change the folder of the given set of target entries to map to the corresponding new destinations |
(package private) static WTValuedMap |
createMemberships(WTValuedMap entries_to_destinations)
Store membership links for the given entry-to-folder mappings |
(package private) static WTValuedMap |
getCabinetBasedToCabinetMap(WTCollection objects)
Get the cabinets for the given set of CabinetBased objects. |
(package private) static WTValuedMap |
getCabinetBasedToFolderMap(WTCollection objects,
AccessPermission permission)
Get the parent folders for the given collection of CabinetBased objects |
private static WTValuedMap |
getCabinetBasedToFolderMap(WTCollection objects,
AccessPermission permission,
WTValuedMap memberships)
Same as getCabinetBasedToFolderMap(WTCollection,AccessPermission) , except that it uses
the given mapping of FolderEntry objects to their corresponding memberships, as opposed to querying for them. |
(package private) static WTKeyedMap |
getCabinetBasedToLocationMap(WTCollection objects)
Get the locations for the given CabinetBased objects. |
(package private) static WTKeyedMap |
getCabinetBasedToPathMap(WTCollection objects)
Get the paths for the given CabinetBased objects. |
(package private) static WTList |
getCabinetsByName(WTList containers,
List names,
boolean read_only,
AccessPermission permission)
Get the cabinets that correspond to the given name/container pairs. |
(package private) static WTKeyedMap |
getContainerToCabinetNamesMap(WTCollection containers,
boolean shared_only)
Get a mapping of the given containers to the names of their cabinets that the current user has read access to |
(package private) static WTKeyedMap |
getContainerToCabinetsMap(WTCollection containers,
boolean shared_only,
boolean read_only,
AccessPermission permission)
Get a mapping of the given containers to their cabinets |
(package private) static WTValuedMap |
getContentsToMembershipsMap(WTSet folders,
Class entry_class,
boolean include_shares,
AccessPermission permission)
Get the contents of the given set of folders. |
(package private) static WTValuedMap |
getEntryToMembershipMap(WTCollection entries,
boolean inflate_folders,
AccessPermission permission)
Get the FolderMemberships for the given entries. |
(package private) static WTKeyedMap |
getEntryToMembershipMap(WTCollection entries,
boolean inflate_folders,
AccessPermission permission,
boolean throw_exceptions)
Gets the FolderMemberships for the given entries. |
(package private) static WTList |
getFoldersByPath(WTList containers,
List paths,
boolean read_only,
AccessPermission permission)
Get the folders that correspond to the given path/container pairs. |
(package private) static WTKeyedMap |
getFolderToContentsMap(WTSet folders,
AccessPermission permission)
Get the contents of the given set of folders. |
(package private) static WTKeyedMap |
getFolderToContentsMap(WTSet folders,
Class entry_class,
boolean include_shares,
AccessPermission permission)
Get the contents of the given set of folders. |
private static List |
getIteratedFolderEntries(Class entry_class)
Gets the subclasses of the givne entry class that are iterated, and caches the result |
(package private) static WTKeyedMap |
getParentToSubFoldersMap(WTCollection parents,
boolean read_only,
AccessPermission permission)
Get a mapping of the parent folders to their accessible subfolders |
private static StatementSpec |
getStatementForContents(long[] folder_ids,
List excludes,
Class entry_class,
boolean select_links,
boolean include_shares)
Private utility method that creates the spec used in getFolderContents |
(package private) static WTValuedMap |
getSubFolderToParentMap(WTCollection subfolders,
boolean read_only,
AccessPermission permission)
Get the parent folders for the given collection of SubFolders |
(package private) static void |
prepareForCheckin(WTValuedMap checkedout_to_working_copies)
Cleans up the folder membership for working copies that will not asusme the folder membership of their corresponding checked out copy. |
(package private) static void |
validate(WTCollection collection,
AccessPermission permission)
Validates that the user has the permission to the collection, if the permission is non-null |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static final boolean DEBUG
private static final DebugWriter LOG
private static final String FOLDER_SEPARATOR_STRING
private static final String TARGET_CONTAINER
private static final String TARGET_FOLDER_ID
private static final String TARGET_FOLDER_CLASSNAME
private static final String SHARED_OBJECT
private static final String SHARED_VERSION
private static final String BRANCH_ID
private static final String CABINET_ID
private static final String DOMAIN_ID
private static final Map ITERATED_FOLDER_ENTRY_CACHE
private static final RefreshSpec LOCK_NO_ACCESS
private static final RefreshSpec LINK_ONLY_NO_ACCESS
private static final boolean FEEDBACK
Constructor Detail |
FolderLogic()
Method Detail |
static WTValuedMap createMemberships(WTValuedMap entries_to_destinations) throws WTException
WTException
static WTSet changeFolders(WTValuedMap targets_to_destinations, StandardFolderService service) throws WTException
targets_to_destinations
- A mapping of FolderEntry to destination Foldersservice
- A reference to the folder service
WTException
static final void prepareForCheckin(WTValuedMap checkedout_to_working_copies) throws WTException
checkedout_to_working_copies
- A mapping of checked out to working copies
WTException
static WTKeyedMap getContainerToCabinetsMap(WTCollection containers, boolean shared_only, boolean read_only, AccessPermission permission) throws WTException
containers
- The containers to search inshared_only
- Whether or not to limit the result to shared cabinetsread_only
- Whether or not to return cached instances of the cabinetspermission
- The permission to filter the resulting cabinets by. If the permission
is null, then no access control is applied to the cabinets
WTException
static WTKeyedMap getContainerToCabinetNamesMap(WTCollection containers, boolean shared_only) throws WTException
containers
- The containers to search inshared_only
- Whether or not to limit the result to shared cabinets
WTException
static WTKeyedMap getParentToSubFoldersMap(WTCollection parents, boolean read_only, AccessPermission permission) throws WTException
parents
- The parent folders to search inread_only
- Whether or not to return cached instances of the subfolderspermission
- The permission to filter the resulting subfolders by. If the permission
is null, then no access control is applied to the subfolders
WTException
static WTValuedMap getCabinetBasedToCabinetMap(WTCollection objects) throws WTException
WTException
- If the user doesn't have access to any of the objects' cabinetsstatic WTValuedMap getSubFolderToParentMap(WTCollection subfolders, boolean read_only, AccessPermission permission) throws WTException
read_only
- Whether or not to return cached instances of the parent Folderspermission
- The permission that the current user must have
to the resulting Folders. If this is null,
then no access control checking is done on
the folders
FolderNotFoundException
- If the current user doesn't have the specified permission to any
of the resulting folders
WTException
static final WTValuedMap getCabinetBasedToFolderMap(WTCollection objects, AccessPermission permission) throws WTException
objects
- A collection of CabinetBased objectspermission
- The permission that the current user must have
to the resulting Folders. If this is null,
then no access control checking is done on
the folders
FolderNotFoundException
- If the current user doesn't have the required permission to any
of the resulting folders
WTException
private static final WTValuedMap getCabinetBasedToFolderMap(WTCollection objects, AccessPermission permission, WTValuedMap memberships) throws WTException
getCabinetBasedToFolderMap(WTCollection,AccessPermission)
, except that it uses
the given mapping of FolderEntry objects to their corresponding memberships, as opposed to querying for them.
The implementation will inflate the membership's folder roles
objects
- The objects to get folders forpermission
- The permission that the user must have on the resulting folders, or nullmemberships
- A set of pre-queried entry-to-membership mappings. May be null, in which case
the links are queried for.
WTException
static WTValuedMap getEntryToMembershipMap(WTCollection entries, boolean inflate_folders, AccessPermission permission) throws WTException
entries
- inflate_folders
- When true, the folder references on the returned
membership links are inflated.permission
- When inflate_folders is true, the current user
must have this permission to the resulting
memberships' inflated folders. If null, then the
results are not filtered by access control
FolderNotFoundException
- If the user does not have the specified permission
to any of the resulting memberships' inflated folders
WTException
static WTKeyedMap getEntryToMembershipMap(WTCollection entries, boolean inflate_folders, AccessPermission permission, boolean throw_exceptions) throws WTException
entries
- inflate_folders
- When true, the folder references on the returned
membership links are inflated.permission
- When inflate_folders is true, the current user
must have this permission to the resulting
memberships' inflated folders. If null, then the
results are not filtered by access controlthrow_exceptions
- When false, the resulting map may contain exceptions
as values instead of FolderMemberships
FolderNotFoundException
- If the user does not have the specified permission
to any of the resulting memberships' inflated folders
WTException
static final WTKeyedMap getCabinetBasedToLocationMap(WTCollection objects) throws WTException
objects
- The CabinetBased objects to find locations for
FolderNotFoundException
- If the current user doesn't have read access to any of the objects'
ancestor folders
WTException
static final WTKeyedMap getCabinetBasedToPathMap(WTCollection objects) throws WTException
FolderNotFoundException
- If the current user doesn't have read access to any of the objects'
ancestor folders
WTException
static WTList getCabinetsByName(WTList containers, List names, boolean read_only, AccessPermission permission) throws WTException
containers
- The containers within which the corresponding
name should be looked for. This may either have
as many elements as names
, or
have a single element used with each namenames
- The cabinet names to find folders forread_only
- Whether or not to return cached instances of the Cabinetspermission
- If non-null, the user must have the given permission
to the resulting cabinets
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
static WTList getFoldersByPath(WTList containers, List paths, boolean read_only, AccessPermission permission) throws WTException
containers
- The containers within which the corresponding
path should be looked for. This may either have
as many elements as paths
, or
have a single element used with each namepaths
- The folder paths to find folders forread_only
- Whether or not to return cached instances of the folderspermission
- If non-null, the user must have the given permission
to the resulting subfolders
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
static WTKeyedMap getFolderToContentsMap(WTSet folders, AccessPermission permission) throws WTException
folders
- The folders to search inpermission
- The permission to filter the contents by. If this is null, then
the results are not filtered by access control
WTException
static WTKeyedMap getFolderToContentsMap(WTSet folders, Class entry_class, boolean include_shares, AccessPermission permission) throws WTException
folders
- The folders to search inentry_class
- The class of FolderEntry to look forinclude_shares
- Whether or not to include entries shared into the folderpermission
- The permission to filter the contents by. If this is null, then
the results are not filtered by access control
WTException
static WTValuedMap getContentsToMembershipsMap(WTSet folders, Class entry_class, boolean include_shares, AccessPermission permission) throws WTException
folders
- The folders to search inentry_class
- The class of FolderEntry to look forinclude_shares
- Whether or not to include objects that are shared into the folderspermission
- The permission to filter the contents by. If this is null, then
the results are not filtered by access control
WTException
private static final StatementSpec getStatementForContents(long[] folder_ids, List excludes, Class entry_class, boolean select_links, boolean include_shares) throws WTException
folder_ids
- The folder oids to look forexcludes
- The List of folder classes that do not need to be queried onentry_class
- The class of FolderEntry to look forinclude_shares
- Whether or not to include entries shared into the folder
WTException
private static final List getIteratedFolderEntries(Class entry_class) throws WTException
entry_class
-
WTException
static void validate(WTCollection collection, AccessPermission permission) throws WTException
collection
- permission
- May be null
FolderNotFoundException
- If the permission check fails
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |