Returns the projects user group name.<p>

@param cms the current cms context

@return the projects user group name
167778
public String getGroupUsersName(CmsObject cms) {

        try {
            return CmsPrincipal.readPrincipalIncludingHistory(cms, getGroupId()).getName();
        } catch (CmsException e) {
            return getGroupId().toString();
        }
    }
594655
protected String getAcePrincipalName(CmsObject cms, CmsUUID principalId) {

        if (CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID.equals(principalId)) {
            return CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME;
        }
        if (CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID.equals(principalId)) {
            return CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME;
        }
        CmsRole role = CmsRole.valueOfId(principalId);
        if (role != null) {
            return role.getRoleName();
        }
        try {
            return CmsPrincipal.readPrincipalIncludingHistory(cms, principalId).getName();
        } catch (CmsException e) {
            return "" + principalId;
        }
    }
937246
public String getFolderPath(CmsObject cms, String pageFolderRootPath) {

        checkInitialized();
        if (m_folderOrName != null) {
            return m_folderOrName.getFolderPath(cms, pageFolderRootPath);
        } else {
            String siteRoot = null;
            if (pageFolderRootPath != null) {
                siteRoot = OpenCms.getSiteManager().getSiteRoot(pageFolderRootPath);
            }
            if (siteRoot == null) {
                siteRoot = cms.getRequestContext().getSiteRoot();
            }
            return CmsStringUtil.joinPaths(siteRoot, CmsADEManager.CONTENT_FOLDER_NAME, m_typeName);
        }
    }
627793
private String getTemplateName(CmsObject cms, CmsResource resource) throws CmsException {

        String templateName = (String)(m_templateNameCache.getCachedObject(cms, resource.getRootPath()));
        if (templateName == null) {
            CmsProperty nameProperty = cms.readPropertyObject(
                resource,
                CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS,
                false);
            String nameFromProperty = "";
            if (!nameProperty.isNullProperty()) {
                nameFromProperty = nameProperty.getValue();
            }
            m_templateNameCache.putCachedObject(cms, resource.getRootPath(), nameFromProperty);
            return nameFromProperty;
        } else {
            return templateName;
        }
    }
905742
public String getName() {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_path)) {
            return "";
        }
        String result = CmsResource.getName(m_path);
        // remove trailing slash as categories are not displayed like folders
        if (CmsResource.isFolder(result)) {
            result = result.substring(0, result.length() - 1);
        }
        return result;
    }
1090619
public CmsGroup readGroup(CmsRequestContext context, CmsProject project) {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        CmsGroup result = null;
        try {
            result = m_driverManager.readGroup(dbc, project);
        } finally {
            dbc.clear();
        }
        return result;
    }
1113364
protected CmsObject getCms() {

        if (m_cms == null) {
            try {
                m_cms = OpenCms.initCmsObject(A_CmsUI.getCmsObject());
                m_cms.getRequestContext().setSiteRoot("");
            } catch (CmsException e) {
                return null;
            }
        }
        return m_cms;
    }
259607
protected List<CmsGroup> getGroups() throws CmsException {

        return CmsPrincipal.filterCoreGroups(OpenCms.getOrgUnitManager().getGroups(getCms(), "", true));
    }
55705
protected List<CmsGroup> getGroups() throws CmsException {

        List<CmsGroup> groups = new ArrayList<CmsGroup>();
        if (getParamUser() != null) {
            groups.addAll(getCms().getGroupsOfUser(getParamUser(), false));
        } else {
            groups.addAll(OpenCms.getRoleManager().getManageableGroups(getCms(), "", true));
        }
        if (getParamFlags() != null) {
            int flags = Integer.parseInt(getParamFlags());
            CmsPrincipal.filterFlag(groups, flags);
        }
        if ((getParamOufqn() != null) && !getParamOufqn().equals("null")) {
            Iterator<CmsGroup> groupsIter = groups.iterator();
            while (groupsIter.hasNext()) {
                CmsGroup group = groupsIter.next();
                if (!group.getOuFqn().startsWith(getParamOufqn())) {
                    groupsIter.remove();
                }
            }
        }
        return groups;
    }
590963
public CmsProject getReferenceProject() {

        if (m_referenceProject == null) {
            if (m_request != null) {
                m_referenceProject = m_request.getCurrentProject();
            }
        }
        return m_referenceProject;
    }
563772
public static String getDirectEditPath(CmsObject cms, CmsUserSettings userSettings) {

        if (userSettings.getStartView().equals(CmsWorkplace.VIEW_DIRECT_EDIT)
            | userSettings.getStartView().equals(CmsPageEditorConfiguration.APP_ID)) {

            try {
                CmsObject cloneCms = OpenCms.initCmsObject(cms);
                String startSite = CmsWorkplace.getStartSiteRoot(cloneCms, userSettings);
                cloneCms.getRequestContext().setSiteRoot(startSite);
                String projectName = userSettings.getStartProject();
                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(projectName)) {
                    cloneCms.getRequestContext().setCurrentProject(cloneCms.readProject(projectName));
                }
                String folder = userSettings.getStartFolder();
                CmsResource targetRes = cloneCms.readDefaultFile(folder);
                if (targetRes != null) {
                    return cloneCms.getSitePath(targetRes);
                }
            } catch (Exception e) {
                LOG.debug(e);
            }
        }
        return null;
    }
428907
public CmsUUID getProjectId() {

        CmsUUID projectId = m_resource.getProjectLastModified();
        if (!getLock().isUnlocked() && !getLock().isInherited()) {
            // use lock project ID only if lock is not inherited
            projectId = getLock().getProjectId();
        }
        return projectId;
    }
693454
public CmsUUID getProjectId(CmsDbContext dbc, int id) throws CmsException {

        Iterator<CmsProject> itProjects = getAllAccessibleProjects(
            dbc,
            readOrganizationalUnit(dbc, ""),
            true).iterator();
        while (itProjects.hasNext()) {
            CmsProject project = itProjects.next();
            if (project.getUuid().hashCode() == id) {
                return project.getUuid();
            }
        }
        return null;
    }
416493
private CmsObject getOnlineCmsObject(CmsObject cms) {

        CmsObject res = null;
        try {
            res = OpenCms.initCmsObject(cms);
            res.getRequestContext().setCurrentProject(cms.readProject(CmsProject.ONLINE_PROJECT_ID));
        } catch (CmsException e) {
            LOG.error("Cannot create CmsObject", e);
        }
        return res;
    }
558732
public String getSitePath(CmsObject cms) {

        if (m_path != null) {
            return m_path;
        } else if (m_folder != null) {
            return cms.getRequestContext().removeSiteRoot(m_folder.getRootPath());
        }
        return null;
    }
1465
protected CmsObject getCmsObject(CmsCmisCallContext context) {

        try {
            if (context.getUsername() == null) {
                // user name can be null
                CmsObject cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest());
                cms.getRequestContext().setCurrentProject(m_adminCms.getRequestContext().getCurrentProject());
                return cms;
            } else {
                CmsObject cms = OpenCms.initCmsObject(m_adminCms);
                CmsProject projectBeforeLogin = cms.getRequestContext().getCurrentProject();
                cms.loginUser(context.getUsername(), context.getPassword());
                cms.getRequestContext().setCurrentProject(projectBeforeLogin);
                return cms;
            }
        } catch (CmsException e) {
            throw new CmisPermissionDeniedException(e.getLocalizedMessage(), e);

        }
    }
190112
protected String getToNames() {

        List<String> excluded = new ArrayList<String>();
        List<String> users = new ArrayList<String>();
        Iterator<String> itGroups = getGroups().iterator();
        while (itGroups.hasNext()) {
            String groupName = itGroups.next();
            try {
                Iterator<CmsUser> itUsers = getCms().getUsersOfGroup(groupName, true).iterator();
                while (itUsers.hasNext()) {
                    CmsUser user = itUsers.next();
                    String userName = user.getFullName();
                    if (!users.contains(userName)) {
                        String emailAddress = user.getEmail();
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(emailAddress)) {
                            users.add(userName);
                        } else {
                            excluded.add(userName);
                        }
                    }
                }
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        if (!excluded.isEmpty()) {
            StringBuffer text = new StringBuffer(500);
            text.append(Messages.get().container(Messages.GUI_EXCLUDED_USERS_WARNING_0).key(getLocale()));
            text.append("<br>");
            Iterator<String> it = excluded.iterator();
            while (it.hasNext()) {
                text.append("- ");
                text.append(it.next());
                text.append("<br>");
            }
            setExcludedUsers(text.toString());
        }
        if (users.isEmpty()) {
            setCommitErrors(
                Collections.singletonList((Throwable)new CmsIllegalStateException(
                    Messages.get().container(Messages.ERR_NO_SELECTED_USER_WITH_EMAIL_0))));
            return "";
        }
        StringBuffer result = new StringBuffer(256);
        Iterator<String> itUsers = users.iterator();
        while (itUsers.hasNext()) {
            result.append(itUsers.next().toString());
            if (itUsers.hasNext()) {
                result.append("; ");
            }
        }
        return result.toString();
    }