Package org.opencms.file
Class CmsUserSearchParameters
- java.lang.Object
-
- org.opencms.file.CmsUserSearchParameters
-
public class CmsUserSearchParameters extends java.lang.Object
An object which represents search criteria for retrieving users.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsUserSearchParameters.SearchKey
An enum used for indicating searchable columns.static class
CmsUserSearchParameters.SortKey
An enum used for indicating sort order.
-
Constructor Summary
Constructors Constructor Description CmsUserSearchParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSearch(CmsUserSearchParameters.SearchKey key)
Adds a search key.java.util.List<CmsOrganizationalUnit>
getAllowedOus()
Returns the list of OUs from which users may be returned.java.util.Collection<CmsGroup>
getAnyGroups()
Returns the collection of groups such that returned users must be in at least one of them.java.lang.String
getEmail()
Gets the email address to search for.int
getFlags()
Returns the flags to filter by.CmsGroup
getGroup()
Returns the group such that users which are not in the group will be filtered out.java.util.Collection<CmsGroup>
getNotAnyGroups()
Returns the groups whose users may not appear in the search results.CmsGroup
getNotGroup()
Returns the group such that users not in that group will be filtered out.CmsOrganizationalUnit
getOrganizationalUnit()
Gets the organizational unit to which a user must belong.int
getPage()
Returns the results page index.int
getPageSize()
Returns the maximum results page size.java.lang.String
getSearchFilter()
Returns the search term.java.util.Set<CmsUserSearchParameters.SearchKey>
getSearchKeys()
Returns the set of search keys.int
getSortFlags()
Returns the bit mask to be used for ordering by flags.CmsUserSearchParameters.SortKey
getSortKey()
Returns the key indicating by which column the results should be sorted.boolean
isAscending()
If true, the results should be sorted in ascending order, else in descending order.boolean
isCaseSensitive()
Returns true if the search filter should be case sensitive.boolean
isFilterByGroupOu()
Returns true if users of different OUs than the search group's OU will be filtered out.boolean
isFilterCore()
Returns true if non-core users should be filtered out.boolean
keepCoreUsers()
Return true if core users should not be filtered out if filtering by flag.boolean
recursiveOrgUnits()
Returns true if sub-OU users will be returned in the result.void
setAllowedOus(java.util.List<CmsOrganizationalUnit> ous)
Sets the OUs from which users should be returned.void
setAnyGroups(java.util.Collection<CmsGroup> anyGroups)
Sets the groups such that returned users must be in at least one of them.void
setCaseSensitive(boolean caseSensitive)
Sets the case sensitivity for the search filter.void
setFilterByGroupOu(boolean filterByGroupOu)
Sets the "filter by group OU" flag.void
setFilterCore(boolean filterCore)
Enables or disables the filtering of non-core users.void
setFilterEmail(java.lang.String email)
Sets the email address to search for.void
setFlags(int flags)
Sets the flags to filter by.void
setGroup(CmsGroup group)
Sets the group such that users which are not in the group will be filtered out.void
setKeepCoreUsers(boolean keepCoreUsers)
If this is set to true, core users will not be filtered out if filtering by flag.void
setNotAnyGroups(java.util.Collection<CmsGroup> groups)
Sets the groups whose users may not appear in the search results.void
setNotGroup(CmsGroup group)
Sets the group such that users not in that group will be filtered out.void
setOrganizationalUnit(CmsOrganizationalUnit ou)
Sets the organizational unit to which a user must belong.void
setPaging(int pageSize, int page)
Sets the paging parameters.void
setRecursiveOrgUnits(boolean recursive)
Enables fetching of users of sub-OUs (if an OU has been set).void
setSearchFilter(java.lang.String searchFilter)
Sets the search term.void
setSortFlags(int sortFlags)
Sets the bit mask used when the results should be ordered by flags.void
setSorting(CmsUserSearchParameters.SortKey key, boolean ascending)
Sets the sort key and order.
-
-
-
Constructor Detail
-
CmsUserSearchParameters
public CmsUserSearchParameters()
-
-
Method Detail
-
addSearch
public void addSearch(CmsUserSearchParameters.SearchKey key)
Adds a search key.- Parameters:
key
- the search key to add
-
getAllowedOus
public java.util.List<CmsOrganizationalUnit> getAllowedOus()
Returns the list of OUs from which users may be returned.- Returns:
- a list of OUs
-
getAnyGroups
public java.util.Collection<CmsGroup> getAnyGroups()
Returns the collection of groups such that returned users must be in at least one of them.- Returns:
- a collection of groups
-
getEmail
public java.lang.String getEmail()
Gets the email address to search for.- Returns:
- the email address to search for
-
getFlags
public int getFlags()
Returns the flags to filter by.- Returns:
- the flags
-
getGroup
public CmsGroup getGroup()
Returns the group such that users which are not in the group will be filtered out.- Returns:
- a group
-
getNotAnyGroups
public java.util.Collection<CmsGroup> getNotAnyGroups()
Returns the groups whose users may not appear in the search results.- Returns:
- the groups whose users may not appear in the search results
-
getNotGroup
public CmsGroup getNotGroup()
Returns the group such that users not in that group will be filtered out.- Returns:
- a group
-
getOrganizationalUnit
public CmsOrganizationalUnit getOrganizationalUnit()
Gets the organizational unit to which a user must belong.- Returns:
- the organizational unit
-
getPage
public int getPage()
Returns the results page index.- Returns:
- the results page index
-
getPageSize
public int getPageSize()
Returns the maximum results page size.- Returns:
- the page size
-
getSearchFilter
public java.lang.String getSearchFilter()
Returns the search term.- Returns:
- the search term
-
getSearchKeys
public java.util.Set<CmsUserSearchParameters.SearchKey> getSearchKeys()
Returns the set of search keys.- Returns:
- the set of search keys
-
getSortFlags
public int getSortFlags()
Returns the bit mask to be used for ordering by flags.- Returns:
- the bit mask to be used for ordering by flags
-
getSortKey
public CmsUserSearchParameters.SortKey getSortKey()
Returns the key indicating by which column the results should be sorted.- Returns:
- the sort key
-
isAscending
public boolean isAscending()
If true, the results should be sorted in ascending order, else in descending order.- Returns:
- the flag indicating the sort order
-
isCaseSensitive
public boolean isCaseSensitive()
Returns true if the search filter should be case sensitive.The default value is
true
.- Returns:
- true if the search filter should be case sensitive
-
isFilterByGroupOu
public boolean isFilterByGroupOu()
Returns true if users of different OUs than the search group's OU will be filtered out.- Returns:
- the "filter by group OU" flag
-
isFilterCore
public boolean isFilterCore()
Returns true if non-core users should be filtered out.- Returns:
- true if non-core users should be filtered out
-
keepCoreUsers
public boolean keepCoreUsers()
Return true if core users should not be filtered out if filtering by flag.- Returns:
- true if core users should not be filtered out if filtering by flag.
-
recursiveOrgUnits
public boolean recursiveOrgUnits()
Returns true if sub-OU users will be returned in the result.- Returns:
- true if sub-OU users will be returned in the result
-
setAllowedOus
public void setAllowedOus(java.util.List<CmsOrganizationalUnit> ous)
Sets the OUs from which users should be returned.- Parameters:
ous
- a list of OUs
-
setAnyGroups
public void setAnyGroups(java.util.Collection<CmsGroup> anyGroups)
Sets the groups such that returned users must be in at least one of them.- Parameters:
anyGroups
- the groups
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
Sets the case sensitivity for the search filter.- Parameters:
caseSensitive
- if true, the search filter will be case sensitive.
-
setFilterByGroupOu
public void setFilterByGroupOu(boolean filterByGroupOu)
Sets the "filter by group OU" flag.If the flag is true, users of a different OU than the search group's OU will be filtered out.
- Parameters:
filterByGroupOu
- the "filter by group OU" flag
-
setFilterCore
public void setFilterCore(boolean filterCore)
Enables or disables the filtering of non-core users.- Parameters:
filterCore
- if true, non-core users will be filtered out
-
setFilterEmail
public void setFilterEmail(java.lang.String email)
Sets the email address to search for.- Parameters:
email
- the email address to search for
-
setFlags
public void setFlags(int flags)
Sets the flags to filter by.- Parameters:
flags
- the flags
-
setGroup
public void setGroup(CmsGroup group)
Sets the group such that users which are not in the group will be filtered out.- Parameters:
group
- a group
-
setKeepCoreUsers
public void setKeepCoreUsers(boolean keepCoreUsers)
If this is set to true, core users will not be filtered out if filtering by flag.- Parameters:
keepCoreUsers
- true if core users should not be filtered out when filtering by flag
-
setNotAnyGroups
public void setNotAnyGroups(java.util.Collection<CmsGroup> groups)
Sets the groups whose users may not appear in the search results.- Parameters:
groups
- the groups whose users may not appear in the search results
-
setNotGroup
public void setNotGroup(CmsGroup group)
Sets the group such that users not in that group will be filtered out.- Parameters:
group
- a group
-
setOrganizationalUnit
public void setOrganizationalUnit(CmsOrganizationalUnit ou)
Sets the organizational unit to which a user must belong.- Parameters:
ou
- the organizational unit
-
setPaging
public void setPaging(int pageSize, int page)
Sets the paging parameters.- Parameters:
pageSize
- the maximum page sizepage
- the page index
-
setRecursiveOrgUnits
public void setRecursiveOrgUnits(boolean recursive)
Enables fetching of users of sub-OUs (if an OU has been set).- Parameters:
recursive
- if true, enable sub-OU users in the result
-
setSearchFilter
public void setSearchFilter(java.lang.String searchFilter)
Sets the search term.- Parameters:
searchFilter
- the search term
-
setSortFlags
public void setSortFlags(int sortFlags)
Sets the bit mask used when the results should be ordered by flags.- Parameters:
sortFlags
- the bit mask for ordering by flags
-
setSorting
public void setSorting(CmsUserSearchParameters.SortKey key, boolean ascending)
Sets the sort key and order.- Parameters:
key
- the sort keyascending
- the sort order (ascending if true, descending if false)
-
-