Interface MenuDAO
- All Superinterfaces:
- PersistentObjectDAO<Menu>
- All Known Implementing Classes:
- HibernateMenuDAO
Instances of this class is a DAO-service for menu objects.
- Version:
- 1.0
- Author:
- Michael Scholz
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptioncomputePathExtended(long id) Dynamically computes the path extended for the specified menu.createPath(long parentId, long tenantId, int type, String path, boolean inheritSecurity) Creates the menu for the specified path.findByGroupId(long groupId) Finds all menus accessible by the passed groupfindByName(Menu parent, String name, boolean caseSensitive) Finds all menus by menu text, contained in the parent menufindByName(String name) Finds all menus by menu text.findByNameAndParentId(String name, long parentId) Finds that folder that lies under a specific parent (given by the id) an with a given text(like operator is used)findByParentId(long parentId, boolean enabledOnly) Finds all children(direct and indirect) by parentIdfindByUserId(long userId) Finds authorized menus for a user.findByUserId(long userId, long parentId, boolean enabledOnly) Finds direct children of a menufindChildren(long parentId, long userId) Finds direct children of a menu accessible by the given user.findChildren(long parentId, Integer max) Finds direct children of a menu.findIdByUserId(long userId, long parentId) This method selects only the menuId from the menus for which a user is authorized.findMenuIdByUserId(long userId, boolean enabledOnly) This method selects only the menuId from the menus for which a user is authorizedfindMenuIdByUserIdAndPermission(long userId, Permission permission, boolean enabledOnly) Finds all menus ids with a specific permission enabled on the specifies userfindNameById(long id) This method selects only the menu text from a menufindParents(long id) Returns a List of menus being a parent of the given menu.booleanhasWriteAccess(Menu menu, long userId) Checks that the user has access to the menu and all its sub-itemsintisMenuWriteable(long id, long userId) Returns if a menu is writeable for a userbooleanisReadEnable(long id, long userId) This method is looking up for read rights for a menu and an userbooleanisWriteEnable(long id, long userId) This method is looking up for writing rights for a menu and an uservoidrestore(long id, boolean parents) Restores a previously deleted menuMethods inherited from interface com.logicaldoc.core.PersistentObjectDAObulkUpdate, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store
- 
Method Details- 
findByNameFinds all menus by menu text.- Parameters:
- name- name of the menu
- Returns:
- List of menus with given menu text.
 
- 
findByUserIdFinds authorized menus for a user.- Parameters:
- userId- ID of the user.
- Returns:
- List of found menus.
 
- 
findMenuIdByUserIdAndPermissionFinds all menus ids with a specific permission enabled on the specifies user- Parameters:
- userId- The user identifier
- permission- The permission to check
- enabledOnly- if the menus must also be enabled
- Returns:
- list of folder IDs
 
- 
findByUserIdFinds direct children of a menu- Parameters:
- userId- identifier of the user
- parentId- MenuId of the menu which children are wanted
- enabledOnly- if the menus must also be enabled
- Returns:
- List of found menus sorted by name
 
- 
findByParentIdFinds all children(direct and indirect) by parentId- Parameters:
- parentId- identifier of the parent menu
- enabledOnly- if the menus must also be enabled
- Returns:
- list of children menus
 
- 
findChildrenFinds direct children of a menu.- Parameters:
- parentId- MenuId of the menu which children are wanted
- max- Optional, maximum number of children
- Returns:
- List of found menus
 
- 
findChildrenFinds direct children of a menu accessible by the given user.- Parameters:
- parentId- MenuId of the menu which children are wanted
- userId- Identifier of the user that must have read access
- Returns:
- List of found menus.
 
- 
isWriteEnableboolean isWriteEnable(long id, long userId) This method is looking up for writing rights for a menu and an user- Parameters:
- id- ID of the menu
- userId- ID of the user
- Returns:
- id the user has write permission
 
- 
isReadEnableboolean isReadEnable(long id, long userId) This method is looking up for read rights for a menu and an user- Parameters:
- id- ID of the menu
- userId- ID of the user
- Returns:
- if the user can access the menu
 
- 
findNameByIdThis method selects only the menu text from a menu- Parameters:
- id- Id of the menu
- Returns:
- Selected menu text
 
- 
findMenuIdByUserIdThis method selects only the menuId from the menus for which a user is authorized- Parameters:
- userId- ID of the user
- enabledOnly- if the menus must also be enabled
- Returns:
- List of selected menuId's
 
- 
findIdByUserIdThis method selects only the menuId from the menus for which a user is authorized. Only menus direct child of the specified parent are returned.- Parameters:
- userId- ID of the user.
- parentId- Parent menu
- Returns:
- List of selected menuId's.
 
- 
isMenuWriteableint isMenuWriteable(long id, long userId) Returns if a menu is writeable for a user- Parameters:
- id- check this menu
- userId- privileges for this should be checked
- Returns:
- a 0 if false, a 1 if true
 
- 
findByGroupIdFinds all menus accessible by the passed group- Parameters:
- groupId- The group id
- Returns:
- The List of menus
- Throws:
- PersistenceException- Error in the database
 
- 
findParentsReturns a List of menus being a parent of the given menu. The list is ordered starting from the root of menus.- Parameters:
- id- identifier of the group
- Returns:
- hierarchy of parents
 
- 
restoreRestores a previously deleted menu- Parameters:
- id- The menu identifier
- parents- true if parents must be restored also
- Throws:
- PersistenceException- is happened a database error
 
- 
findByNameAndParentIdFinds that folder that lies under a specific parent (given by the id) an with a given text(like operator is used)- Parameters:
- name- name of the menu
- parentId- identifier of the parent menu
- Returns:
- list of manues
 
- 
computePathExtendedDynamically computes the path extended for the specified menu. The path extended is a human readable path in the form: /menu1/menu2/menu3- Parameters:
- id- identifier of the menu
- Returns:
- full path of the menu
 
- 
createPathMenu createPath(long parentId, long tenantId, int type, String path, boolean inheritSecurity) throws PersistenceException Creates the menu for the specified path. All unexisting nodes specified in the path will be created.- Parameters:
- parentId- Identifier of the parent menu
- tenantId- Identifier of the tenant that will own the new menu
- type- The type of the created menus
- path- The folder path(for example /dog/cat/mouse)
- inheritSecurity- If true the new menus will 'point' to the parent for the security policies.
- Returns:
- The created folder
- Throws:
- PersistenceException- error at data layer
 
 
-