use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class GlusterVolumeGeoRepCreateModel method validate.
public boolean validate() {
getSlaveVolumes().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(128) });
getSlaveHosts().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(128) });
return getSlaveVolumes().getIsValid() && getSlaveHosts().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class ImportVmModel method validateName.
private boolean validateName(final ImportVmData data) {
final int maxNameLength = getMaxNameLength();
VmImportGeneralModel model = (VmImportGeneralModel) getDetailModels().get(0);
EntityModel<String> vmName = new EntityModel<>(data.getVm().getName());
vmName.validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(maxNameLength), new I18NNameValidation(), new UniqueNameValidator(data), value -> isNameExistsInTheSystem(vmName.getEntity()) ? ValidationResult.fail(ConstantsManager.getInstance().getConstants().nameMustBeUniqueInvalidReason()) : ValidationResult.ok() });
data.setError(vmName.getIsValid() ? null : ConstantsManager.getInstance().getConstants().invalidName());
// Updating the 'name' model in general sub-tab
model.getName().setInvalidityReasons(vmName.getInvalidityReasons());
model.getName().setIsValid(vmName.getIsValid());
return vmName.getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class ImportVmsModel method validateVmwareConfiguration.
private boolean validateVmwareConfiguration() {
getvCenter().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
getEsx().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
getVmwareDatacenter().validateEntity(new IValidation[] { new NotEmptyValidation() });
getUsername().validateEntity(new IValidation[] { new NotEmptyValidation(), new NameAndOptionalDomainValidation() });
getPassword().validateEntity(new IValidation[] { new NotEmptyValidation() });
return getvCenter().getIsValid() && getEsx().getIsValid() && getVmwareDatacenter().getIsValid() && getUsername().getIsValid() && getPassword().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class ImportVmsModel method validateKvmConfiguration.
private boolean validateKvmConfiguration() {
getKvmUri().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255) });
getKvmUsername().validateEntity(new IValidation[] { new NotEmptyValidation() });
getKvmPassword().validateEntity(new IValidation[] { new NotEmptyValidation() });
return getKvmUri().getIsValid() && getKvmUsername().getIsValid() && getKvmPassword().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.
the class UnitVmModel method validateNaming.
private boolean validateNaming() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(getBehavior().getMaxNameLength()), getBehavior().getNameAllowedCharactersIValidation() });
getDescription().validateEntity(new IValidation[] { new LengthValidation(DESCRIPTION_MAX_LIMIT), new SpecialAsciiI18NOrNoneValidation() });
final boolean isValid = getName().getIsValid() && getDescription().getIsValid();
setValidTab(TabName.GENERAL_TAB, isValidTab(TabName.GENERAL_TAB) && isValid);
return isValid;
}
Aggregations