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
Modifier and TypeFieldDescriptionstatic final int
The flag constant to hide the organizational units from the login form.static final int
The flag constant to mark the organizational units as containing only webusers.static final String
The character used to separate each level in a fully qualified name. -
Constructor Summary
ConstructorDescriptionCmsOrganizationalUnit
(CmsUUID id, String fqn, String description, int flags, CmsUUID projectId) Creates a new OpenCms organizational unit principal. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFlag
(int flag) Adds the given flag to the flags for this organizational unit.clone()
boolean
Returns 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.int
getFlags()
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 String
getParentFqn
(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 String
getSimpleName
(String fqn) Returns the last name of the given fully qualified name.boolean
hasFlag
(int flag) Checks if this organizational unit has the given flag set.boolean
Checks if this organizational unit has the "hide from login form" flag set.boolean
Checks if this organizational unit has the "webusers" flag set.int
hashCode()
static String
prefixWithOu
(String ou, String principal) Prefixes a simple name with an OU.static String
Returns the given fully qualified name without leading separator.void
setDescription
(String description) Sets the description of this organizational unit.void
Sets the "hide from login form" flag.void
setFlags
(int value) Sets this organizational unit flags to the specified value.void
Sets 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
null
for 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
null
for 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:
true
if this organizational unit has the given flag set
-
hasFlagHideLogin
Checks if this organizational unit has the "hide from login form" flag set.- Returns:
true
if this organizational unit has the "hide from login form" flag set
-
hasFlagWebuser
Checks if this organizational unit has the "webusers" flag set.- Returns:
true
if 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
-