/** * Exports the LDAP values such as posix account properties of the given ldapGroup as xml string. * * @param ldapGroup */ public String getLdapValuesAsXml(final LdapGroup ldapGroup) { final LdapConfig ldapConfig = ldapService.getLdapConfig(); final LdapPosixAccountsConfig posixAccountsConfig = ldapConfig != null ? ldapConfig.getPosixAccountsConfig() : null; LdapGroupValues values = null; if (posixAccountsConfig != null) { values = new LdapGroupValues(); if (ldapGroup.getGidNumber() != null) { values.setGidNumber(ldapGroup.getGidNumber()); } } return getLdapValuesAsXml(values); }
@Override public void validate(final Form<?> form) { final LdapGroupValues values = new LdapGroupValues(); values.setGidNumber(gidNumberField.getConvertedInput()); if (StringUtils.isBlank(data.getLdapValues()) == true && values.isPosixValuesEmpty() == true) { // Nothing to validate: all fields are zero and posix account wasn't set for this group before. return; } if (values.getGidNumber() == null) { gidNumberField .error(getLocalizedMessage(WebConstants.I18N_KEY_FIELD_REQUIRED, getString("ldap.gidNumber"))); } else { if (ldapPosixGroupsUtils.isGivenNumberFree(data, values.getGidNumber()) == false) { gidNumberField.error( getLocalizedMessage("ldap.gidNumber.alreadyInUse", ldapPosixGroupsUtils.getNextFreeGidNumber())); } } } });
public void validate(final Form<?> form) final LdapGroupValues values = new LdapGroupValues(); values.setGidNumber(gidNumberField.getConvertedInput()); if (StringUtils.isBlank(data.getLdapValues()) == true && values.isPosixValuesEmpty() == true) {
ldapGroupValues = groupDOConverter.readLdapGroupValues(data.getLdapValues()); if (ldapGroupValues == null) { ldapGroupValues = new LdapGroupValues();