fr.paris.lutece.portal.business.workgroup
Class AdminWorkgroupDAO

java.lang.Object
  extended by fr.paris.lutece.portal.business.workgroup.AdminWorkgroupDAO
All Implemented Interfaces:
IAdminWorkgroupDAO

public final class AdminWorkgroupDAO
extends java.lang.Object
implements IAdminWorkgroupDAO

This class provides Data Access methods for AdminWorkgroup objects


Constructor Summary
AdminWorkgroupDAO()
           
 
Method Summary
 boolean checkExistWorkgroup(java.lang.String strWorkgroupKey)
          Check that the given key points to an existing workgroup
 boolean checkUserHasWorkgroup(int nIdUser)
          Is the user member of the workgroup
 void delete(java.lang.String strWorkgroupKey)
          Delete a record from the table
 void deleteAllUsersForWorkgroup(java.lang.String strWorkgroupKey)
          Remove all users of a workgroup
 void deleteUserFromWorkgroup(int nUserId, java.lang.String strWorkgroupKey)
          Remove an user from a workgroup
 java.util.Collection<AdminUser> getUsersListForWorkgroup(java.lang.String strWorkgroupKey)
          Returns the list of all users for a workgroup
 ReferenceList getUserWorkgroups(int nIdUser)
          Returns the list of all workgroups the user is member
 void insert(AdminWorkgroup workgroup)
          Insert a new record in the table.
 void insertUserForWorkgroup(AdminUser user, java.lang.String strWorkgroupKey)
          Insert a user into a workgroup
 boolean isUserInWorkgroup(int nIdUser, java.lang.String strWorkgroupKey)
          Is the user member of the workgroup
 AdminWorkgroup load(java.lang.String strWorkgroupKey)
          Load the data of AdminWorkgroup from the table
 java.util.Collection<AdminWorkgroup> selectWorkgroupList()
          Load the list of workgroups
 void store(AdminWorkgroup workgroup)
          Update the record identified by the given workgroup key with the given workgroup in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminWorkgroupDAO

public AdminWorkgroupDAO()
Method Detail

insert

public void insert(AdminWorkgroup workgroup)
Insert a new record in the table.

Specified by:
insert in interface IAdminWorkgroupDAO
Parameters:
workgroup - The workgroup object

load

public AdminWorkgroup load(java.lang.String strWorkgroupKey)
Load the data of AdminWorkgroup from the table

Specified by:
load in interface IAdminWorkgroupDAO
Parameters:
strWorkgroupKey - The workgroup key
Returns:
the instance of the AdminWorkgroup

delete

public void delete(java.lang.String strWorkgroupKey)
Delete a record from the table

Specified by:
delete in interface IAdminWorkgroupDAO
Parameters:
strWorkgroupKey - The workgroup key

store

public void store(AdminWorkgroup workgroup)
Update the record identified by the given workgroup key with the given workgroup in the table

Specified by:
store in interface IAdminWorkgroupDAO
Parameters:
workgroup - The reference of workgroup to be the new one

selectWorkgroupList

public java.util.Collection<AdminWorkgroup> selectWorkgroupList()
Load the list of workgroups

Specified by:
selectWorkgroupList in interface IAdminWorkgroupDAO
Returns:
The Collection of the Workgroups

checkExistWorkgroup

public boolean checkExistWorkgroup(java.lang.String strWorkgroupKey)
Check that the given key points to an existing workgroup

Specified by:
checkExistWorkgroup in interface IAdminWorkgroupDAO
Parameters:
strWorkgroupKey - The workgroup key
Returns:
true if the workgroup exists, false otherwise

isUserInWorkgroup

public boolean isUserInWorkgroup(int nIdUser,
                                 java.lang.String strWorkgroupKey)
Is the user member of the workgroup

Specified by:
isUserInWorkgroup in interface IAdminWorkgroupDAO
Parameters:
nIdUser - The user Id
strWorkgroupKey - The workgroup key
Returns:
True if the user is in the workgroup, otherwise false

checkUserHasWorkgroup

public boolean checkUserHasWorkgroup(int nIdUser)
Is the user member of the workgroup

Specified by:
checkUserHasWorkgroup in interface IAdminWorkgroupDAO
Parameters:
nIdUser - The user Id
Returns:
True if the user has workgroup

getUserWorkgroups

public ReferenceList getUserWorkgroups(int nIdUser)
Returns the list of all workgroups the user is member

Specified by:
getUserWorkgroups in interface IAdminWorkgroupDAO
Parameters:
nIdUser - The user Id
Returns:
The list of all user's workgroups

getUsersListForWorkgroup

public java.util.Collection<AdminUser> getUsersListForWorkgroup(java.lang.String strWorkgroupKey)
Returns the list of all users for a workgroup

Specified by:
getUsersListForWorkgroup in interface IAdminWorkgroupDAO
Parameters:
strWorkgroupKey - The workgroup key
Returns:
The collection of all users of a workgroup

deleteAllUsersForWorkgroup

public void deleteAllUsersForWorkgroup(java.lang.String strWorkgroupKey)
Remove all users of a workgroup

Specified by:
deleteAllUsersForWorkgroup in interface IAdminWorkgroupDAO
Parameters:
strWorkgroupKey - The workgroup key

insertUserForWorkgroup

public void insertUserForWorkgroup(AdminUser user,
                                   java.lang.String strWorkgroupKey)
Insert a user into a workgroup

Specified by:
insertUserForWorkgroup in interface IAdminWorkgroupDAO
Parameters:
user - The user to insert
strWorkgroupKey - the key workgroup

deleteUserFromWorkgroup

public void deleteUserFromWorkgroup(int nUserId,
                                    java.lang.String strWorkgroupKey)
Remove an user from a workgroup

Specified by:
deleteUserFromWorkgroup in interface IAdminWorkgroupDAO
Parameters:
nUserId - The user ID
strWorkgroupKey - The workgroup key


Copyright © 2010 Mairie de Paris. All Rights Reserved.