/** * Returns the HTML code for selecting an organizational unit.<p> * * @return the HTML code for selecting an organizational unit */ public String buildOrgUnitSelector() { StringBuffer html = new StringBuffer(); html.append("<select style='width: 100%;' size='1' "); appendId(html, PARAM_OUFQN); html.append(">\n"); for (CmsOrganizationalUnit ou : getOus()) { String selected = ""; if (ou.getName().equals(m_oufqn) || (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_oufqn) && ou.getName().equals(m_oufqn.substring(1)))) { selected = " selected='selected'"; } html.append("<option value='").append(ou.getName()).append("'").append(selected).append(">"); html.append(ou.getDisplayName(m_locale)); html.append("</option>\n"); } html.append("</select>\n"); return html.toString(); }
/** * Returns html code for selecting an organizational unit.<p> * * @return html code */ public String buildOrgUnitSelector() { StringBuffer html = new StringBuffer(); html.append("<select style='width: 100%;' size='1' "); appendId(html, PARAM_OUFQN); html.append(">\n"); Iterator itOus = getOus().iterator(); while (itOus.hasNext()) { CmsOrganizationalUnit ou = (CmsOrganizationalUnit)itOus.next(); String selected = ""; if (ou.getName().equals(m_oufqn) || (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_oufqn) && ou.getName().equals(m_oufqn.substring(1)))) { selected = " selected='selected'"; } html.append("<option value='").append(ou.getName()).append("'").append(selected).append(">"); html.append(ou.getDisplayName(m_locale)); html.append("</option>\n"); } html.append("</select>\n"); return 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_user.getOuFqn()).getDisplayName( getLocale()); } catch (CmsException e) { return null; } }
/** * Initializes the select options.<p> * * @param orgUnits the selectable OUs */ public void initOrgUnits(List<CmsOrganizationalUnit> orgUnits) { if ((orgUnits.size() == 1) && (orgUnits.get(0).getParentFqn() == null)) { setVisible(false); m_alwaysHidden = true; } for (CmsOrganizationalUnit ou : orgUnits) { String key = normalizeOuName(ou.getName()); m_ouSelect.addItem(key); m_ouSelect.setItemCaption(key, ou.getDisplayName(A_CmsUI.get().getLocale())); } }
/** * 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; } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#fillDetails(java.lang.String) */ @Override protected void fillDetails(String detailId) { // get content List<CmsListItem> roles = getList().getAllContent(); Iterator<CmsListItem> itRoles = roles.iterator(); while (itRoles.hasNext()) { CmsListItem item = itRoles.next(); String roleName = item.get(LIST_COLUMN_GROUP_NAME).toString(); StringBuffer html = new StringBuffer(512); try { if (detailId.equals(LIST_DETAIL_PATH)) { html.append( OpenCms.getOrgUnitManager().readOrganizationalUnit( getCms(), CmsOrganizationalUnit.getParentFqn(roleName)).getDisplayName(getLocale())); } else if (detailId.equals(LIST_DETAIL_DESCRIPTION)) { CmsRole role = CmsRole.valueOf(getCms().readGroup(roleName)); html.append(role.getDescription(getCms().getRequestContext().getLocale())); } else { continue; } } catch (Exception e) { // noop } item.set(detailId, html.toString()); } }
/** * Returns the description of the parent ou.<p> * * @return the description of the parent ou */ public String getAssignedOu() { try { CmsOrganizationalUnit ou = OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()); return ou.getDisplayName(getLocale()); } catch (CmsException e) { return null; } }
/** * @see org.opencms.security.CmsPrincipal#getDisplayName(org.opencms.file.CmsObject, java.util.Locale) */ @Override public String getDisplayName(CmsObject cms, Locale locale) throws CmsException { if (OpenCms.getOrgUnitManager().getOrganizationalUnits(cms, "", true).size() > 0) { return org.opencms.security.Messages.get().getBundle(locale).key( org.opencms.security.Messages.GUI_PRINCIPAL_DISPLAY_NAME_2, getFullName(), OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, getOuFqn()).getDisplayName(locale)); } else { return getFullName(); } }
/** * @see org.opencms.security.CmsPrincipal#getDisplayName(org.opencms.file.CmsObject, java.util.Locale) */ @Override public String getDisplayName(CmsObject cms, Locale locale) throws CmsException { if (OpenCms.getOrgUnitManager().getOrganizationalUnits(cms, "", true).size() > 0) { return org.opencms.security.Messages.get().getBundle(locale).key( org.opencms.security.Messages.GUI_PRINCIPAL_DISPLAY_NAME_2, getFullName(), OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, getOuFqn()).getDisplayName(locale)); } else { return getFullName(); } }
/** * Returns the description of the parent ou.<p> * * @return the description of the parent ou */ public String getAssignedOu() { try { CmsOrganizationalUnit ou; if (!isNewProject()) { ou = OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), m_project.getOuFqn()); } else { ou = OpenCms.getRoleManager().getOrgUnitsForRole(getCms(), CmsRole.PROJECT_MANAGER, true).get(0); } return ou.getDisplayName(getLocale()); } catch (CmsException e) { return null; } }
/** * Returns the display name of this role including the organizational unit.<p> * * @param cms the cms context * @param locale the locale * * @return the display name of this role including the organizational unit * * @throws CmsException if the organizational unit could not be read */ public String getDisplayName(CmsObject cms, Locale locale) throws CmsException { return Messages.get().getBundle(locale).key( Messages.GUI_PRINCIPAL_DISPLAY_NAME_2, getName(locale), OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, getOuFqn()).getDisplayName(locale)); }
/** * Returns the display name of this principal including the organizational unit.<p> * * @param cms the cms context * @param locale the locale * * @return the display name of this principal including the organizational unit * * @throws CmsException if the organizational unit could not be read */ public String getDisplayName(CmsObject cms, Locale locale) throws CmsException { return Messages.get().getBundle(locale).key( Messages.GUI_PRINCIPAL_DISPLAY_NAME_2, getSimpleName(), OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, getOuFqn()).getDisplayName(locale)); }
/** * Returns the display name of this role including the organizational unit.<p> * * @param cms the cms context * @param locale the locale * * @return the display name of this role including the organizational unit * * @throws CmsException if the organizational unit could not be read */ public String getDisplayName(CmsObject cms, Locale locale) throws CmsException { return Messages.get().getBundle(locale).key( Messages.GUI_PRINCIPAL_DISPLAY_NAME_2, getName(locale), OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, getOuFqn()).getDisplayName(locale)); }
/** * Returns the display name of this principal including the organizational unit.<p> * * @param cms the cms context * @param locale the locale * * @return the display name of this principal including the organizational unit * * @throws CmsException if the organizational unit could not be read */ public String getDisplayName(CmsObject cms, Locale locale) throws CmsException { return Messages.get().getBundle(locale).key( Messages.GUI_PRINCIPAL_DISPLAY_NAME_2, getSimpleName(), OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, getOuFqn()).getDisplayName(locale)); }
jsonObj.put("displayname", ou.getDisplayName(m_locale));
/** * Returns the translated display name of this principal if it is a group and the display name otherwise.<p> * * @param cms the current CMS context * @param locale the locale * @param translation the group name translation to use * * @return the translated display name * * @throws CmsException if something goes wrong */ public String getDisplayName(CmsObject cms, Locale locale, I_CmsGroupNameTranslation translation) throws CmsException { if (!isGroup() || (translation == null)) { return getDisplayName(cms, locale); } return Messages.get().getBundle(locale).key( Messages.GUI_PRINCIPAL_DISPLAY_NAME_2, translation.translateGroupName(getName(), false), OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, getOuFqn()).getDisplayName(locale)); }
return OpenCms.getOrgUnitManager().readOrganizationalUnit(m_wp.getCms(), id).getDisplayName( m_wp.getLocale());
item.set(LIST_COLUMN_ORGUNIT, userOu.getDisplayName(getLocale())); item.set(LIST_COLUMN_CREATION, new Date(sessionInfo.getTimeCreated())); item.set(LIST_COLUMN_INACTIVE, new Long(System.currentTimeMillis() - sessionInfo.getTimeUpdated()));
projectName = projectName + " - " + OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName( locale); } catch (CmsException e) {
CmsOrganizationalUnit ou; ou = OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, m_project.getOuFqn()); m_fieldOU.setValue(ou.getDisplayName(UI.getCurrent().getLocale())); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e);