/** * Returns if the list of principals has principals of other organizational units.<p> * * @return if the list of principals has principals of other organizational units */ public boolean hasPrincipalsInOtherOus() { if (m_hasPrincipalsInOtherOus == null) { // lazzy initialization m_hasPrincipalsInOtherOus = Boolean.FALSE; try { Iterator itPrincipals = getPrincipals(true).iterator(); while (itPrincipals.hasNext()) { CmsPrincipal principal = (CmsPrincipal)itPrincipals.next(); if (!principal.getOuFqn().equals(getCms().getRequestContext().currentUser().getOuFqn())) { m_hasPrincipalsInOtherOus = Boolean.TRUE; break; } } } catch (Exception e) { // ignore } } return m_hasPrincipalsInOtherOus.booleanValue(); }
/** * Returns if the list of principals has principals of other organizational units.<p> * * @return if the list of principals has principals of other organizational units */ public boolean hasPrincipalsInOtherOus() { if (m_hasPrincipalsInOtherOus == null) { // lazzy initialization m_hasPrincipalsInOtherOus = Boolean.FALSE; try { Iterator<CmsPrincipal> itPrincipals = getPrincipals(true).iterator(); while (itPrincipals.hasNext()) { CmsPrincipal principal = itPrincipals.next(); if (!principal.getOuFqn().equals(getCms().getRequestContext().getCurrentUser().getOuFqn())) { m_hasPrincipalsInOtherOus = Boolean.TRUE; break; } } } catch (Exception e) { // ignore } } return m_hasPrincipalsInOtherOus.booleanValue(); }
/** * 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 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)); }
principal = getCms().readGroup((String)item.get(LIST_COLUMN_NAME)); if (principal.getOuFqn().equals(getCms().getRequestContext().currentUser().getOuFqn())) { if (showingUsers) { return PATH_BUTTONS + "user.png";
principal = getCms().readGroup((String)item.get(LIST_COLUMN_NAME)); if (principal.getOuFqn().equals(getCms().getRequestContext().getCurrentUser().getOuFqn())) { if (showingUsers) { return PATH_BUTTONS + "user.png";
/** * 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)); }