org.olat.group
Interface BusinessGroupManager

All Known Implementing Classes:
BusinessGroupManagerImpl

public interface BusinessGroupManager

Description:
Workflows within BusinessGroupManager:

Initial Date: Jul 27, 2004

Author:
patrick

Method Summary
 void addOwnerAndFireEvent(Identity ureqIdentity, Identity identity, BusinessGroup group, BGConfigFlags flags, boolean doOnlyPostAddingStuff)
          Adds a user to a group as owner and does all the magic that needs to be done: - add to secgroup (optional) - add to jabber roster - fire multi user event
 BusinessGroupAddResponse addOwnersAndFireEvent(Identity ureqIdentity, java.util.List<Identity> addIdentities, BusinessGroup currBusinessGroup, BGConfigFlags flags)
          Add a list of identity as owner to a business-group.
 void addParticipantAndFireEvent(Identity ureqIdentity, Identity identity, BusinessGroup group, BGConfigFlags flags, boolean doOnlyPostAddingStuff)
          Adds a user to a group as participant and does all the magic that needs to be done: - add to secgroup (optional) - add to jabber roster - fire multi user event
 BusinessGroupAddResponse addParticipantsAndFireEvent(Identity ureqIdentity, java.util.List<Identity> addIdentities, BusinessGroup currBusinessGroup, BGConfigFlags flags)
          Add a list of identity as participant to a business-group.
 void addToWaitingListAndFireEvent(Identity ureqIdentity, Identity identity, BusinessGroup group, boolean b)
          Adds a user to a waiting-list of a group and does all the magic that needs to be done: - add to secgroup (optional) - add to jabber roster - send notification email - fire multi user event
 BusinessGroupAddResponse addToWaitingListAndFireEvent(Identity ureqIdentity, java.util.List<Identity> addIdentities, BusinessGroup currBusinessGroup, BGConfigFlags flags)
          Add a list of identity to waiting-list of a business-group.
 void archiveGroups(BGContext context, java.io.File exportFile)
           
 BusinessGroup copyBusinessGroup(BusinessGroup sourceBusinessGroup, java.lang.String targetName, java.lang.String targetDescription, java.lang.Integer targetMin, java.lang.Integer targetMax, BGContext targetBgContext, java.util.Map areaLookupMap, boolean copyAreas, boolean copyCollabToolConfig, boolean copyRights, boolean copyOwners, boolean copyParticipants, boolean copyMemberVisibility, boolean copyWaitingList)
          Create and persist a new business group based on a source group.
 BusinessGroup createAndPersistBusinessGroup(java.lang.String type, Identity identity, java.lang.String name, java.lang.String description, java.lang.Integer minParticipants, java.lang.Integer maxParticipants, java.lang.Boolean enableWaitinglist, java.lang.Boolean enableAutoCloseRanks, BGContext groupContext)
          create a persistent BusinessGroup of the specified type and the provided parameters.
 java.util.Set<BusinessGroup> createUniqueBusinessGroupsFor(java.util.Set<java.lang.String> allNames, BGContext bgContext, java.lang.String bgDesc, java.lang.Integer bgMin, java.lang.Integer bgMax, java.lang.Boolean enableWaitinglist, java.lang.Boolean enableAutoCloseRanks)
          Creates business-groups with certain name when no group in a given BGContext with this names already exists.
 void deleteBusinessGroup(BusinessGroup businessGroupTodelete)
          delete a businessgroup from the persistence store
 void deleteBusinessGroups(java.util.List businessGroups)
          delete all business groups from this list
 void deleteBusinessGroupWithMail(BusinessGroup businessGroupTodelete, WindowControl wControl, UserRequest ureq, Translator trans, java.util.List contactLists)
          delete a business group and send a mail to all users in the group
 void exportGroup(BusinessGroup businessGroup, java.io.File file)
           
 void exportGroups(BGContext context, java.io.File fExportFile)
          Export group definitions to file.
 java.util.List findBusinessGroupsAttendedBy(java.lang.String type, Identity identity, BGContext bgContext)
          find the list of BuddyGroups associated with the supplied identity, where the identity is a Participiant.
 java.util.List findBusinessGroupsOwnedBy(java.lang.String type, Identity identity, BGContext bgContext)
          find the BusinessGroups list of type type associated with the supplied identity, where the identity is an Owner.
 java.util.List findBusinessGroupsWithWaitingListAttendedBy(java.lang.String groupType, Identity identity, BGContext bgContext)
          Find all business-groups where the idenity is on the waiting-list.
 java.util.List getAllBusinessGroups()
          Get all business-groups.
 java.util.List<java.lang.String> getDependingDeletablableListFor(BusinessGroup currentGroup, java.util.Locale locale)
           
 int getPositionInWaitingListFor(Identity identity, BusinessGroup businessGroup)
          Get postion of an idenity on a certain waiting-list
 void importGroups(BGContext context, java.io.File fGroupExportXML)
          Import previousely exported group definitions.
 boolean isIdentityInBusinessGroup(Identity identity, BusinessGroup businessGroup)
           
 boolean isIdentityInBusinessGroup(Identity identity, java.lang.String groupName, BGContext groupContext)
          Checks if an identity is in a specific business group, either as owner or as participant
 BusinessGroup loadBusinessGroup(BusinessGroup currBusinessGroup)
           
 BusinessGroup loadBusinessGroup(java.lang.Long groupKey, boolean strict)
           
 BusinessGroupAddResponse moveIdenityFromWaitingListToParticipant(java.util.List<Identity> identities, Identity ureqIdentity, BusinessGroup currBusinessGroup, BGConfigFlags flags)
          Move users from a waiting-list to participant-list.
 void registerDeletableGroupDataListener(DeletableGroupData listener)
          Extension-point method to register objects which have deletable group-data.
 void removeFromWaitingListAndFireEvent(Identity ureqIdentity, Identity identity, BusinessGroup waitingListGroup, boolean b)
          Remove a user from a waiting-list as participant and does all the magic that needs to be done: - remove from secgroup (optional) send notification email - fire multi user event
 void removeFromWaitingListAndFireEvent(Identity ureqIdentity, java.util.List<Identity> identities, BusinessGroup currBusinessGroup, BGConfigFlags flags)
          Remove a list of identity from waiting-list of a business-group.
 void removeOwnerAndFireEvent(Identity ureqIdentity, Identity identity, BusinessGroup group, BGConfigFlags flags, boolean doOnlyPostRemovingStuff)
          Remove a user from a group as owner and does all the magic that needs to be done: - remove from secgroup (optional) - remove from jabber roster - fire multi user event
 void removeOwnersAndFireEvent(Identity ureqIdentity, java.util.List<Identity> addIdentities, BusinessGroup currBusinessGroup, BGConfigFlags flags)
          Remove a list of identity as owner from a business-group.
 void removeParticipantAndFireEvent(Identity ureqIdentity, Identity identity, BusinessGroup group, BGConfigFlags flags, boolean doOnlyPostRemovingStuff)
          Remove a user from a group as participant and does all the magic that needs to be done: - remove from secgroup (optional) - remove from jabber roster - fire multi user event
 void removeParticipantsAndFireEvent(Identity ureqIdentity, java.util.List<Identity> identities, BusinessGroup currBusinessGroup, BGConfigFlags flags)
          Remove a list of identity as participant from a business-group.
 void setLastUsageFor(BusinessGroup currBusinessGroup)
          Set certain business-group as active (set last-usage and delete time stamp for 'SEND_DELETE_EMAIL_ACTION' in LifeCycleManager):
 void updateBusinessGroup(BusinessGroup updatedBusinessGroup)
          commit the changes on a BusinessGroup instance to the persistence store
 

Method Detail

createAndPersistBusinessGroup

BusinessGroup createAndPersistBusinessGroup(java.lang.String type,
                                            Identity identity,
                                            java.lang.String name,
                                            java.lang.String description,
                                            java.lang.Integer minParticipants,
                                            java.lang.Integer maxParticipants,
                                            java.lang.Boolean enableWaitinglist,
                                            java.lang.Boolean enableAutoCloseRanks,
                                            BGContext groupContext)
create a persistent BusinessGroup of the specified type and the provided parameters. The BusinessGroup can have a waiting-list.

Parameters:
type - see BusinessGroup four TYPE constants
identity -
name -
description -
minParticipants - Minimum num of participants, null if undefined.
maxParticipants - Maximum number of participants, null if undefined.
groupContext - the group context or null if no context (e.g. buddy groups)
enableWaitinglist -
enableAutoCloseRanks -
Returns:
the created BusinessGroup

findBusinessGroupsOwnedBy

java.util.List findBusinessGroupsOwnedBy(java.lang.String type,
                                         Identity identity,
                                         BGContext bgContext)
find the BusinessGroups list of type type associated with the supplied identity, where the identity is an Owner.

Parameters:
type - Restrict find to this group type or null if not restricted to a specific type
identity -
bgContext - Context or null if no context restriction should be applied
Returns:
list of BusinessGroups, may be an empty list.

findBusinessGroupsAttendedBy

java.util.List findBusinessGroupsAttendedBy(java.lang.String type,
                                            Identity identity,
                                            BGContext bgContext)
find the list of BuddyGroups associated with the supplied identity, where the identity is a Participiant.

Parameters:
type - Restrict find to this group type or null if not restricted to a specific type
identity -
bgContext - Context or null if no context restriction should be applied
Returns:
list of BuddyGroups, may be an empty list.

updateBusinessGroup

void updateBusinessGroup(BusinessGroup updatedBusinessGroup)
commit the changes on a BusinessGroup instance to the persistence store

Parameters:
updatedBusinessGroup -

deleteBusinessGroup

void deleteBusinessGroup(BusinessGroup businessGroupTodelete)
delete a businessgroup from the persistence store

Parameters:
businessGroupTodelete -

deleteBusinessGroupWithMail

void deleteBusinessGroupWithMail(BusinessGroup businessGroupTodelete,
                                 WindowControl wControl,
                                 UserRequest ureq,
                                 Translator trans,
                                 java.util.List contactLists)
delete a business group and send a mail to all users in the group

Parameters:
businessGroupTodelete -
wControl -
ureq -
trans -
contactLists -

deleteBusinessGroups

void deleteBusinessGroups(java.util.List businessGroups)
delete all business groups from this list

Parameters:
businessGroups -

isIdentityInBusinessGroup

boolean isIdentityInBusinessGroup(Identity identity,
                                  java.lang.String groupName,
                                  BGContext groupContext)
Checks if an identity is in a specific business group, either as owner or as participant

Parameters:
identity - The Identity
groupName - The group name
groupContext - The group context or null if group does not belong to a group context (e.g. buddygroups)
Returns:
true if identity is in group, false otherwhise

isIdentityInBusinessGroup

boolean isIdentityInBusinessGroup(Identity identity,
                                  BusinessGroup businessGroup)
Parameters:
identity -
businessGroup -
Returns:
true if the given identity is in one or both security groups (participants, owners)

loadBusinessGroup

BusinessGroup loadBusinessGroup(BusinessGroup currBusinessGroup)
Parameters:
currBusinessGroup -
Returns:
The reloaded group

loadBusinessGroup

BusinessGroup loadBusinessGroup(java.lang.Long groupKey,
                                boolean strict)
Parameters:
groupKey - The group database key
strict - true: will throw exception if load failed false: will return null if not found
Returns:
THe loaded group

copyBusinessGroup

BusinessGroup copyBusinessGroup(BusinessGroup sourceBusinessGroup,
                                java.lang.String targetName,
                                java.lang.String targetDescription,
                                java.lang.Integer targetMin,
                                java.lang.Integer targetMax,
                                BGContext targetBgContext,
                                java.util.Map areaLookupMap,
                                boolean copyAreas,
                                boolean copyCollabToolConfig,
                                boolean copyRights,
                                boolean copyOwners,
                                boolean copyParticipants,
                                boolean copyMemberVisibility,
                                boolean copyWaitingList)
Create and persist a new business group based on a source group.

Parameters:
sourceBusinessGroup - The group that will be used as the source group and everything
targetName -
targetDescription -
targetMin -
targetMax -
targetBgContext - The group context that the target group will be related to
areaLookupMap - The area lookup map (the target group will references mapped areas) or null (target group will reference the same areas as the original group)
copyAreas -
copyCollabToolConfig -
copyRights -
copyOwners -
copyParticipants -
copyMemberVisibility -
Returns:
BusinessGroup the copied group

addOwnerAndFireEvent

void addOwnerAndFireEvent(Identity ureqIdentity,
                          Identity identity,
                          BusinessGroup group,
                          BGConfigFlags flags,
                          boolean doOnlyPostAddingStuff)
Adds a user to a group as owner and does all the magic that needs to be done: - add to secgroup (optional) - add to jabber roster - fire multi user event

Parameters:
wControl -
ureq - the user request of the user who initiates the action
trans - used for mail text
identity - the user who should be added
group -
flags - the group configuration flag
logger - the user activity logger or null if nothing should be logged
doOnlyPostAddingStuff - true: user has already been added to the security group, do only the other stuff, false: add user to security group first

addParticipantAndFireEvent

void addParticipantAndFireEvent(Identity ureqIdentity,
                                Identity identity,
                                BusinessGroup group,
                                BGConfigFlags flags,
                                boolean doOnlyPostAddingStuff)
Adds a user to a group as participant and does all the magic that needs to be done: - add to secgroup (optional) - add to jabber roster - fire multi user event

Parameters:
wControl -
ureq - the user request of the user who initiates the action
trans - used for mail text
identity - the user who should be added
group -
flags - the group configuration flag
logger - the user activity logger or null if nothing should be logged
doOnlyPostAddingStuff - true: user has already been added to the security group, do only the other stuff, false: add user to security group first

removeOwnerAndFireEvent

void removeOwnerAndFireEvent(Identity ureqIdentity,
                             Identity identity,
                             BusinessGroup group,
                             BGConfigFlags flags,
                             boolean doOnlyPostRemovingStuff)
Remove a user from a group as owner and does all the magic that needs to be done: - remove from secgroup (optional) - remove from jabber roster - fire multi user event

Parameters:
wControl -
ureq - the user request of the user who initiates the action
trans - used for mail text
identity - the user who should be removed
group -
flags - the group configuration flag
logger - the user activity logger or null if nothing should be logged
doOnlyPostRemovingStuff - true: user has already been removed from the security group, do only the other stuff, false: remove user from security group first

removeParticipantAndFireEvent

void removeParticipantAndFireEvent(Identity ureqIdentity,
                                   Identity identity,
                                   BusinessGroup group,
                                   BGConfigFlags flags,
                                   boolean doOnlyPostRemovingStuff)
Remove a user from a group as participant and does all the magic that needs to be done: - remove from secgroup (optional) - remove from jabber roster - fire multi user event

Parameters:
wControl -
ureq - the user request of the user who initiates the action
trans - used for mail text
identity - the user who should be removed
group -
flags - the group configuration flag
logger - the user activity logger or null if nothing should be logged
doOnlyPostRemovingStuff - true: user has already been removed from the security group, do only the other stuff, false: remove user from security group first

exportGroups

void exportGroups(BGContext context,
                  java.io.File fExportFile)
Export group definitions to file.

Parameters:
context -
fExportFile -

importGroups

void importGroups(BGContext context,
                  java.io.File fGroupExportXML)
Import previousely exported group definitions.

Parameters:
context -
fGroupExportXML -

addToWaitingListAndFireEvent

void addToWaitingListAndFireEvent(Identity ureqIdentity,
                                  Identity identity,
                                  BusinessGroup group,
                                  boolean b)
Adds a user to a waiting-list of a group and does all the magic that needs to be done: - add to secgroup (optional) - add to jabber roster - send notification email - fire multi user event

Parameters:
wControl -
ureq - the user request of the user who initiates the action
trans - used for mail text
identity - the user who should be added
group -
flags - the group configuration flag
logger - the user activity logger or null if nothing should be logged
doOnlyPostAddingStuff - true: user has already been added to the security group, do only the other stuff, false: add user to security group first

removeFromWaitingListAndFireEvent

void removeFromWaitingListAndFireEvent(Identity ureqIdentity,
                                       Identity identity,
                                       BusinessGroup waitingListGroup,
                                       boolean b)
Remove a user from a waiting-list as participant and does all the magic that needs to be done: - remove from secgroup (optional) send notification email - fire multi user event

Parameters:
wControl -
ureq - the user request of the user who initiates the action
trans - used for mail text
identity - the user who should be removed
group -
flags - the group configuration flag
logger - the user activity logger or null if nothing should be logged
doOnlyPostRemovingStuff - true: user has already been removed from the security group, do only the other stuff, false: remove user from security group first

moveIdenityFromWaitingListToParticipant

BusinessGroupAddResponse moveIdenityFromWaitingListToParticipant(java.util.List<Identity> identities,
                                                                 Identity ureqIdentity,
                                                                 BusinessGroup currBusinessGroup,
                                                                 BGConfigFlags flags)
Move users from a waiting-list to participant-list.

Parameters:
identities -
windowControl -
ureq -
translator -
currBusinessGroup -
flags -
userActivityLogger -

findBusinessGroupsWithWaitingListAttendedBy

java.util.List findBusinessGroupsWithWaitingListAttendedBy(java.lang.String groupType,
                                                           Identity identity,
                                                           BGContext bgContext)
Find all business-groups where the idenity is on the waiting-list.

Parameters:
groupType -
identity -
bgContext -
Returns:
List of BusinessGroup objects

getPositionInWaitingListFor

int getPositionInWaitingListFor(Identity identity,
                                BusinessGroup businessGroup)
Get postion of an idenity on a certain waiting-list

Parameters:
identity -
businessGroup -
Returns:
0=not found on waiting-list

getAllBusinessGroups

java.util.List getAllBusinessGroups()
Get all business-groups.

Returns:
List of BusinessGroup objects

addOwnersAndFireEvent

BusinessGroupAddResponse addOwnersAndFireEvent(Identity ureqIdentity,
                                               java.util.List<Identity> addIdentities,
                                               BusinessGroup currBusinessGroup,
                                               BGConfigFlags flags)
Add a list of identity as owner to a business-group.

Parameters:
ureqIdentity - This identity triggered the method (typically identity of user-request).
addIdentities - List of identity
currBusinessGroup - Add list of identity to this business-group.
flags - Business-group configuration flags.
userActivityLogger - Use this logger to log event.
Returns:

addParticipantsAndFireEvent

BusinessGroupAddResponse addParticipantsAndFireEvent(Identity ureqIdentity,
                                                     java.util.List<Identity> addIdentities,
                                                     BusinessGroup currBusinessGroup,
                                                     BGConfigFlags flags)
Add a list of identity as participant to a business-group.

Parameters:
ureqIdentity - This identity triggered the method (typically identity of user-request).
addIdentities - List of identity
currBusinessGroup - Add list of identity to this business-group.
flags - Business-group configuration flags.
userActivityLogger - Use this logger to log event.
Returns:

removeOwnersAndFireEvent

void removeOwnersAndFireEvent(Identity ureqIdentity,
                              java.util.List<Identity> addIdentities,
                              BusinessGroup currBusinessGroup,
                              BGConfigFlags flags)
Remove a list of identity as owner from a business-group.

Parameters:
ureqIdentity - This identity triggered the method (typically identity of user-request).
addIdentities - List of identity
currBusinessGroup - Remove list of identity from this business-group.
flags - Business-group configuration flags.
userActivityLogger - Use this logger to log event.

removeParticipantsAndFireEvent

void removeParticipantsAndFireEvent(Identity ureqIdentity,
                                    java.util.List<Identity> identities,
                                    BusinessGroup currBusinessGroup,
                                    BGConfigFlags flags)
Remove a list of identity as participant from a business-group.

Parameters:
ureqIdentity - This identity triggered the method (typically identity of user-request).
identities - List of identity
currBusinessGroup - Remove list of identity from this business-group.
flags - Business-group configuration flags.
userActivityLogger - Use this logger to log event.

addToWaitingListAndFireEvent

BusinessGroupAddResponse addToWaitingListAndFireEvent(Identity ureqIdentity,
                                                      java.util.List<Identity> addIdentities,
                                                      BusinessGroup currBusinessGroup,
                                                      BGConfigFlags flags)
Add a list of identity to waiting-list of a business-group.

Parameters:
ureqIdentity - This identity triggered the method (typically identity of user-request).
addIdentities - List of identity
currBusinessGroup - Add list of identity to this business-group.
flags - Business-group configuration flags.
userActivityLogger - Use this logger to log event.
Returns:

removeFromWaitingListAndFireEvent

void removeFromWaitingListAndFireEvent(Identity ureqIdentity,
                                       java.util.List<Identity> identities,
                                       BusinessGroup currBusinessGroup,
                                       BGConfigFlags flags)
Remove a list of identity from waiting-list of a business-group.

Parameters:
ureqIdentity - This identity triggered the method (typically identity of user-request).
identities - List of identity
currBusinessGroup - Remove list of identity from this business-group.
flags - Business-group configuration flags.
userActivityLogger - Use this logger to log event.

exportGroup

void exportGroup(BusinessGroup businessGroup,
                 java.io.File file)

archiveGroups

void archiveGroups(BGContext context,
                   java.io.File exportFile)

setLastUsageFor

void setLastUsageFor(BusinessGroup currBusinessGroup)
Set certain business-group as active (set last-usage and delete time stamp for 'SEND_DELETE_EMAIL_ACTION' in LifeCycleManager):

Parameters:
currBusinessGroup -

createUniqueBusinessGroupsFor

java.util.Set<BusinessGroup> createUniqueBusinessGroupsFor(java.util.Set<java.lang.String> allNames,
                                                           BGContext bgContext,
                                                           java.lang.String bgDesc,
                                                           java.lang.Integer bgMin,
                                                           java.lang.Integer bgMax,
                                                           java.lang.Boolean enableWaitinglist,
                                                           java.lang.Boolean enableAutoCloseRanks)
Creates business-groups with certain name when no group in a given BGContext with this names already exists.

Parameters:
allNames -
bgContext -
bgDesc -
bgMin -
bgMax -
enableWaitinglist -
enableAutoCloseRanks -
Returns:
Returns list of created business-groups or null if any groups-name already exist.

registerDeletableGroupDataListener

void registerDeletableGroupDataListener(DeletableGroupData listener)
Extension-point method to register objects which have deletable group-data. Listener will be called in method deleteBusinessGroup.

Parameters:
listener -

getDependingDeletablableListFor

java.util.List<java.lang.String> getDependingDeletablableListFor(BusinessGroup currentGroup,
                                                                 java.util.Locale locale)