public interface FolderDAO extends PersistentObjectDAO<Folder>
Modifier and Type | Method and Description |
---|---|
boolean |
applyMetadataToTree(long id,
FolderHistory transaction)
Propagates the template metadata a node to the whole subree
|
boolean |
applyRithtToTree(long rootId,
FolderHistory transaction)
Propagates the security policies of a node to the whole subree
|
String |
computePathExtended(long id)
Dynamically computes the path extended for the specified folder.
|
int |
count(boolean computeDeleted)
Counts the number of folders
|
Folder |
create(Folder parent,
Folder folderVO,
boolean inheritSecurity,
FolderHistory transaction)
Creates a new folder in the parent Folder
|
Folder |
createPath(Folder parent,
String path,
boolean inheritSecurity,
FolderHistory transaction)
Creates the folder for the specified path.
|
boolean |
delete(long id,
FolderHistory transaction)
This method deletes the folder object and insert a new folder history
entry.
|
void |
deleteAll(List<Folder> folders,
FolderHistory transaction)
For each folder, save the folder delete history entry for each folder and
delete the folder
|
List<Folder> |
deleteTree(Folder folder,
FolderHistory transaction)
Delete a folder and all its sub-folders that a user can delete.
|
List<Folder> |
deleteTree(long folderId,
FolderHistory transaction)
Delete a folder and all its sub-folders that a user can delete.
|
List<Folder> |
find(String name)
Useful method that allows to find all folders that contains the given
name into their text.
|
List<Folder> |
findByGroupId(long groupId)
Finds all folders accessible by the passed group
|
List<Folder> |
findByName(Folder parent,
String name,
boolean caseSensitive)
Finds all folders by folder text, contained in the parent folder.
|
List<Folder> |
findByName(String name)
Finds all folders by folder name
|
List<Folder> |
findByNameAndParentId(String text,
long parentId)
Finds that folder that lies under a specific parent (given by the id) an
with a given name(like operator is used)
|
List<Folder> |
findByParentId(long parentId)
Finds all children(direct and indirect) by parentId
|
Folder |
findByPath(String pathExtended)
Retrieval of a folder by the extended path
|
List<Folder> |
findByUserId(long userId)
Finds authorized folders for a user
|
List<Folder> |
findByUserId(long userId,
long parentId)
Finds direct children of a folder.
|
List<Folder> |
findChildren(long parentId,
Integer max)
Finds direct children of a folder
|
List<Folder> |
findChildren(long parentId,
long userId)
Finds direct children of a folder accessible by the given user
|
List<Folder> |
findDeleted(long userId,
Integer maxHits)
Finds all deleted folders of a specific user.
|
Collection<Long> |
findFolderIdByUserId(long userId,
Long parentId,
boolean tree)
This method selects only the folder ID from the folders for which a user
is authorized.
|
Collection<Long> |
findFolderIdByUserIdAndPermission(long userId,
Permission permission,
Long parentId,
boolean tree)
Finds all folders ids with a specific permission enabled on the specifies
user
|
Collection<Long> |
findFolderIdInTree(long rootId,
boolean includeDeleted)
Retrieve all the ids of the folder in a given tree
|
List<Long> |
findIdByUserId(long userId,
long parentId)
This method selects only the folder ID from the folders for which a user
is authorized.
|
List<Folder> |
findParents(long id)
Returns a List of folders being a parent of the given folder.
|
List<Folder> |
findWorkspaces()
Retrieves all the workspaces in the system, that are the first-level
folders of type 1.
|
Set<Permission> |
getEnabledPermissions(long id,
long userId)
Finds all permissions of a user enabled on the specified folder
|
boolean |
hasWriteAccess(Folder folder,
long userId)
Checks that the user has access to the folder and all its sub-items
|
void |
initialize(Folder folder)
Initializes lazy loaded collections
|
boolean |
isInPath(long folderId,
long targetId)
Checks if a folder with the given folderId is parent of the folder with
the given targetId
|
boolean |
isPermissionEnabled(Permission permission,
long id,
long userId)
This method checks if the given permission is enabled for a folder and an
user.
|
boolean |
isReadEnable(long id,
long userId) |
boolean |
isWriteEnable(long id,
long userId)
This method is looking up for writing rights for a folder and an user.
|
void |
move(Folder source,
Folder target,
FolderHistory transaction)
Move a folder into another folder
|
void |
restore(long folderId,
long parentId,
FolderHistory transaction)
Restores a previously deleted folder
|
void |
setUniqueName(Folder folder) |
boolean |
store(Folder folder,
FolderHistory transaction)
Same as store(Folder, boolean, FolderHistory)
|
bulkUpdate, delete, deleteAll, findAll, findAllIds, findById, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForRowSet, store
List<Folder> findByName(String name)
name
- List<Folder> findByName(Folder parent, String name, boolean caseSensitive)
parent
- The parent folder(optional)name
- The folder name to search forcaseSensitive
- List<Folder> findByUserId(long userId)
userId
- ID of the userCollection<Long> findFolderIdByUserIdAndPermission(long userId, Permission permission, Long parentId, boolean tree)
userId
- The user identifierpermission
- The permission to checkparentId
- The id of the parent folder to inspect (optional)tree
- If true, the parentId will be interpreted as the root of a
treeCollection<Long> findFolderIdByUserId(long userId, Long parentId, boolean tree)
userId
- ID of the user.parentId
- The id of the parent folder to inspect (optional)tree
- If true, the parentId will be interpreted as the root of a
treeCollection<Long> findFolderIdInTree(long rootId, boolean includeDeleted)
rootId
- Root of the folderincludeDeleted
- True if the deleted records need to be loadedList<Folder> findByUserId(long userId, long parentId)
parentId
- ID of the folder which children are wantedList<Folder> findByParentId(long parentId)
parentId
- List<Folder> findChildren(long parentId, Integer max)
parentId
- Folder ID of the folder which children are wantedmax
- Optional, maximum number of childrenList<Folder> findChildren(long parentId, long userId)
parentId
- Folder ID of the folder which children are wanteduserId
- Identifier of the user that must have read accessboolean isWriteEnable(long id, long userId)
id
- ID of the folderuserId
- ID of the userboolean isReadEnable(long id, long userId)
boolean isPermissionEnabled(Permission permission, long id, long userId)
permission
- the permission to checkid
- ID of the folderuserId
- ID of the userSet<Permission> getEnabledPermissions(long id, long userId)
id
- ID of the folderuserId
- ID of the userList<Long> findIdByUserId(long userId, long parentId)
userId
- ID of the userparentId
- Parent folderboolean hasWriteAccess(Folder folder, long userId)
List<Folder> findByGroupId(long groupId)
groupId
- The group idList<Folder> findParents(long id)
id
- void restore(long folderId, long parentId, FolderHistory transaction)
folderId
- The folder identifierparentId
- The parent folder to restore intransaction
- Current session informationsList<Folder> findByNameAndParentId(String text, long parentId)
text
- parentId
- boolean store(Folder folder, FolderHistory transaction)
void deleteAll(List<Folder> folders, FolderHistory transaction)
folder
- List of folder to be deletetransaction
- entry to log the event on each folderboolean delete(long id, FolderHistory transaction)
id
- The id of the folder to deletetransaction
- entry to log the eventFolder create(Folder parent, Folder folderVO, boolean inheritSecurity, FolderHistory transaction)
parent
- The parent folderfolderVO
- The folder's metadatainheritSecurity
- If true the new folder will 'point' to the parent
for the security policies.Folder createPath(Folder parent, String path, boolean inheritSecurity, FolderHistory transaction)
parent
- The parent folderpath
- The folder path(for example /dog/cat/mouse)inheritSecurity
- If true the new folders will 'point' to the parent
for the security policies.String computePathExtended(long id)
id
- Folder findByPath(String pathExtended)
pathExtended
- void move(Folder source, Folder target, FolderHistory transaction) throws Exception
source
- The folder to movetarget
- The target foldertransaction
- entry to log the event (set the user)Exception
List<Folder> deleteTree(Folder folder, FolderHistory transaction) throws Exception
Important: Remember to delete orphaned documents.
folder
- Folder to deletetransaction
- entry to log the event (set the user)Exception
List<Folder> deleteTree(long folderId, FolderHistory transaction) throws Exception
Important: All the contained documents will be deleted
folderId
- Folder to deletetransaction
- entry to log the event (set the user)Exception
void setUniqueName(Folder folder)
List<Folder> find(String name)
name
- The name to be foundList<Folder> findDeleted(long userId, Integer maxHits)
userId
- The user that performed the deletionmaxHits
- Optional defines the max number of returned hitsboolean isInPath(long folderId, long targetId)
folderId
- The folder to be checkedtargetId
- The target folderboolean applyRithtToTree(long rootId, FolderHistory transaction)
boolean applyMetadataToTree(long id, FolderHistory transaction)
int count(boolean computeDeleted)
List<Folder> findWorkspaces()
void initialize(Folder folder)
initialize
in interface PersistentObjectDAO<Folder>
folder
- The folder to be initializedCopyright © 2008-2014 Logical Objects. All Rights Reserved.