public class CmsOrganizationalUnit
extends java.lang.Object
Be sure the flags does not conflict with the flags defined in CmsResource
.
限定符和类型 | 字段和说明 |
---|---|
static int |
FLAG_HIDE_LOGIN
The flag constant to hide the organizational units from the login form.
|
static int |
FLAG_WEBUSERS
The flag constant to mark the organizational units as containing only webusers.
|
static java.lang.String |
SEPARATOR
The character used to separate each level in a fully qualified name.
|
构造器和说明 |
---|
CmsOrganizationalUnit(CmsUUID id,
java.lang.String fqn,
java.lang.String description,
int flags,
CmsUUID projectId)
Creates a new OpenCms organizational unit principal.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addFlag(int flag)
Adds the given flag to the flags for this organizational unit.
|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getDescription()
Returns the description of this organizational unit.
|
java.lang.String |
getDescription(java.util.Locale locale)
Returns the description of this organizational unit.
|
java.lang.String |
getDisplayName(java.util.Locale locale)
Returns the display name for this organizational unit.
|
int |
getFlags()
Returns the flags of this organizational unit.
|
CmsUUID |
getId()
Returns the id of this organizational unit.
|
java.lang.String |
getName()
Returns the fully qualified name of this organizational unit.
|
java.lang.String |
getParentFqn()
Returns the full qualified name of the parent organizational unit of this organizational unit.
|
static java.lang.String |
getParentFqn(java.lang.String fqn)
Returns the parent fully qualified name.
|
CmsUUID |
getProjectId()
Returns the id of the related default project.
|
java.lang.String |
getSimpleName()
Returns the simple name of this organizational unit.
|
static java.lang.String |
getSimpleName(java.lang.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 |
hasFlagHideLogin()
Checks if this organizational unit has the "hide from login form" flag set.
|
boolean |
hasFlagWebuser()
Checks if this organizational unit has the "webusers" flag set.
|
int |
hashCode() |
static java.lang.String |
prefixWithOu(java.lang.String ou,
java.lang.String principal)
Prefixes a simple name with an OU.
|
static java.lang.String |
removeLeadingSeparator(java.lang.String fqn)
Returns the given fully qualified name without leading separator.
|
void |
setDescription(java.lang.String description)
Sets the description of this organizational unit.
|
void |
setFlagHideLogin()
Sets the "hide from login form" flag.
|
void |
setFlags(int value)
Sets this organizational unit flags to the specified value.
|
void |
setFlagWebusers()
Sets the "webusers" flag.
|
java.lang.String |
toString() |
public static final int FLAG_HIDE_LOGIN
public static final int FLAG_WEBUSERS
public static final java.lang.String SEPARATOR
public CmsOrganizationalUnit(CmsUUID id, java.lang.String fqn, java.lang.String description, int flags, CmsUUID projectId)
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 projectpublic static final java.lang.String getParentFqn(java.lang.String fqn)
This is null
for the root ou, and
the empty string for first level ous.
fqn
- the fully qualified name to get the parent frompublic static final java.lang.String getSimpleName(java.lang.String fqn)
fqn
- the fully qualified name to get the last name frompublic static java.lang.String prefixWithOu(java.lang.String ou, java.lang.String principal)
ou
- the OU to use as a prefixprincipal
- the simple name to which the OU should be prependedpublic static java.lang.String removeLeadingSeparator(java.lang.String fqn)
fqn
- the fully qualified name to fixpublic void addFlag(int flag)
flag
- the flag to addpublic java.lang.Object clone()
clone
在类中 java.lang.Object
Object.clone()
public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
Object.equals(java.lang.Object)
public java.lang.String getDescription()
This could return also just a macro, so please use the
getDescription(Locale)
method.
public java.lang.String getDescription(java.util.Locale locale)
locale
- the localepublic java.lang.String getDisplayName(java.util.Locale locale)
locale
- the localepublic int getFlags()
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.
public CmsUUID getId()
public java.lang.String getName()
public java.lang.String getParentFqn()
This is null
for the root ou, and the empty string for first level ous.
public CmsUUID getProjectId()
public java.lang.String getSimpleName()
public boolean hasFlag(int flag)
flag
- the flag to checktrue
if this organizational unit has the given flag setpublic boolean hasFlagHideLogin()
true
if this organizational unit has the "hide from login form" flag setpublic boolean hasFlagWebuser()
true
if this organizational unit has the "webusers" flag setpublic int hashCode()
hashCode
在类中 java.lang.Object
Object.hashCode()
public void setDescription(java.lang.String description)
description
- the principal organizational unit to setpublic void setFlagHideLogin()
public void setFlags(int 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.
value
- the value to set this organizational units flags topublic void setFlagWebusers()
public java.lang.String toString()
toString
在类中 java.lang.Object
Object.toString()