/** * Returns all resources of the given organizational unit.<p> * * @param cms the opencms context * @param ouFqn the fully qualified name of the organizational unit to get all resources for * * @return all <code>{@link CmsResource}</code> objects in the organizational unit * * @throws CmsException if operation was not successful */ public List getResourcesForOrganizationalUnit(CmsObject cms, String ouFqn) throws CmsException { CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn); return m_securityManager.getResourcesForOrganizationalUnit(cms.getRequestContext(), orgUnit); }
/** * Returns all groups of the given organizational unit.<p> * * @param cms the opencms context * @param ouFqn the fully qualified name of the organizational unit to get all principals for * @param includeSubOus if all groups of sub-organizational units should be retrieved too * * @return all <code>{@link org.opencms.file.CmsGroup}</code> objects in the organizational unit * * @throws CmsException if operation was not successful */ public List getGroups(CmsObject cms, String ouFqn, boolean includeSubOus) throws CmsException { CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn); return (m_securityManager.getGroups(cms.getRequestContext(), orgUnit, includeSubOus, false)); }
/** * Moves an user to the given organizational unit.<p> * * @param cms the opencms context * @param ouFqn the full qualified name of the organizational unit to add the user to * @param userName the name of the user that is to be added to the organizational unit * * @throws CmsException if something goes wrong */ public void setUsersOrganizationalUnit(CmsObject cms, String ouFqn, String userName) throws CmsException { CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn); CmsUser user = cms.readUser(userName); m_securityManager.setUsersOrganizationalUnit(cms.getRequestContext(), orgUnit, user); }
/** * Removes a resource from the given organizational unit.<p> * * @param cms the opencms context * @param ouFqn the fully qualified name of the organizational unit to remove the resource from * @param resourceName the name of the resource that is to be removed from the organizational unit * * @throws CmsException if something goes wrong */ public void removeResourceFromOrgUnit(CmsObject cms, String ouFqn, String resourceName) throws CmsException { CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn); CmsResource resource = cms.readResource(resourceName, CmsResourceFilter.ALL); m_securityManager.removeResourceFromOrgUnit(cms.getRequestContext(), orgUnit, resource); }
/** * Removes a resource from the given organizational unit.<p> * * @param cms the opencms context * @param ouFqn the fully qualified name of the organizational unit to remove the resource from * @param resourceName the name of the resource that is to be removed from the organizational unit * * @throws CmsException if something goes wrong */ public void removeResourceFromOrgUnit(CmsObject cms, String ouFqn, String resourceName) throws CmsException { CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn); CmsResource resource = cms.readResource(resourceName, CmsResourceFilter.ALL); m_securityManager.removeResourceFromOrgUnit(cms.getRequestContext(), orgUnit, resource); }
/** * Moves an user to the given organizational unit.<p> * * @param cms the opencms context * @param ouFqn the full qualified name of the organizational unit to add the user to * @param userName the name of the user that is to be added to the organizational unit * * @throws CmsException if something goes wrong */ public void setUsersOrganizationalUnit(CmsObject cms, String ouFqn, String userName) throws CmsException { CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn); CmsUser user = cms.readUser(userName); m_securityManager.setUsersOrganizationalUnit(cms.getRequestContext(), orgUnit, user); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { try { OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()); } catch (Exception e) { setParamOufqn(null); } } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { try { OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()); } catch (Exception e) { setParamOufqn(null); } } }
/** * 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; } }
/** * 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; } }
/** * 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; } }
/** * Returns the description of the parent ou.<p> * * @return the description of the parent ou */ public String getAssignedOu() { try { return OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()).getDescription( getLocale()) + " (" + CmsOrganizationalUnit.SEPARATOR + getParamOufqn() + ")"; } 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(); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { // test the needed parameters OpenCms.getRoleManager().checkRole(getCms(), CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParamOufqn())); OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), m_paramOufqn).getName(); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { // test the needed parameters OpenCms.getRoleManager().checkRole(getCms(), CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParamOufqn())); OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), m_paramOufqn).getName(); } }
/** * @see com.vaadin.data.Validator#validate(java.lang.Object) */ public void validate(Object value) throws InvalidValueException { if (m_fieldOU.isEnabled() && CmsStringUtil.isNotEmptyOrWhitespaceOnly((String)value)) { try { OpenCms.getOrgUnitManager().readOrganizationalUnit(A_CmsUI.getCmsObject(), (String)value); } catch (CmsException e) { throw new InvalidValueException(e.getLocalizedMessage(UI.getCurrent().getLocale())); } } } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { // test the needed parameters OpenCms.getRoleManager().checkRole(getCms(), CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParamOufqn())); OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()).getName(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { // test the needed parameters OpenCms.getRoleManager().checkRole(getCms(), CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParamOufqn())); OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()).getName(); } }
/** * @see org.opencms.workplace.CmsWidgetDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { OpenCms.getRoleManager().checkRole(getCms(), CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParamOufqn())); if (!isNewOrgUnit()) { // test the needed parameters OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()).getName(); } } }