public final class QueryHelper extends Object
Query
Modifier and Type | Field and Description |
---|---|
private static String |
__PLUGIN_NODE_NAME |
private static String |
__ROOT_QUERY_NODETYPE |
Modifier | Constructor and Description |
---|---|
private |
QueryHelper() |
Modifier and Type | Method and Description |
---|---|
private static void |
_appendGroupAccessCondition(StringBuilder query,
String groupId,
String groupDirectory,
String accessNodeName) |
private static void |
_appendGroupsCondition(StringBuilder query,
Set<GroupIdentity> groups,
boolean readAccess) |
private static void |
_appendPrivatePredicate(StringBuilder query,
String login,
String populationId) |
private static void |
_appendPublicPredicate(StringBuilder query) |
private static void |
_appendSharedPredicate(StringBuilder query,
String login,
String populationId,
Set<GroupIdentity> groups,
boolean readAccess) |
private static void |
_appendUserAccessCondition(StringBuilder query,
String login,
String populationId,
String accessNodeName) |
private static void |
_appendUserCondition(StringBuilder query,
String login,
String populationId) |
private static String |
_getXPathQuery(UserIdentity user,
boolean checkVisibility,
Set<GroupIdentity> groups,
Optional<String> type,
Boolean readAccess) |
private static ModifiableTraversableAmetysObject |
getOrCreateNode(ModifiableTraversableAmetysObject parentNode,
String nodeName,
String nodeType) |
static ModifiableTraversableAmetysObject |
getQueriesRootNode(AmetysObjectResolver resolver)
Get the root plugin storage object.
|
static String |
getXPathQueryForAdministrator(Optional<String> type)
Creates the XPath query to get all queries for administrator
|
static String |
getXPathQueryForReadAccess(UserIdentity user,
Set<GroupIdentity> groups,
Optional<String> type)
Creates the XPath query to get all queries in READ access
|
static String |
getXPathQueryForWriteAccess(UserIdentity user,
Set<GroupIdentity> groups,
Optional<String> type)
Creates the XPath query to get all queries in WRITE access
|
private static final String __PLUGIN_NODE_NAME
private static final String __ROOT_QUERY_NODETYPE
private QueryHelper()
public static ModifiableTraversableAmetysObject getQueriesRootNode(AmetysObjectResolver resolver) throws AmetysRepositoryException
resolver
- The Ametys object resolverAmetysRepositoryException
- if a repository error occurs.private static ModifiableTraversableAmetysObject getOrCreateNode(ModifiableTraversableAmetysObject parentNode, String nodeName, String nodeType) throws AmetysRepositoryException
AmetysRepositoryException
public static String getXPathQueryForAdministrator(Optional<String> type)
type
- The query typepublic static String getXPathQueryForReadAccess(UserIdentity user, Set<GroupIdentity> groups, Optional<String> type)
user
- The usergroups
- The user's groupstype
- The query typepublic static String getXPathQueryForWriteAccess(UserIdentity user, Set<GroupIdentity> groups, Optional<String> type)
user
- The usergroups
- The user's groupstype
- The query typeprivate static String _getXPathQuery(UserIdentity user, boolean checkVisibility, Set<GroupIdentity> groups, Optional<String> type, Boolean readAccess)
private static void _appendPublicPredicate(StringBuilder query)
private static void _appendPrivatePredicate(StringBuilder query, String login, String populationId)
private static void _appendSharedPredicate(StringBuilder query, String login, String populationId, Set<GroupIdentity> groups, boolean readAccess)
private static void _appendUserCondition(StringBuilder query, String login, String populationId)
private static void _appendGroupsCondition(StringBuilder query, Set<GroupIdentity> groups, boolean readAccess)
private static void _appendUserAccessCondition(StringBuilder query, String login, String populationId, String accessNodeName)
private static void _appendGroupAccessCondition(StringBuilder query, String groupId, String groupDirectory, String accessNodeName)