org.olat.group.area
Interface BGAreaManager

All Known Implementing Classes:
BGAreaManagerImpl

public interface BGAreaManager

Description:
Manager to handle business group areas. A business group area is used to group areas. A business group can be associated to many areas, an area can have many groups

Initial Date: Aug 25, 2004

Author:
gnaegi

Method Summary
 void addBGToBGArea(BusinessGroup group, BGArea area)
          Add a business group to a business group area.
 boolean checkIfOneOrMoreNameExistsInContext(java.util.Set<java.lang.String> allNames, BGContext bgContext)
          checks if one or more of the given names exists already in the context.
 java.util.Map copyBGAreasOfBGContext(BGContext origBgContext, BGContext targetBgContext)
          Copies all group areas from the original context to the target context.
 int countBGAreasOfBGContext(BGContext groupContext)
          Counts the number of business group areas of the given business group context
 BGArea createAndPersistBGAreaIfNotExists(java.lang.String areaName, java.lang.String description, BGContext groupContext)
          Creates an area object and persists the object in the database only if such an area name does not already exist in this context
 void deleteBGArea(BGArea area)
          Delete the given area form the database
 void deleteBGtoAreaRelations(BusinessGroup group)
          Deletes all business group to area relations from the given business group
 BGArea findBGArea(java.lang.String areaName, BGContext groupContext)
          Finds an area in the given context
 java.util.List findBGAreasOfBGContext(BGContext groupContext)
          Searches for all business group areas in the given business group context
 java.util.List findBGAreasOfBusinessGroup(BusinessGroup group)
          Searches for all business group areas associated with the given business group
 java.util.List findBusinessGroupsOfArea(BGArea area)
          Searches for all business groups that are associated with the given business group area
 java.util.List findBusinessGroupsOfAreaAttendedBy(Identity identity, java.lang.String areaName, BGContext context)
          Searches for all business groups that are associated with the given business group area where the given identity is in the participants group
 boolean isIdentityInBGArea(Identity identity, java.lang.String areaName, BGContext groupContext)
          Checks if an identity is in a business group areas with a given name in the given group context
 BGArea reloadArea(BGArea area)
          Reloads the business group area from the database or the hibernate second level cache
 void removeBGFromArea(BusinessGroup group, BGArea area)
          Remove a business group from a business group area.
 BGArea updateBGArea(BGArea area)
          Update the given area in the database
 

Method Detail

createAndPersistBGAreaIfNotExists

BGArea createAndPersistBGAreaIfNotExists(java.lang.String areaName,
                                         java.lang.String description,
                                         BGContext groupContext)
Creates an area object and persists the object in the database only if such an area name does not already exist in this context

Parameters:
areaName - The visible area name
description - The area description
groupContext - The group context of this area
Returns:
The new area or null if no area has been created

copyBGAreasOfBGContext

java.util.Map copyBGAreasOfBGContext(BGContext origBgContext,
                                     BGContext targetBgContext)
Copies all group areas from the original context to the target context. The method returns a hash map with all original areas as key and the newly created areas as value.

Parameters:
origBgContext - Context containing the orignial areas
targetBgContext - Context where the areas should be created
Returns:
Map mapping the original to the new areas

findBGArea

BGArea findBGArea(java.lang.String areaName,
                  BGContext groupContext)
Finds an area in the given context

Parameters:
areaName -
groupContext -
Returns:
The area or null if the area does not exists

updateBGArea

BGArea updateBGArea(BGArea area)
Update the given area in the database

Parameters:
area -
Returns:
the updated area

deleteBGArea

void deleteBGArea(BGArea area)
Delete the given area form the database

Parameters:
area -

addBGToBGArea

void addBGToBGArea(BusinessGroup group,
                   BGArea area)
Add a business group to a business group area. Does not check it this relationship does already exists. Check this prior to using this method.

Parameters:
group -
area -

removeBGFromArea

void removeBGFromArea(BusinessGroup group,
                      BGArea area)
Remove a business group from a business group area. If no such relation exists, the mehthod does nothing.

Parameters:
group -
area -

deleteBGtoAreaRelations

void deleteBGtoAreaRelations(BusinessGroup group)
Deletes all business group to area relations from the given business group

Parameters:
group -

findBusinessGroupsOfArea

java.util.List findBusinessGroupsOfArea(BGArea area)
Searches for all business groups that are associated with the given business group area

Parameters:
area -
Returns:
A list of business groups

findBusinessGroupsOfAreaAttendedBy

java.util.List findBusinessGroupsOfAreaAttendedBy(Identity identity,
                                                  java.lang.String areaName,
                                                  BGContext context)
Searches for all business groups that are associated with the given business group area where the given identity is in the participants group

Parameters:
identity -
areaName -
context -
Returns:
A list of business groups

findBGAreasOfBusinessGroup

java.util.List findBGAreasOfBusinessGroup(BusinessGroup group)
Searches for all business group areas associated with the given business group

Parameters:
group -
Returns:
A list of business group area

countBGAreasOfBGContext

int countBGAreasOfBGContext(BGContext groupContext)
Counts the number of business group areas of the given business group context

Parameters:
groupContext -
Returns:
Number of business gropu areas

findBGAreasOfBGContext

java.util.List findBGAreasOfBGContext(BGContext groupContext)
Searches for all business group areas in the given business group context

Parameters:
groupContext -
Returns:
A list of business group areas

isIdentityInBGArea

boolean isIdentityInBGArea(Identity identity,
                           java.lang.String areaName,
                           BGContext groupContext)
Checks if an identity is in a business group areas with a given name in the given group context

Parameters:
identity -
areaName -
groupContext -
Returns:
true if identity is in such an area, false otherwhise

reloadArea

BGArea reloadArea(BGArea area)
Reloads the business group area from the database or the hibernate second level cache

Parameters:
area -
Returns:
The reloaded area

checkIfOneOrMoreNameExistsInContext

boolean checkIfOneOrMoreNameExistsInContext(java.util.Set<java.lang.String> allNames,
                                            BGContext bgContext)
checks if one or more of the given names exists already in the context.

Parameters:
allNames -
bgContext -
Returns: