Class ProfilesService
- java.lang.Object
-
- fr.paris.lutece.plugins.profiles.service.ProfilesService
-
- All Implemented Interfaces:
IProfilesService
public class ProfilesService extends java.lang.Object implements IProfilesService
ProfilesService
-
-
Constructor Summary
Constructors Constructor Description ProfilesService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRightForProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add a right for a profilevoidaddRoleForProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add a role for a profilevoidaddUserForProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add an user for a profilevoidaddWorkgroupForProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add a workgroup for a profilebooleancheckExistProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile already exists or notbooleancheckProfileAttributed(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if the profile is attributed to any userProfilecreate(Profile profile, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)Creation of an instance of profilevoiddoAssignUserToProfile(int nIdUser, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)Do assign user to a profilevoiddoUnassignUserFromProfile(int nIdUser, java.lang.String strProfileKey, fr.paris.lutece.portal.business.user.AdminUser currentUser, javax.servlet.http.HttpServletRequest request, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)Do unassign user from profilejava.util.List<Profile>findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)Returns a collection of profiles objectsProfilefindByPrimaryKey(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Returns an instance of a profile whose identifier is specified in parameterjava.util.List<Profile>findProfileByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Load the list of profiles by a given ID userjava.util.List<Profile>findProfilesByFilter(ProfileFilter pFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find profile by filterfr.paris.lutece.util.html.ItemNavigatorgetItemNavigator(ProfileFilter pFilter, Profile profile, fr.paris.lutece.util.url.UrlItem url)Get the item navigatorjava.util.List<ProfileAction>getListActions(fr.paris.lutece.portal.business.user.AdminUser user, Profile profile, java.lang.String strPermission, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of actionsfr.paris.lutece.util.ReferenceListgetProfilesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of profilesjava.util.List<fr.paris.lutece.portal.business.right.Right>getRightsListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of rights associated to the profilejava.util.List<fr.paris.lutece.portal.business.rbac.RBACRole>getRolesListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of roles associated to the profilejava.util.List<fr.paris.lutece.portal.business.user.AdminUser>getUsersListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of users associated to the profileViewgetViewForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the view associated to the profilejava.util.List<fr.paris.lutece.portal.business.workgroup.AdminWorkgroup>getWorkgroupsListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of workgroups associated to the profilebooleanhasProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if the given user has a given profile or notbooleanhasRight(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given right.booleanhasRole(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given role.booleanhasUser(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given user.booleanhasWorkgroup(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given workgroup.voidremove(java.lang.String strProfileKey, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove the Profile whose identifier is specified in parametervoidremoveProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all profiles associated to an uservoidremoveRightFromProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a right from a profilevoidremoveRights(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all rights from profilevoidremoveRoleFromProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a role from a profilevoidremoveRoles(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all roles from profilevoidremoveUserFromProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a user from a profilevoidremoveUsers(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all users from profilevoidremoveView(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove profile from a viewvoidremoveWorkgroupFromProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a workgroup from a profilevoidremoveWorkgroups(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all workgroups from profileProfileupdate(Profile profile, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)Update of the profile which is specified in parameter
-
-
-
Method Detail
-
getItemNavigator
public fr.paris.lutece.util.html.ItemNavigator getItemNavigator(ProfileFilter pFilter, Profile profile, fr.paris.lutece.util.url.UrlItem url)
Get the item navigator- Specified by:
getItemNavigatorin interfaceIProfilesService- Parameters:
pFilter- the profile filterprofile- the profileurl- the url- Returns:
- the item navigator
-
getListActions
public java.util.List<ProfileAction> getListActions(fr.paris.lutece.portal.business.user.AdminUser user, Profile profile, java.lang.String strPermission, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of actions- Specified by:
getListActionsin interfaceIProfilesService- Parameters:
user- the current userprofile- the profilestrPermission- the permission namelocale- Localeplugin- Plugin- Returns:
- the list of actions
-
doAssignUserToProfile
public void doAssignUserToProfile(int nIdUser, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)Do assign user to a profile- Specified by:
doAssignUserToProfilein interfaceIProfilesService- Parameters:
nIdUser- the id suerrequest- the HTTP requestlocale- the Locale
-
doUnassignUserFromProfile
public void doUnassignUserFromProfile(int nIdUser, java.lang.String strProfileKey, fr.paris.lutece.portal.business.user.AdminUser currentUser, javax.servlet.http.HttpServletRequest request, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)Do unassign user from profile- Specified by:
doUnassignUserFromProfilein interfaceIProfilesService- Parameters:
nIdUser- the id userstrProfileKey- the profile keycurrentUser- the current userrequest- the HTTP requestlocale- the localeplugin- the plugin
-
create
public Profile create(Profile profile, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Creation of an instance of profile- Specified by:
createin interfaceIProfilesService- Parameters:
profile- The instance of the profile which contains the informations to storelocale- the Localeplugin- Plugin- Returns:
- The instance of profile which has been created with its primary key.
-
update
public Profile update(Profile profile, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update of the profile which is specified in parameter- Specified by:
updatein interfaceIProfilesService- Parameters:
profile- The instance of the profile which contains the new data to storelocale- the Localeplugin- Plugin- Returns:
- The instance of the profile which has been updated
-
remove
public void remove(java.lang.String strProfileKey, java.util.Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove the Profile whose identifier is specified in parameter- Specified by:
removein interfaceIProfilesService- Parameters:
strProfileKey- The Profile object to removelocale- the Localeplugin- Plugin
-
findByPrimaryKey
public Profile findByPrimaryKey(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of a profile whose identifier is specified in parameter- Specified by:
findByPrimaryKeyin interfaceIProfilesService- Parameters:
strProfileKey- The key of the profileplugin- Plugin- Returns:
- An instance of profile
-
findAll
public java.util.List<Profile> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns a collection of profiles objects- Specified by:
findAllin interfaceIProfilesService- Parameters:
plugin- Plugin- Returns:
- A collection of profiles
-
findProfilesByFilter
public java.util.List<Profile> findProfilesByFilter(ProfileFilter pFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find profile by filter- Specified by:
findProfilesByFilterin interfaceIProfilesService- Parameters:
pFilter- the Filterplugin- Plugin- Returns:
- List of profiles
-
checkExistProfile
public boolean checkExistProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile already exists or not- Specified by:
checkExistProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin- Returns:
- true if it already exists
-
getProfilesList
public fr.paris.lutece.util.ReferenceList getProfilesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of profiles- Specified by:
getProfilesListin interfaceIProfilesService- Parameters:
plugin- Plugin- Returns:
- the list of profiles
-
checkProfileAttributed
public boolean checkProfileAttributed(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if the profile is attributed to any user- Specified by:
checkProfileAttributedin interfaceIProfilesService- Parameters:
strProfileKey- the profile keyplugin- Plugin- Returns:
- true if it is attributed to at least one user, false otherwise
-
findProfileByIdUser
public java.util.List<Profile> findProfileByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of profiles by a given ID user- Specified by:
findProfileByIdUserin interfaceIProfilesService- Parameters:
nIdUser- the ID userplugin- Plugin- Returns:
- The list of profiles
-
getRightsListForProfile
public java.util.List<fr.paris.lutece.portal.business.right.Right> getRightsListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of rights associated to the profile- Specified by:
getRightsListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of Right
-
hasRight
public boolean hasRight(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given right.- Specified by:
hasRightin interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrIdRight- The Right IDplugin- Plugin- Returns:
- true if the profile has the right, false otherwise
-
addRightForProfile
public void addRightForProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add a right for a profile- Specified by:
addRightForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrIdRight- The Right IDplugin- Plugin
-
removeRightFromProfile
public void removeRightFromProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a right from a profile- Specified by:
removeRightFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrIdRight- The Right IDplugin- Plugin
-
removeRights
public void removeRights(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all rights from profile- Specified by:
removeRightsin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
getWorkgroupsListForProfile
public java.util.List<fr.paris.lutece.portal.business.workgroup.AdminWorkgroup> getWorkgroupsListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of workgroups associated to the profile- Specified by:
getWorkgroupsListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of workgroups
-
hasWorkgroup
public boolean hasWorkgroup(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given workgroup.- Specified by:
hasWorkgroupin interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrWorkgroupKey- The Workgroup keyplugin- Plugin- Returns:
- true if the profile has the workgroup, false otherwise
-
addWorkgroupForProfile
public void addWorkgroupForProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add a workgroup for a profile- Specified by:
addWorkgroupForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrWorkgroupKey- The WorkgroupKeyplugin- Plugin
-
removeWorkgroupFromProfile
public void removeWorkgroupFromProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a workgroup from a profile- Specified by:
removeWorkgroupFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrWorkgroupKey- The Workgroup keyplugin- Plugin
-
removeWorkgroups
public void removeWorkgroups(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all workgroups from profile- Specified by:
removeWorkgroupsin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
getRolesListForProfile
public java.util.List<fr.paris.lutece.portal.business.rbac.RBACRole> getRolesListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of roles associated to the profile- Specified by:
getRolesListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of roles
-
hasRole
public boolean hasRole(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given role.- Specified by:
hasRolein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrRoleKey- The Role keyplugin- Plugin- Returns:
- true if the profile has the role, false otherwise
-
addRoleForProfile
public void addRoleForProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add a role for a profile- Specified by:
addRoleForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrRoleKey- The RoleKeyplugin- Plugin
-
removeRoleFromProfile
public void removeRoleFromProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a role from a profile- Specified by:
removeRoleFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeystrRoleKey- The role keyplugin- Plugin
-
removeRoles
public void removeRoles(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all roles from profile- Specified by:
removeRolesin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
getUsersListForProfile
public java.util.List<fr.paris.lutece.portal.business.user.AdminUser> getUsersListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list of users associated to the profile- Specified by:
getUsersListForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile Keyplugin- Plugin- Returns:
- The list of users
-
hasUser
public boolean hasUser(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if a profile has the given user.- Specified by:
hasUserin interfaceIProfilesService- Parameters:
strProfileKey- The profile KeynIdUser- The User IDplugin- Plugin- Returns:
- true if the profile has the user, false otherwise
-
addUserForProfile
public void addUserForProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Add an user for a profile- Specified by:
addUserForProfilein interfaceIProfilesService- Parameters:
strProfileKey- The profile KeynIdUser- The User IDplugin- Plugin
-
removeUserFromProfile
public void removeUserFromProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove a user from a profile- Specified by:
removeUserFromProfilein interfaceIProfilesService- Parameters:
strProfileKey- The key of the profilenIdUser- The User IDplugin- Plugin
-
removeUsers
public void removeUsers(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all users from profile- Specified by:
removeUsersin interfaceIProfilesService- Parameters:
strProfileKey- The profile keyplugin- Plugin
-
removeProfilesFromUser
public void removeProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove all profiles associated to an user- Specified by:
removeProfilesFromUserin interfaceIProfilesService- Parameters:
nIdUser- The User IDplugin- Plugin
-
hasProfile
public boolean hasProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Check if the given user has a given profile or not- Specified by:
hasProfilein interfaceIProfilesService- Parameters:
strProfileKey- The key of the profilenIdUser- the ID userplugin- Plugin- Returns:
- true if the user has the profile, false otherwise
-
getViewForProfile
public View getViewForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the view associated to the profile- Specified by:
getViewForProfilein interfaceIProfilesService- Parameters:
strProfileKey- the profile keyplugin- Plugin- Returns:
- the view
-
removeView
public void removeView(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Remove profile from a view- Specified by:
removeViewin interfaceIProfilesService- Parameters:
strProfileKey- the profile keyplugin- Plugin
-
-