public List<CmsGroup> getGroups(
        CmsRequestContext context,
        CmsOrganizationalUnit orgUnit,
        boolean includeSubOus,
        boolean readRoles)
    throws CmsException {

        List<CmsGroup> result = null;
        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        try {
            result = m_driverManager.getGroups(dbc, orgUnit, includeSubOus, readRoles);
        } catch (Exception e) {
            dbc.report(null, Messages.get().container(Messages.ERR_READ_ORGUNIT_GROUPS_1, orgUnit.getName()), e);
        } finally {
            dbc.clear();
        }
        return result;
    }
public List < CmsGroup > getGroups ( CmsRequestContext context , CmsOrganizationalUnit orgUnit , boolean includeSubOus , boolean readRoles ) throws CmsException { List < CmsGroup > result = null ; CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { result = m_driverManager . getGroups ( dbc , orgUnit , includeSubOus , readRoles ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_ORGUNIT_GROUPS_1 , orgUnit . getName ( ) ) , e ) ; } finally { dbc . clear ( ) ; } return result ; }
Returns all groups of the given organizational unit.<p>

@param context the current request context
@param orgUnit the organizational unit to get the groups for
@param includeSubOus if all groups of sub-organizational units should be retrieved too
@param readRoles if to read roles or groups

@return all <code>{@link CmsGroup}</code> objects in the organizational unit

@throws CmsException if operation was not successful

@see org.opencms.security.CmsOrgUnitManager#getResourcesForOrganizationalUnit(CmsObject, String)
@see org.opencms.security.CmsOrgUnitManager#getGroups(CmsObject, String, boolean)
@see org.opencms.security.CmsOrgUnitManager#getUsers(CmsObject, String, boolean)