com.stratelia.webactiv.beans.admin
Interface SearchCriteria

All Known Implementing Classes:
GroupSearchCriteriaForDAO, GroupsSearchCriteria, UserDetailsSearchCriteria, UserSearchCriteriaForDAO

public interface SearchCriteria

Criteria to use in a search of resources managed and exposed in Silverpeas (like user profiles or user groups).


Field Summary
static String[] ANY
          The whatever value to be used as criterion value if you don't care of a given criterion.
 
Method Summary
 SearchCriteria and()
          Appends a criteria conjonction.
 boolean isEmpty()
          Is this criteria empty?
 SearchCriteria onAccessLevels(UserAccessLevel... accessLevels)
          Appends a criterion on the user access level for which the search must be constrained to.
 SearchCriteria onComponentInstanceId(String instanceId)
          Appends a criterion on the component instance for which the search must be constrained to.
 SearchCriteria onDomainId(String domainId)
          Appends a criterion on the user domain for which the search must be constrained to.
 SearchCriteria onGroupIds(String... groupIds)
          Appends a criterion on the user groups for which the search must be constrained to.
 SearchCriteria 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... roleNames)
          Appends a criterion on the user roles for which the search must be constrained to.
 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.
 SearchCriteria or()
          Appends a criteria disjonction.
 

Field Detail

ANY

static final String[] ANY
The whatever value to be used as criterion value if you don't care of a given criterion.

Method Detail

and

SearchCriteria and()
Appends a criteria conjonction.

Returns:
the criteria enriched with a conjonction. The conjonction will be applied with the last added criterion and the next one.

onComponentInstanceId

SearchCriteria onComponentInstanceId(String instanceId)
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.

Parameters:
instanceId - the unique identifier of the component instance.
Returns:
the criteria enriched with a criterion on the component instance.

onResourceId

SearchCriteria onResourceId(String resourceId)
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.

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.

onDomainId

SearchCriteria onDomainId(String domainId)
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.

Parameters:
domainId - the unique identifier of the user domain.
Returns:
the criteria enriched with a criterion on the user domain.

onGroupIds

SearchCriteria onGroupIds(String... groupIds)
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.

Parameters:
groupIds - the unique identifiers of the groups.
Returns:
the criteria enriched with a criterion on the user groups.

onAccessLevels

SearchCriteria onAccessLevels(UserAccessLevel... accessLevels)
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.

Parameters:
accessLevels - the access levels aimed.
Returns:
the criteria enriched with a criterion on the user access level.

onName

SearchCriteria onName(String name)
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.

Parameters:
name - a pattern on the name the resources to fetch must have.
Returns:
the criteria enriched with a criterion on the user name.

onRoleNames

SearchCriteria onRoleNames(String... roleNames)
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.

Parameters:
roleNames - 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.

onUserIds

SearchCriteria onUserIds(String... userIds)
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.

Parameters:
userIds - the user identifiers.
Returns:
the criteria enriched with a criterion on the user identifiers.

onUserStatesToExclude

SearchCriteria onUserStatesToExclude(UserState... userStates)
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.

Parameters:
userStates - the user states that exclude users from the result.
Returns:
the criteria enriched with a criterion on the user states.

onPagination

SearchCriteria onPagination(PaginationPage page)
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.

Parameters:
page - the page of resources to fetch.
Returns:
the criteria enriched with a criterion on the resources pagination.

or

SearchCriteria or()
Appends a criteria disjonction.

Returns:
the criteria enriched with a disjonction. The disjonction will be applied with the last added criterion and the next one.

isEmpty

boolean isEmpty()
Is this criteria empty?

Returns:
true if this criteria has no criterion, false otherwise.


Copyright © 2016 Silverpeas. All Rights Reserved.