Class UserPopulationsGroupDirectory
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.group.directory.UserPopulationsGroupDirectory
- All Implemented Interfaces:
GroupDirectory
,LogEnabled
,Serviceable
- Direct Known Subclasses:
UserPopulationsGroupDirectory
public class UserPopulationsGroupDirectory
extends AbstractLogEnabled
implements GroupDirectory, Serviceable
Implementation of a
GroupDirectory
based on user's populations-
Field Summary
Modifier and TypeFieldDescriptionprotected I18nUtils
The i18n utilsprotected PopulationContextHelper
The population context helperprotected UserPopulationDAO
The user population DAO -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<UserPopulation>
Get the available user populations for the current contextReturns a particular group.Get the id of theGroupDirectoryModel
extension pointReturns all groups.Get groupsgetId()
Get the id of the group directory.getLabel()
Get the label of the group directory.Get the values of parameters (from group directory model)getUserGroups
(UserIdentity userIdentity) Get all groups a particular user is in.void
Initialize the group directory with given parameter values.void
service
(ServiceManager smanager) void
Set the id of the group directory.void
setLabel
(I18nizableText label) Set the label of the group directory.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_userPopulationDAO
The user population DAO -
_populationContextHelper
The population context helper -
_i18nUtils
The i18n utils
-
-
Constructor Details
-
UserPopulationsGroupDirectory
public UserPopulationsGroupDirectory()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getId
Description copied from interface:GroupDirectory
Get the id of the group directory.- Specified by:
getId
in interfaceGroupDirectory
- Returns:
- The id of the group directory
-
getLabel
Description copied from interface:GroupDirectory
Get the label of the group directory.- Specified by:
getLabel
in interfaceGroupDirectory
- Returns:
- The label of the group directory
-
setId
Description copied from interface:GroupDirectory
Set the id of the group directory.- Specified by:
setId
in interfaceGroupDirectory
- Parameters:
id
- The id
-
setLabel
Description copied from interface:GroupDirectory
Set the label of the group directory.- Specified by:
setLabel
in interfaceGroupDirectory
- Parameters:
label
- The label
-
getGroupDirectoryModelId
Description copied from interface:GroupDirectory
Get the id of theGroupDirectoryModel
extension point- Specified by:
getGroupDirectoryModelId
in interfaceGroupDirectory
- Returns:
- the id of extension point
-
getParameterValues
Description copied from interface:GroupDirectory
Get the values of parameters (from group directory model)- Specified by:
getParameterValues
in interfaceGroupDirectory
- Returns:
- the parameters' values
-
init
Description copied from interface:GroupDirectory
Initialize the group directory with given parameter values.- Specified by:
init
in interfaceGroupDirectory
- Parameters:
groupDirectoryModelId
- The id of group directory extension pointparamValues
- The parameters' values- Throws:
Exception
- If an error occured
-
getGroup
Description copied from interface:GroupDirectory
Returns a particular group.- Specified by:
getGroup
in interfaceGroupDirectory
- Parameters:
groupID
- The id of the group.- Returns:
- The group or null if the group does not exist.
-
getGroups
Description copied from interface:GroupDirectory
Returns all groups.- Specified by:
getGroups
in interfaceGroupDirectory
- Returns:
- The groups as a Set of UserGroup, empty if an error occurs.
-
getAvailableUserPopulationsForContext
Get the available user populations for the current context- Returns:
- the available user populations
-
getUserGroups
Description copied from interface:GroupDirectory
Get all groups a particular user is in.- Specified by:
getUserGroups
in interfaceGroupDirectory
- Parameters:
userIdentity
- The identity of the user- Returns:
- The groups as a Set of String (group ID), empty if the login does not match.
-
getGroups
Description copied from interface:GroupDirectory
Get groups- Specified by:
getGroups
in interfaceGroupDirectory
- Parameters:
count
- The maximum number of groups to sax. (-1 to sax all)offset
- The offset to start with, first is 0.parameters
- Parameters for saxing user list differently, see implementation.- Returns:
- The matching groups
-