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

java.lang.Object
  extended by fr.paris.lutece.plugins.profiles.business.ProfileDAO
All Implemented Interfaces:
IProfileDAO

public class ProfileDAO
extends java.lang.Object
implements IProfileDAO

ProfileDAO


Constructor Summary
ProfileDAO()
           
 
Method Summary
 boolean checkExistProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if a profile already exists or not
 boolean checkProfileAttributed(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if the profile is attributed to any user
 void delete(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void deleteProfilesFromUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all profiles associated to an user
 void deleteRightFromProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a right from a profile
 void deleteRights(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all rights from profile
 void deleteRoleFromProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a roles from a profile
 void deleteRoles(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all roles from profile
 void deleteUserFromProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove an user from a profile
 void deleteUsers(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all users from profile
 void deleteView(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove profile from a view
 void deleteWorkgroupFromProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a workgroup from a profile
 void deleteWorkgroups(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all workgroups from profile
 fr.paris.lutece.util.ReferenceList getProfileList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of profiles
 boolean hasProfile(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if the given user has a profile or not
 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.
 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.
 boolean hasUser(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if a profile has the given user.
 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.
 void insert(Profile profile, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 void insertRightForProfile(java.lang.String strProfileKey, java.lang.String strIdRight, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add a right for a profile
 void insertRoleForProfile(java.lang.String strProfileKey, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add a roles for a profile
 void insertUserForProfile(java.lang.String strProfileKey, int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add an user for a profile
 void insertWorkgroupForProfile(java.lang.String strProfileKey, java.lang.String strWorkgroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Add a workgroup for a profile
 Profile load(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of Profile from the table
 Profile selectProfileByIdUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the profiles by a given ID user
 java.util.Collection<Profile> selectProfileList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of profiles
 java.util.Collection<Profile> selectProfilesByFilter(ProfileFilter pFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find profile by filter
 java.util.Collection<fr.paris.lutece.portal.business.right.Right> selectRightsListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of rights associated to the profile
 java.util.Collection<fr.paris.lutece.portal.business.rbac.AdminRole> selectRolesListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of roles associated to the profile
 java.util.Collection<fr.paris.lutece.portal.business.user.AdminUser> selectUsersListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of users associated to the profile
 View selectViewForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the view associated to the profile
 java.util.Collection<fr.paris.lutece.portal.business.workgroup.AdminWorkgroup> selectWorkgroupsListForProfile(java.lang.String strProfileKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of workgroups associated to the profile
 void store(Profile profile, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record identified by the given profile key with the given profile in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileDAO

public ProfileDAO()
Method Detail

insert

public void insert(Profile profile,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IProfileDAO
Parameters:
profile - The profile object
plugin - Plugin

load

public Profile load(java.lang.String strProfileKey,
                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of Profile from the table

Specified by:
load in interface IProfileDAO
Parameters:
strProfileKey - The profile key
plugin - Plugin
Returns:
the instance of the Profile

delete

public void delete(java.lang.String strProfileKey,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete a record from the table

Specified by:
delete in interface IProfileDAO
Parameters:
strProfileKey - The profile key
plugin - Plugin

store

public void store(Profile profile,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record identified by the given profile key with the given profile in the table

Specified by:
store in interface IProfileDAO
Parameters:
profile - The reference of profile to be the new one
plugin - Plugin

selectProfileList

public java.util.Collection<Profile> selectProfileList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of profiles

Specified by:
selectProfileList in interface IProfileDAO
Parameters:
plugin - Plugin
Returns:
The Collection of the profiles

selectProfilesByFilter

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

Specified by:
selectProfilesByFilter in interface IProfileDAO
Parameters:
pFilter - the Filter
plugin - 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:
checkExistProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile key
plugin - Plugin
Returns:
true if it already exists

getProfileList

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

Specified by:
getProfileList in interface IProfileDAO
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:
checkProfileAttributed in interface IProfileDAO
Parameters:
strProfileKey - the profile key
plugin - Plugin
Returns:
true if it is attributed to at least one user, false otherwise

selectProfileByIdUser

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

Specified by:
selectProfileByIdUser in interface IProfileDAO
Parameters:
nIdUser - the ID user
plugin - Plugin
Returns:
a profile

selectRightsListForProfile

public java.util.Collection<fr.paris.lutece.portal.business.right.Right> selectRightsListForProfile(java.lang.String strProfileKey,
                                                                                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of rights associated to the profile

Specified by:
selectRightsListForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
plugin - 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:
hasRight in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strIdRight - The Right ID
plugin - Plugin
Returns:
true if the profile has the right, false otherwise

insertRightForProfile

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

Specified by:
insertRightForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strIdRight - The Right ID
plugin - Plugin

deleteRightFromProfile

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

Specified by:
deleteRightFromProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strIdRight - The Right ID
plugin - Plugin

deleteRights

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

Specified by:
deleteRights in interface IProfileDAO
Parameters:
strProfileKey - The profile key
plugin - Plugin

selectWorkgroupsListForProfile

public java.util.Collection<fr.paris.lutece.portal.business.workgroup.AdminWorkgroup> selectWorkgroupsListForProfile(java.lang.String strProfileKey,
                                                                                                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of workgroups associated to the profile

Specified by:
selectWorkgroupsListForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
plugin - 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:
hasWorkgroup in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strWorkgroupKey - The Workgroup key
plugin - Plugin
Returns:
true if the profile has the workgroup, false otherwise

insertWorkgroupForProfile

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

Specified by:
insertWorkgroupForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strWorkgroupKey - The WorkgroupKey
plugin - Plugin

deleteWorkgroupFromProfile

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

Specified by:
deleteWorkgroupFromProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strWorkgroupKey - The Right ID
plugin - Plugin

deleteWorkgroups

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

Specified by:
deleteWorkgroups in interface IProfileDAO
Parameters:
strProfileKey - The profile key
plugin - Plugin

selectRolesListForProfile

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

Specified by:
selectRolesListForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
plugin - 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:
hasRole in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strRoleKey - The Role key
plugin - Plugin
Returns:
true if the profile has the workgroup, false otherwise

insertRoleForProfile

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

Specified by:
insertRoleForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strRoleKey - The WorkgroupKey
plugin - Plugin

deleteRoleFromProfile

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

Specified by:
deleteRoleFromProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
strRoleKey - The Right ID
plugin - Plugin

deleteRoles

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

Specified by:
deleteRoles in interface IProfileDAO
Parameters:
strProfileKey - The profile key
plugin - Plugin

selectUsersListForProfile

public java.util.Collection<fr.paris.lutece.portal.business.user.AdminUser> selectUsersListForProfile(java.lang.String strProfileKey,
                                                                                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of users associated to the profile

Specified by:
selectUsersListForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
plugin - 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:
hasUser in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
nIdUser - The User ID
plugin - Plugin
Returns:
true if the profile has the user, false otherwise

insertUserForProfile

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

Specified by:
insertUserForProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
nIdUser - The User ID
plugin - Plugin

deleteUserFromProfile

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

Specified by:
deleteUserFromProfile in interface IProfileDAO
Parameters:
strProfileKey - The profile Key
nIdUser - The User ID
plugin - Plugin

deleteUsers

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

Specified by:
deleteUsers in interface IProfileDAO
Parameters:
strProfileKey - The profile key
plugin - Plugin

deleteProfilesFromUser

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

Specified by:
deleteProfilesFromUser in interface IProfileDAO
Parameters:
nIdUser - The User ID
plugin - Plugin

hasProfile

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

Specified by:
hasProfile in interface IProfileDAO
Parameters:
nIdUser - the ID user
plugin - Plugin
Returns:
true if the user has a profile, false otherwise

selectViewForProfile

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

Specified by:
selectViewForProfile in interface IProfileDAO
Parameters:
strProfileKey - the profile key
plugin - Plugin
Returns:
the view

deleteView

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

Specified by:
deleteView in interface IProfileDAO
Parameters:
strProfileKey - the profile key
plugin - Plugin


Copyright © 2011 Mairie de Paris. All Rights Reserved.