|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.security.CmsOrgUnitManager
public class CmsOrgUnitManager
This manager provide access to the organizational unit related operations.
Constructor Summary | |
---|---|
CmsOrgUnitManager(CmsSecurityManager securityManager)
Default constructor. |
Method Summary | |
---|---|
void |
addResourceToOrgUnit(CmsObject cms,
java.lang.String ouFqn,
java.lang.String resourceName)
Adds a resource to the given organizational unit. |
CmsOrganizationalUnit |
createOrganizationalUnit(CmsObject cms,
java.lang.String ouFqn,
java.lang.String description,
int flags,
java.lang.String resourceName)
Creates a new organizational unit. |
void |
deleteOrganizationalUnit(CmsObject cms,
java.lang.String ouFqn)
Deletes an organizational unit. |
java.util.List |
getAllAccessibleProjects(CmsObject cms,
java.lang.String ouFqn,
boolean includeSubOus)
Returns all accessible projects of the given organizational unit. |
java.util.List |
getAllManageableProjects(CmsObject cms,
java.lang.String ouFqn,
boolean includeSubOus)
Returns all manageable projects of the given organizational unit. |
java.util.List |
getGroups(CmsObject cms,
java.lang.String ouFqn,
boolean includeSubOus)
Returns all groups of the given organizational unit. |
java.util.List |
getOrganizationalUnits(CmsObject cms,
java.lang.String ouFqn,
boolean includeChildren)
Returns all child organizational units of the given parent organizational unit including hierarchical deeper organization units if needed. |
java.util.List |
getResourcesForOrganizationalUnit(CmsObject cms,
java.lang.String ouFqn)
Returns all resources of the given organizational unit. |
java.util.List |
getUsers(CmsObject cms,
java.lang.String ouFqn,
boolean recursive)
Returns all users of the given organizational unit. |
CmsOrganizationalUnit |
readOrganizationalUnit(CmsObject cms,
java.lang.String ouFqn)
Reads an organizational Unit based on its fully qualified name. |
void |
removeResourceFromOrgUnit(CmsObject cms,
java.lang.String ouFqn,
java.lang.String resourceName)
Removes a resource from the given organizational unit. |
void |
setUsersOrganizationalUnit(CmsObject cms,
java.lang.String ouFqn,
java.lang.String userName)
Moves an user to the given organizational unit. |
void |
writeOrganizationalUnit(CmsObject cms,
CmsOrganizationalUnit organizationalUnit)
Writes an already existing organizational unit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsOrgUnitManager(CmsSecurityManager securityManager)
securityManager
- the security managerMethod Detail |
---|
public void addResourceToOrgUnit(CmsObject cms, java.lang.String ouFqn, java.lang.String resourceName) throws CmsException
cms
- the opencms contextouFqn
- the full qualified name of the organizational unit to add the resource toresourceName
- the name of the resource that is to be added to the organizational unit
CmsException
- if something goes wrongpublic CmsOrganizationalUnit createOrganizationalUnit(CmsObject cms, java.lang.String ouFqn, java.lang.String description, int flags, java.lang.String resourceName) throws CmsException
The parent structure must exist.
cms
- the opencms contextouFqn
- the fully qualified name of the new organizational unitdescription
- the description of the new organizational unitflags
- the flags for the new organizational unitresourceName
- the first associated resource
CmsOrganizationalUnit
object representing
the newly created organizational unit
CmsException
- if operation was not successfulpublic void deleteOrganizationalUnit(CmsObject cms, java.lang.String ouFqn) throws CmsException
Only organizational units that contain no sub units can be deleted.
The organizational unit can not be delete if it is used in the request context, or if the current user belongs to it.
All users and groups in the given organizational unit will be deleted.
cms
- the opencms contextouFqn
- the fully qualified name of the organizational unit to delete
CmsException
- if operation was not successfulpublic java.util.List getAllAccessibleProjects(CmsObject cms, java.lang.String ouFqn, boolean includeSubOus) throws CmsException
cms
- the opencms contextouFqn
- the fully qualified name of the organizational unit to get projects forincludeSubOus
- if all projects of sub-organizational units should be retrieved too
CmsProject
objects in the organizational unit
CmsException
- if operation was not successfulpublic java.util.List getAllManageableProjects(CmsObject cms, java.lang.String ouFqn, boolean includeSubOus) throws CmsException
That is all projects which are owned by the current user or which are manageable for the group of the user.
cms
- the opencms contextouFqn
- the fully qualified name of the organizational unit to get projects forincludeSubOus
- if all projects of sub-organizational units should be retrieved too
CmsProject
objects in the organizational unit
CmsException
- if operation was not successfulpublic java.util.List getGroups(CmsObject cms, java.lang.String ouFqn, boolean includeSubOus) throws CmsException
cms
- the opencms contextouFqn
- the fully qualified name of the organizational unit to get all principals forincludeSubOus
- if all groups of sub-organizational units should be retrieved too
CmsGroup
objects in the organizational unit
CmsException
- if operation was not successfulpublic java.util.List getOrganizationalUnits(CmsObject cms, java.lang.String ouFqn, boolean includeChildren) throws CmsException
cms
- the opencms contextouFqn
- the fully qualified name of the parent organizational unitincludeChildren
- if hierarchical deeper organization units should also be returned
CmsOrganizationalUnit
objects
CmsException
- if operation was not successfulpublic java.util.List getResourcesForOrganizationalUnit(CmsObject cms, java.lang.String ouFqn) throws CmsException
cms
- the opencms contextouFqn
- the fully qualified name of the organizational unit to get all resources for
CmsResource
objects in the organizational unit
CmsException
- if operation was not successfulpublic java.util.List getUsers(CmsObject cms, java.lang.String ouFqn, boolean recursive) throws CmsException
cms
- the opencms contextouFqn
- the fully qualified name of the organizational unit to get all principals forrecursive
- if all users of sub-organizational units should be retrieved too
CmsUser
objects in the organizational unit
CmsException
- if operation was not successfulpublic CmsOrganizationalUnit readOrganizationalUnit(CmsObject cms, java.lang.String ouFqn) throws CmsException
cms
- the opencms contextouFqn
- the fully qualified name of the organizational Unit to be read
CmsException
- if something goes wrongpublic void removeResourceFromOrgUnit(CmsObject cms, java.lang.String ouFqn, java.lang.String resourceName) throws CmsException
cms
- the opencms contextouFqn
- the fully qualified name of the organizational unit to remove the resource fromresourceName
- the name of the resource that is to be removed from the organizational unit
CmsException
- if something goes wrongpublic void setUsersOrganizationalUnit(CmsObject cms, java.lang.String ouFqn, java.lang.String userName) throws CmsException
cms
- the opencms contextouFqn
- the full qualified name of the organizational unit to add the user touserName
- the name of the user that is to be added to the organizational unit
CmsException
- if something goes wrongpublic void writeOrganizationalUnit(CmsObject cms, CmsOrganizationalUnit organizationalUnit) throws CmsException
The organizational unit has to be a valid OpenCms organizational unit.
The organizational unit will be completely overridden by the given data.
cms
- the opencms contextorganizationalUnit
- the organizational unit that should be written
CmsException
- if operation was not successful
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |