/** * Returns if the list of groups has groups of other organizational units.<p> * * @return if the list of groups has groups of other organizational units */ public boolean hasGroupsInOtherOus() { if (m_hasGroupsInOtherOus == null) { // lazzy initialization m_hasGroupsInOtherOus = Boolean.FALSE; try { List<CmsGroup> groups = getGroups(true); Iterator<CmsGroup> itGroups = groups.iterator(); while (itGroups.hasNext()) { CmsGroup group = itGroups.next(); if (!group.getOuFqn().equals(getParamOufqn())) { m_hasGroupsInOtherOus = Boolean.TRUE; break; } } } catch (Exception e) { // ignore } } return m_hasGroupsInOtherOus.booleanValue(); }
/** * Enumeration class for the mode parameter in the * {@link CmsDriverManager#readChangedResourcesInsideProject(CmsDbContext, CmsUUID, CmsReadChangedProjectResourceMode)} * method.<p> */ private static class CmsReadChangedProjectResourceMode { /** * Default constructor.<p> */ protected CmsReadChangedProjectResourceMode() { // noop } }
/** * @see org.opencms.workplace.tools.accounts.A_CmsGroupsList#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { List<CmsListItem> listItems = super.getListItems(); Iterator<CmsListItem> itListItems = listItems.iterator(); while (itListItems.hasNext()) { CmsListItem item = itListItems.next(); CmsGroup group = getCms().readGroup(new CmsUUID(item.getId())); item.set(LIST_COLUMN_ORGUNIT, CmsOrganizationalUnit.SEPARATOR + group.getOuFqn()); } return listItems; }
/** * Returns the groups to show for selection.<p> * * @return A list of group objects * * @throws CmsException if womething goes wrong */ protected List getGroups() throws CmsException { List ret = new ArrayList(); if (getParamUser() != null) { ret.addAll(getCms().getGroupsOfUser(getParamUser(), false)); } else { ret.addAll(OpenCms.getRoleManager().getManageableGroups(getCms(), "", true)); } if (getParamFlags() != null) { int flags = Integer.parseInt(getParamFlags()); ret = CmsPrincipal.filterFlag(ret, flags); } if ((getParamOufqn() != null) && !getParamOufqn().equals("null")) { Iterator itTempRet = ret.iterator(); while (itTempRet.hasNext()) { CmsGroup group = (CmsGroup)itTempRet.next(); if (!group.getOuFqn().startsWith(getParamOufqn())) { itTempRet.remove(); } } } return ret; }
/** * Returns the groups to show for selection.<p> * * @return A list of group objects * * @throws CmsException if womething goes wrong */ 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; }
/** * @see org.opencms.workplace.tools.accounts.A_CmsGroupsList#fillDetails(java.lang.String) */ @Override protected void fillDetails(String detailId) { super.fillDetails(detailId); // get content List<CmsListItem> groups = getList().getAllContent(); Iterator<CmsListItem> itGroups = groups.iterator(); while (itGroups.hasNext()) { CmsListItem item = itGroups.next(); String groupName = item.get(LIST_COLUMN_NAME).toString(); StringBuffer html = new StringBuffer(512); try { if (detailId.equals(LIST_DETAIL_ORGUNIT_DESC)) { CmsGroup group = getCms().readGroup(groupName); html.append( OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), group.getOuFqn()).getDescription( getLocale())); } else { continue; } } catch (Exception e) { // ignore } item.set(detailId, html.toString()); } }
/** * Returns the description of the parent ou.<p> * * @return the description of the parent ou */ public String getAssignedOu() { try { return OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), m_group.getOuFqn()).getDisplayName( getLocale()); } catch (CmsException e) { return null; } }
String parentOu = CmsOrganizationalUnit.getParentFqn(group.getOuFqn()); if (parentOu != null) {
/** * Returns the role for the given group.<p> * * @param group a group to check for role representation * * @return the role for the given group */ public static CmsRole valueOf(CmsGroup group) { // check groups for internal representing the roles if (group.isRole()) { CmsRole role = valueOfGroupName(group.getName()); if (role != null) { return role; } } // check virtual groups mapping a role if (group.isVirtual()) { int index = (group.getFlags() & (I_CmsPrincipal.FLAG_CORE_LIMIT - 1)); index = index / (I_CmsPrincipal.FLAG_GROUP_VIRTUAL * 2); CmsRole role = (CmsRole)getSystemRoles().get(index); return role.forOrgUnit(group.getOuFqn()); } return null; }
String oufqn = readGroup(dbc, project.getManagerGroupId()).getOuFqn(); manageable = manageable || (oufqn.startsWith(dbc.getRequestContext().getOuFqn()));
String oufqn = readGroup(dbc, project.getManagerGroupId()).getOuFqn(); manageable = manageable || (oufqn.startsWith(dbc.getRequestContext().getOuFqn()));
String oufqn = readGroup(dbc, groupId).getOuFqn(); accessible = accessible || (oufqn.startsWith(dbc.getRequestContext().getOuFqn()));
String oufqn = readGroup(dbc, groupId).getOuFqn(); accessible = accessible || (oufqn.startsWith(dbc.getRequestContext().getOuFqn()));
/** * Returns the role for the given group.<p> * * @param group a group to check for role representation * * @return the role for the given group */ public static CmsRole valueOf(CmsGroup group) { // check groups for internal representing the roles if (group.isRole()) { CmsRole role = valueOfGroupName(group.getName()); if (role != null) { return role; } } // check virtual groups mapping a role if (group.isVirtual()) { int index = (group.getFlags() & (I_CmsPrincipal.FLAG_CORE_LIMIT - 1)); index = index / (I_CmsPrincipal.FLAG_GROUP_VIRTUAL * 2); CmsRole role = getSystemRoles().get(index); return role.forOrgUnit(group.getOuFqn()); } return null; }
String parentOu = CmsOrganizationalUnit.getParentFqn(group.getOuFqn()); if (parentOu != null) {
/** * @see org.opencms.workplace.list.A_CmsListDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { CmsListItemDetails details = getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU); boolean withOtherOus = hasGroupsInOtherOus() && (details != null) && details.isVisible(); List<CmsListItem> ret = new ArrayList<CmsListItem>(); // get content List<CmsGroup> groups = getGroups(withOtherOus); Iterator<CmsGroup> itGroups = groups.iterator(); while (itGroups.hasNext()) { CmsGroup group = itGroups.next(); CmsListItem item = getList().newItem(group.getId().toString()); item.set(LIST_COLUMN_NAME, group.getName()); item.set(LIST_COLUMN_DISPLAY, OpenCms.getWorkplaceManager().translateGroupName(group.getName(), false)); item.set(LIST_COLUMN_DESCRIPTION, group.getDescription(getLocale())); item.set(LIST_COLUMN_ORGUNIT, CmsOrganizationalUnit.SEPARATOR + group.getOuFqn()); ret.add(item); } return ret; }
/** * Enumeration class for the mode parameter in the * {@link CmsDriverManager#readChangedResourcesInsideProject(CmsDbContext, CmsUUID, CmsReadChangedProjectResourceMode)} * method.<p> */ private static class CmsReadChangedProjectResourceMode { /** * Default constructor.<p> */ protected CmsReadChangedProjectResourceMode() { // noop } }
new CmsSimpleQueryFragment(groupUsers.column(colGroupUserUserId()) + " = " + users.column(colId()))); if (searchParams.isFilterByGroupOu()) { select.addCondition(new CmsSimpleQueryFragment(users.column(colOu()) + " = ? ", group.getOuFqn()));