public class QueryDAO extends AbstractLogEnabled implements Serviceable, Component
Modifier and Type | Field and Description |
---|---|
private AmetysObjectResolver |
_resolver
The Ametys object resolver
|
private RightManager |
_rightManager |
private UserHelper |
_userHelper |
protected CurrentUserProvider |
_userProvider
The current user provider
|
static String |
ROLE
The Avalon role
|
Constructor and Description |
---|
QueryDAO() |
Modifier and Type | Method and Description |
---|---|
private Map<String,Object> |
_assignRights(String queryId,
String profileId,
String type,
List<Map<String,String>> users,
List<Map<String,String>> groups) |
protected boolean |
_hasRight(Query query)
Test if the current user has the right required to access the query
|
Map<String,Object> |
addGrantedGroups(String queryId,
String profileId,
List<Map<String,String>> groups)
Assign rigths to the given groups on the given query
|
Map<String,Object> |
addGrantedUsers(String queryId,
String profileId,
List<Map<String,String>> users)
Assign rights to the given users on the given query
|
Map<String,Object> |
changeVisibility(String queryId,
String visibilityStr)
Changes the visibility of a
Query |
String |
createQuery(String title,
String desc,
String type,
String content)
Creates a new
Query |
Map<String,Object> |
deleteQuery(List<String> ids)
Deletes
Query (ies) |
Map<String,Object> |
getQueriesProperties(List<String> queryIds)
Get queries' properties
|
Map<String,Object> |
getQueryProperties(Query query)
Get the query properties
|
boolean |
isAdministrator()
Determines if the current user is administrator of queries
|
Map<String,Object> |
removeAssignment(String queryId,
String profileId,
List<Map<String,String>> users,
List<Map<String,String>> groups)
Remove rights to the given users on the given query
|
Map<String,Object> |
saveQuery(String id,
String type,
String content)
Saves a
Query |
void |
service(ServiceManager serviceManager) |
Map<String,Object> |
updateQuery(String id,
String title,
String desc)
Edits a
Query |
getLogger, setLogger
protected CurrentUserProvider _userProvider
private AmetysObjectResolver _resolver
private UserHelper _userHelper
private RightManager _rightManager
public QueryDAO()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getQueriesProperties(List<String> queryIds)
queryIds
- The ids of queries to retrievepublic Map<String,Object> getQueryProperties(Query query)
query
- The querypublic String createQuery(String title, String desc, String type, String content)
Query
title
- The title of the querydesc
- The description of the querytype
- The type of the querycontent
- The content of the querypublic Map<String,Object> updateQuery(String id, String title, String desc)
Query
id
- The id of the querytitle
- The title of the querydesc
- The description of the querypublic Map<String,Object> saveQuery(String id, String type, String content)
Query
id
- The id of the querytype
- The type of the querycontent
- The content of the querypublic Map<String,Object> deleteQuery(List<String> ids)
Query
(ies)ids
- The ids of the queries to deletepublic Map<String,Object> changeVisibility(String queryId, String visibilityStr)
Query
queryId
- The id of the queryvisibilityStr
- The new visibilitypublic Map<String,Object> addGrantedUsers(String queryId, String profileId, List<Map<String,String>> users)
queryId
- The query idprofileId
- The profile idusers
- The users to grantpublic Map<String,Object> addGrantedGroups(String queryId, String profileId, List<Map<String,String>> groups)
queryId
- The query idprofileId
- The profile idgroups
- The groups to grantprivate Map<String,Object> _assignRights(String queryId, String profileId, String type, List<Map<String,String>> users, List<Map<String,String>> groups)
public Map<String,Object> removeAssignment(String queryId, String profileId, List<Map<String,String>> users, List<Map<String,String>> groups)
queryId
- The query idprofileId
- The profile idusers
- The users to removegroups
- The groups to removepublic boolean isAdministrator()
true
if current user is administrator