fr.paris.lutece.plugins.profiles.business
Class ProfileHome

java.lang.Object
  extended by fr.paris.lutece.plugins.profiles.business.ProfileHome

public final class ProfileHome
extends java.lang.Object

ProfileHome


Method Summary
static void addRightForProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add a right for a profile
static void addRoleForProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add a role for a profile
static void addUserForProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add an user for a profile
static void addWorkgroupForProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add a workgroup for a profile
static boolean checkExistProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if a profile already exists or not
static boolean checkProfileAttributed(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if the profile is attributed to any user
static Profile create(Profile profile, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Creation of an instance of profile
static java.util.Collection<Profile> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns a collection of profiles objects
static 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
static Profile findProfileByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the profile by a given ID user
static java.util.Collection<Profile> findProfilesByFilter(ProfileFilter pFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find profile by filter
static fr.paris.lutece.util.ReferenceList getProfilesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of profiles
static java.util.Collection<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
static java.util.Collection<fr.paris.lutece.portal.business.rbac.AdminRole> getRolesListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of roles associated to the profile
static java.util.Collection<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
static View getViewForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the view associated to the profile
static java.util.Collection<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
static boolean hasProfile(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if the given user has a profile or not
static 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.
static 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.
static boolean hasUser(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if a profile has the given user.
static 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.
static void remove(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the Profile whose identifier is specified in parameter
static void removeProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all profiles associated to an user
static void removeRightFromProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a right from a profile
static void removeRights(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all rights from profile
static void removeRoleFromProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a role from a profile
static void removeRoles(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all roles from profile
static void removeUserFromProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a user from a profile
static void removeUsers(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all users from profile
static void removeView(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove profile from a view
static void removeWorkgroupFromProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a workgroup from a profile
static void removeWorkgroups(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all workgroups from profile
static Profile update(Profile profile, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update of the profile which is specified in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Profile create(Profile profile,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Creation of an instance of profile

Parameters:
profile - The instance of the profile which contains the informations to store
plugin - Plugin
Returns:
The instance of profile which has been created with its primary key.

update

public static Profile update(Profile profile,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update of the profile which is specified in parameter

Parameters:
profile - The instance of the profile which contains the new data to store
plugin - Plugin
Returns:
The instance of the profile which has been updated

remove

public static void remove(java.lang.String strProfileKey,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the Profile whose identifier is specified in parameter

Parameters:
strProfileKey - The Profile object to remove
plugin - Plugin

findByPrimaryKey

public static 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

Parameters:
strProfileKey - The key of the profile
plugin - Plugin
Returns:
An instance of profile

findAll

public static java.util.Collection<Profile> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns a collection of profiles objects

Parameters:
plugin - Plugin
Returns:
A collection of profiles

findProfilesByFilter

public static java.util.Collection<Profile> findProfilesByFilter(ProfileFilter pFilter,
                                                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find profile by filter

Parameters:
pFilter - the Filter
plugin - Plugin
Returns:
List of profiles

checkExistProfile

public static boolean checkExistProfile(java.lang.String strProfileKey,
                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if a profile already exists or not

Parameters:
strProfileKey - The profile key
plugin - Plugin
Returns:
true if it already exists

getProfilesList

public static fr.paris.lutece.util.ReferenceList getProfilesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of profiles

Parameters:
plugin - Plugin
Returns:
the list of profiles

checkProfileAttributed

public static boolean checkProfileAttributed(java.lang.String strProfileKey,
                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if the profile is attributed to any user

Parameters:
strProfileKey - the profile key
plugin - Plugin
Returns:
true if it is attributed to at least one user, false otherwise

findProfileByIdUser

public static Profile findProfileByIdUser(int nIdUser,
                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the profile by a given ID user

Parameters:
nIdUser - the ID user
plugin - Plugin
Returns:
a profile

getRightsListForProfile

public static java.util.Collection<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

Parameters:
strProfileKey - The profile Key
plugin - Plugin
Returns:
The list of Right

hasRight

public static 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.

Parameters:
strProfileKey - The profile Key
strIdRight - The Right ID
plugin - Plugin
Returns:
true if the profile has the right, false otherwise

addRightForProfile

public static void addRightForProfile(java.lang.String strProfileKey,
                                      java.lang.String strIdRight,
                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Add a right for a profile

Parameters:
strProfileKey - The profile Key
strIdRight - The Right ID
plugin - Plugin

removeRightFromProfile

public static void removeRightFromProfile(java.lang.String strProfileKey,
                                          java.lang.String strIdRight,
                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove a right from a profile

Parameters:
strProfileKey - The profile Key
strIdRight - The Right ID
plugin - Plugin

removeRights

public static void removeRights(java.lang.String strProfileKey,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove all rights from profile

Parameters:
strProfileKey - The profile key
plugin - Plugin

getWorkgroupsListForProfile

public static java.util.Collection<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

Parameters:
strProfileKey - The profile Key
plugin - Plugin
Returns:
The list of workgroups

hasWorkgroup

public static 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.

Parameters:
strProfileKey - The profile Key
strWorkgroupKey - The Workgroup key
plugin - Plugin
Returns:
true if the profile has the workgroup, false otherwise

addWorkgroupForProfile

public static void addWorkgroupForProfile(java.lang.String strProfileKey,
                                          java.lang.String strWorkgroupKey,
                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Add a workgroup for a profile

Parameters:
strProfileKey - The profile Key
strWorkgroupKey - The WorkgroupKey
plugin - Plugin

removeWorkgroupFromProfile

public static void removeWorkgroupFromProfile(java.lang.String strProfileKey,
                                              java.lang.String strWorkgroupKey,
                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove a workgroup from a profile

Parameters:
strProfileKey - The profile Key
strWorkgroupKey - The Workgroup key
plugin - Plugin

removeWorkgroups

public static void removeWorkgroups(java.lang.String strProfileKey,
                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove all workgroups from profile

Parameters:
strProfileKey - The profile key
plugin - Plugin

getRolesListForProfile

public static java.util.Collection<fr.paris.lutece.portal.business.rbac.AdminRole> getRolesListForProfile(java.lang.String strProfileKey,
                                                                                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of roles associated to the profile

Parameters:
strProfileKey - The profile Key
plugin - Plugin
Returns:
The list of roles

hasRole

public static 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.

Parameters:
strProfileKey - The profile Key
strRoleKey - The Role key
plugin - Plugin
Returns:
true if the profile has the role, false otherwise

addRoleForProfile

public static void addRoleForProfile(java.lang.String strProfileKey,
                                     java.lang.String strRoleKey,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Add a role for a profile

Parameters:
strProfileKey - The profile Key
strRoleKey - The RoleKey
plugin - Plugin

removeRoleFromProfile

public static void removeRoleFromProfile(java.lang.String strProfileKey,
                                         java.lang.String strRoleKey,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove a role from a profile

Parameters:
strProfileKey - The profile Key
strRoleKey - The role key
plugin - Plugin

removeRoles

public static void removeRoles(java.lang.String strProfileKey,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove all roles from profile

Parameters:
strProfileKey - The profile key
plugin - Plugin

getUsersListForProfile

public static java.util.Collection<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

Parameters:
strProfileKey - The profile Key
plugin - Plugin
Returns:
The list of users

hasUser

public static boolean hasUser(java.lang.String strProfileKey,
                              int nIdUser,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if a profile has the given user.

Parameters:
strProfileKey - The profile Key
nIdUser - The User ID
plugin - Plugin
Returns:
true if the profile has the user, false otherwise

addUserForProfile

public static void addUserForProfile(java.lang.String strProfileKey,
                                     int nIdUser,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Add an user for a profile

Parameters:
strProfileKey - The profile Key
nIdUser - The User ID
plugin - Plugin

removeUserFromProfile

public static void removeUserFromProfile(java.lang.String strProfileKey,
                                         int nIdUser,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove a user from a profile

Parameters:
strProfileKey - The profile Key
nIdUser - The User ID
plugin - Plugin

removeUsers

public static void removeUsers(java.lang.String strProfileKey,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove all users from profile

Parameters:
strProfileKey - The profile key
plugin - Plugin

removeProfilesFromUser

public static void removeProfilesFromUser(int nIdUser,
                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove all profiles associated to an user

Parameters:
nIdUser - The User ID
plugin - Plugin

hasProfile

public static boolean hasProfile(int nIdUser,
                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if the given user has a profile or not

Parameters:
nIdUser - the ID user
plugin - Plugin
Returns:
true if the user has the profile, false otherwise

getViewForProfile

public static View getViewForProfile(java.lang.String strProfileKey,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the view associated to the profile

Parameters:
strProfileKey - the profile key
plugin - Plugin
Returns:
the view

removeView

public static void removeView(java.lang.String strProfileKey,
                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove profile from a view

Parameters:
strProfileKey - the profile key
plugin - Plugin


Copyright © 2011 Mairie de Paris. All Rights Reserved.