Class CmsGroup

    • Constructor Detail

      • CmsGroup

        public CmsGroup()
        Creates a new, empty OpenCms group principal.
      • CmsGroup

        public CmsGroup​(CmsUUID id,
                        CmsUUID parentId,
                        java.lang.String name,
                        java.lang.String description,
                        int flags)
        Creates a new OpenCms group principal.
        Parameters:
        id - the unique id of the group
        parentId - the is of the parent group
        name - the fully qualified name of the name of the group
        description - the description of the group
        flags - the flags of the group
    • Method Detail

      • hasPrefix

        public static boolean hasPrefix​(java.lang.String principalName)
        Checks if the given String starts with I_CmsPrincipal.PRINCIPAL_GROUP followed by a dot.

        • Works if the given String is null.
        • Removes white spaces around the String before the check.
        • Also works with prefixes not being in upper case.
        • Does not check if the group after the prefix actually exists.
        Parameters:
        principalName - the group name to check
        Returns:
        true in case the String starts with I_CmsPrincipal.PRINCIPAL_GROUP
      • removePrefix

        public static java.lang.String removePrefix​(java.lang.String principalName)
        Removes the prefix if the given String starts with I_CmsPrincipal.PRINCIPAL_GROUP followed by a dot.

        • Works if the given String is null.
        • If the given String does not start with I_CmsPrincipal.PRINCIPAL_GROUP followed by a dot it is returned unchanged.
        • Removes white spaces around the group name.
        • Also works with prefixes not being in upper case.
        • Does not check if the group after the prefix actually exists.
        Parameters:
        principalName - the group name to remove the prefix from
        Returns:
        the given String with the prefix I_CmsPrincipal.PRINCIPAL_GROUP with the following dot removed
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
        See Also:
        Object.clone()
      • getDescription

        public java.lang.String getDescription​(java.util.Locale locale)
        Returns the description of this organizational unit.

        Parameters:
        locale - the locale
        Returns:
        the description of this organizational unit
      • getParentId

        public CmsUUID getParentId()
        Returns the parent group id of this group.

        Returns:
        the parent group id of this group
      • isRole

        public boolean isRole()
        Checks if this group is a role group.

        Returns:
        true if this group is a role group
      • isVirtual

        public boolean isVirtual()
        Checks if this group is a virtual group, emulating a role.

        Returns:
        if this group is a virtual group
      • setParentId

        public void setParentId​(CmsUUID parentId)
        Sets the parent group id of this group.

        Parameters:
        parentId - the parent group id to set
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.security.Principal
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()