com.stratelia.webactiv.beans.admin.dao
Class GroupSearchCriteriaForDAO

java.lang.Object
  extended by com.stratelia.webactiv.beans.admin.dao.GroupSearchCriteriaForDAO
All Implemented Interfaces:
SearchCriteria

public class GroupSearchCriteriaForDAO
extends Object
implements SearchCriteria

An implementation of the search criteria for user groups stored in a SQL data source and used by the DAOs. By default, the criterion are linked together by a conjonction operator. Nevertheless, you can explicitly specify it by using the GroupSearchCriteriaForDAO#and() method.


Field Summary
 
Fields inherited from interface com.stratelia.webactiv.beans.admin.SearchCriteria
ANY
 
Method Summary
 GroupSearchCriteriaForDAO and()
          Appends a criteria conjonction.
 List<String> getCriterionOnDomainIds()
           
 Set<UserState> getCriterionOnUserStatesToExclude()
           
 PaginationPage getPagination()
          Gets the criterion on the pagination page to fetch.
 boolean isCriterionOnDomainIdSet()
           
 boolean isEmpty()
          Is this criteria empty?
 boolean isPaginationSet()
          Is the pagination criterion set?
static GroupSearchCriteriaForDAO newCriteria()
           
 GroupSearchCriteriaForDAO onAccessLevels(UserAccessLevel... accessLevels)
          Appends a criterion on the user access level for which the search must be constrained to.
 SearchCriteria onAsRootGroup()
           
 SearchCriteria onComponentInstanceId(String instanceId)
          Appends a criterion on the component instance for which the search must be constrained to.
 GroupSearchCriteriaForDAO onDomainId(String domainId)
          Appends a criterion on the user domain for which the search must be constrained to.
 GroupSearchCriteriaForDAO onGroupIds(String... groupIds)
          Appends a criterion on the user groups for which the search must be constrained to.
 GroupSearchCriteriaForDAO onMixedDomainOronDomainId(String domainId)
           
 GroupSearchCriteriaForDAO onName(String name)
          Appends a criterion on the resources name for which the search must be constrained to.
 SearchCriteria onPagination(PaginationPage page)
          Appends a criteria on a resources pagination.
 SearchCriteria onResourceId(String resourceId)
          Appends a criterion on a given component instance's resource for which the search must be constrained to.
 SearchCriteria onRoleNames(String... roleIds)
          Appends a criterion on the user roles for which the search must be constrained to.
 SearchCriteria onSuperGroupId(String superGroupId)
           
 SearchCriteria onUserIds(String... userIds)
          Appends a criteria on the user profiles for which the search must be constrained to.
 SearchCriteria onUserStatesToExclude(UserState... userStates)
          Appends a criteria on the user states that must exclude users from the result.
 GroupSearchCriteriaForDAO or()
          Appends a criteria disjonction.
 String toSQLQuery(String fields)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newCriteria

public static GroupSearchCriteriaForDAO newCriteria()

and

public GroupSearchCriteriaForDAO and()
Description copied from interface: SearchCriteria
Appends a criteria conjonction.

Specified by:
and in interface SearchCriteria
Returns:
the criteria enriched with a conjonction. The conjonction will be applied with the last added criterion and the next one.

or

public GroupSearchCriteriaForDAO or()
Description copied from interface: SearchCriteria
Appends a criteria disjonction.

Specified by:
or in interface SearchCriteria
Returns:
the criteria enriched with a disjonction. The disjonction will be applied with the last added criterion and the next one.

onName

public GroupSearchCriteriaForDAO onName(String name)
Description copied from interface: SearchCriteria
Appends a criterion on the resources name for which the search must be constrained to. The name of the resources to fetch have to satisfy this criterion.

Specified by:
onName in interface SearchCriteria
Parameters:
name - a pattern on the name the resources to fetch must have.
Returns:
the criteria enriched with a criterion on the user name.

onGroupIds

public GroupSearchCriteriaForDAO onGroupIds(String... groupIds)
Description copied from interface: SearchCriteria
Appends a criterion on the user groups for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onGroupIds in interface SearchCriteria
Parameters:
groupIds - the unique identifiers of the groups.
Returns:
the criteria enriched with a criterion on the user groups.

onDomainId

public GroupSearchCriteriaForDAO onDomainId(String domainId)
Description copied from interface: SearchCriteria
Appends a criterion on the user domain for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onDomainId in interface SearchCriteria
Parameters:
domainId - the unique identifier of the user domain.
Returns:
the criteria enriched with a criterion on the user domain.

onAccessLevels

public GroupSearchCriteriaForDAO onAccessLevels(UserAccessLevel... accessLevels)
Description copied from interface: SearchCriteria
Appends a criterion on the user access level for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onAccessLevels in interface SearchCriteria
Parameters:
accessLevels - the access levels aimed.
Returns:
the criteria enriched with a criterion on the user access level.

onUserStatesToExclude

public SearchCriteria onUserStatesToExclude(UserState... userStates)
Description copied from interface: SearchCriteria
Appends a criteria on the user states that must exclude users from the result. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onUserStatesToExclude in interface SearchCriteria
Parameters:
userStates - the user states that exclude users from the result.
Returns:
the criteria enriched with a criterion on the user states.

onMixedDomainOronDomainId

public GroupSearchCriteriaForDAO onMixedDomainOronDomainId(String domainId)

onUserIds

public SearchCriteria onUserIds(String... userIds)
Description copied from interface: SearchCriteria
Appends a criteria on the user profiles for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onUserIds in interface SearchCriteria
Parameters:
userIds - the user identifiers.
Returns:
the criteria enriched with a criterion on the user identifiers.

onRoleNames

public SearchCriteria onRoleNames(String... roleIds)
Description copied from interface: SearchCriteria
Appends a criterion on the user roles for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onRoleNames in interface SearchCriteria
Parameters:
roleIds - the name of the user roles on which the criterion has to be built.
Returns:
the criteria enriched with a criterion on the role names.

onSuperGroupId

public SearchCriteria onSuperGroupId(String superGroupId)

onAsRootGroup

public SearchCriteria onAsRootGroup()

toSQLQuery

public String toSQLQuery(String fields)

toString

public String toString()
Overrides:
toString in class Object

isEmpty

public boolean isEmpty()
Description copied from interface: SearchCriteria
Is this criteria empty?

Specified by:
isEmpty in interface SearchCriteria
Returns:
true if this criteria has no criterion, false otherwise.

isCriterionOnDomainIdSet

public boolean isCriterionOnDomainIdSet()

getCriterionOnDomainIds

public List<String> getCriterionOnDomainIds()

getCriterionOnUserStatesToExclude

public Set<UserState> getCriterionOnUserStatesToExclude()

onComponentInstanceId

public SearchCriteria onComponentInstanceId(String instanceId)
Description copied from interface: SearchCriteria
Appends a criterion on the component instance for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onComponentInstanceId in interface SearchCriteria
Parameters:
instanceId - the unique identifier of the component instance.
Returns:
the criteria enriched with a criterion on the component instance.

onResourceId

public SearchCriteria onResourceId(String resourceId)
Description copied from interface: SearchCriteria
Appends a criterion on a given component instance's resource for which the search must be constrained to. This criterion has a meaning only when coupled with the criterion on the component instance. The properties of the resources to fetch have to satisfy both the criterion on the component instance and this one.

Specified by:
onResourceId in interface SearchCriteria
Parameters:
resourceId - the unique identifier of the resource managed in the component instance. As each resource is particular to a given Silverpeas component, the unique identifier is made up of the resource type and of the resource identifier.
Returns:
the criteria enriched with a criterion on the resource in the component instance.

onPagination

public SearchCriteria onPagination(PaginationPage page)
Description copied from interface: SearchCriteria
Appends a criteria on a resources pagination. The pagination is a mechanism to distribute the resources to fetch in one or more pages of same size and to navigate among theses different available pages. Yet, this criterion is about the page of resources to fetch.

Specified by:
onPagination in interface SearchCriteria
Parameters:
page - the page of resources to fetch.
Returns:
the criteria enriched with a criterion on the resources pagination.

getPagination

public PaginationPage getPagination()
Gets the criterion on the pagination page to fetch.

Returns:
a pagination page.

isPaginationSet

public boolean isPaginationSet()
Is the pagination criterion set?

Returns:
true if a criterion on the pagination about user groups is set, false otherwise.


Copyright © 2016 Silverpeas. All Rights Reserved.