/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Object obj) { if ((this == obj) || this.equals(obj)) { return 0; } I_CmsPrincipal that = (I_CmsPrincipal)obj; return this.getName().compareTo(that.getName()); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(I_CmsPrincipal obj) { if ((this == obj) || equals(obj)) { return 0; } return getName().compareTo(obj.getName()); }
/** * Unsubscribes the user or group from all resources.<p> * * @param context the request context * @param poolName the name of the database pool to use * @param principal the principal that unsubscribes from all resources * * @throws CmsException if something goes wrong */ public void unsubscribeAllResourcesFor(CmsRequestContext context, String poolName, CmsPrincipal principal) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.unsubscribeAllResourcesFor(dbc, poolName, principal); } catch (Exception e) { if (principal instanceof CmsUser) { dbc.report( null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_RESOURCES_USER_1, principal.getName()), e); } else { dbc.report( null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_RESOURCES_GROUP_1, principal.getName()), e); } } finally { dbc.clear(); } }
Messages.ERR_UNSUBSCRIBE_RESOURCE_FOR_GROUP_2, context.getSitePath(resource), principal.getName()), e); } finally {
/** * 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)); }