Package org.opencms.security
Class CmsOrganizationalUnit
java.lang.Object
org.opencms.security.CmsOrganizationalUnit
An organizational unit in OpenCms.
Be sure the flags does not conflict with the flags defined in CmsResource.
- Since:
- 6.5.6
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe flag constant to hide the organizational units from the login form.static final intThe flag constant to mark the organizational units as containing only webusers.static final StringThe character used to separate each level in a fully qualified name. -
Constructor Summary
ConstructorsConstructorDescriptionCmsOrganizationalUnit(CmsUUID id, String fqn, String description, int flags, CmsUUID projectId) Creates a new OpenCms organizational unit principal. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFlag(int flag) Adds the given flag to the flags for this organizational unit.clone()booleanReturns the description of this organizational unit.getDescription(Locale locale) Returns the description of this organizational unit.getDisplayName(Locale locale) Returns the display name for this organizational unit.intgetFlags()Returns the flags of this organizational unit.getId()Returns the id of this organizational unit.getName()Returns the fully qualified name of this organizational unit.Returns the full qualified name of the parent organizational unit of this organizational unit.static final StringgetParentFqn(String fqn) Returns the parent fully qualified name.Returns the id of the related default project.Returns the simple name of this organizational unit.static final StringgetSimpleName(String fqn) Returns the last name of the given fully qualified name.booleanhasFlag(int flag) Checks if this organizational unit has the given flag set.booleanChecks if this organizational unit has the "hide from login form" flag set.booleanChecks if this organizational unit has the "webusers" flag set.inthashCode()static StringprefixWithOu(String ou, String principal) Prefixes a simple name with an OU.static StringReturns the given fully qualified name without leading separator.voidsetDescription(String description) Sets the description of this organizational unit.voidSets the "hide from login form" flag.voidsetFlags(int value) Sets this organizational unit flags to the specified value.voidSets the "webusers" flag.toString()
-
Field Details
-
FLAG_HIDE_LOGIN
The flag constant to hide the organizational units from the login form.- See Also:
-
FLAG_WEBUSERS
The flag constant to mark the organizational units as containing only webusers.- See Also:
-
SEPARATOR
The character used to separate each level in a fully qualified name.- See Also:
-
-
Constructor Details
-
CmsOrganizationalUnit
public CmsOrganizationalUnit(CmsUUID id, String fqn, String description, int flags, CmsUUID projectId) Creates a new OpenCms organizational unit principal.- Parameters:
id- the unique id of the organizational unitfqn- the fully qualified name of the this organizational unit (should end with slash)description- the description of the organizational unitflags- the flags of the organizational unitprojectId- the id of the related default project
-
-
Method Details
-
getParentFqn
Returns the parent fully qualified name.This is
nullfor the root ou, and the empty string for first level ous.- Parameters:
fqn- the fully qualified name to get the parent from- Returns:
- the parent fully qualified name
-
getSimpleName
Returns the last name of the given fully qualified name.- Parameters:
fqn- the fully qualified name to get the last name from- Returns:
- the last name of the given fully qualified name
-
prefixWithOu
Prefixes a simple name with an OU.- Parameters:
ou- the OU to use as a prefixprincipal- the simple name to which the OU should be prepended- Returns:
- the FQN
-
removeLeadingSeparator
Returns the given fully qualified name without leading separator.- Parameters:
fqn- the fully qualified name to fix- Returns:
- the given fully qualified name without leading separator
-
addFlag
Adds the given flag to the flags for this organizational unit.- Parameters:
flag- the flag to add
-
clone
-
equals
-
getDescription
Returns the description of this organizational unit.This could return also just a macro, so please use the
getDescription(Locale)method.- Returns:
- the description of this organizational unit
-
getDescription
Returns the description of this organizational unit.- Parameters:
locale- the locale- Returns:
- the description of this organizational unit
-
getDisplayName
Returns the display name for this organizational unit.- Parameters:
locale- the locale- Returns:
- the display name for this organizational unit
-
getFlags
Returns the flags of this organizational unit.The organizational unit flags are used to store special information about the organizational unit state encoded bitwise. Usually the flags int value should not be directly accessed.
- Returns:
- the flags of this organizational unit
-
getId
Returns the id of this organizational unit.- Returns:
- the id of this organizational unit.
-
getName
Returns the fully qualified name of this organizational unit.- Returns:
- the fully qualified name of this organizational unit
-
getParentFqn
Returns the full qualified name of the parent organizational unit of this organizational unit.This is
nullfor the root ou, and the empty string for first level ous.- Returns:
- the full qualified name of the parent organizational unit of this organizational unit
-
getProjectId
Returns the id of the related default project.- Returns:
- the id of the related default project
-
getSimpleName
Returns the simple name of this organizational unit.- Returns:
- the simple name of this organizational unit.
-
hasFlag
Checks if this organizational unit has the given flag set.- Parameters:
flag- the flag to check- Returns:
trueif this organizational unit has the given flag set
-
hasFlagHideLogin
Checks if this organizational unit has the "hide from login form" flag set.- Returns:
trueif this organizational unit has the "hide from login form" flag set
-
hasFlagWebuser
Checks if this organizational unit has the "webusers" flag set.- Returns:
trueif this organizational unit has the "webusers" flag set
-
hashCode
-
setDescription
Sets the description of this organizational unit.- Parameters:
description- the principal organizational unit to set
-
setFlagHideLogin
Sets the "hide from login form" flag. -
setFlags
Sets this organizational unit flags to the specified value.The organizational unit flags are used to store special information about the organizational units state encoded bitwise. Usually the flags int value should not be directly accessed.
- Parameters:
value- the value to set this organizational units flags to
-
setFlagWebusers
Sets the "webusers" flag. -
toString
-