use of org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation in project ovirt-engine by oVirt.
the class DisksAllocationModel method validateEntity.
@Override
public void validateEntity(IValidation[] validations) {
super.validateEntity(validations);
if (getDisks() == null) {
return;
}
boolean isModelValid = true;
for (DiskModel diskModel : getDisks()) {
ListModel<StorageDomain> diskStorageDomains = diskModel.getStorageDomain();
if (!diskStorageDomains.getItems().iterator().hasNext() || diskStorageDomains.getSelectedItem() == null) {
diskModel.getStorageDomain().getInvalidityReasons().add(constants.storageDomainMustBeSpecifiedInvalidReason());
diskModel.getStorageDomain().setIsValid(false);
isModelValid = false;
}
diskModel.getAlias().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation() });
isModelValid = isModelValid && diskModel.getAlias().getIsValid();
}
setIsValid(isModelValid);
}
use of org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation in project ovirt-engine by oVirt.
the class TagModel method validate.
public boolean validate() {
LengthValidation tempVar = new LengthValidation();
tempVar.setMaxLength(40);
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar, new I18NNameValidation() });
return getName().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation in project ovirt-engine by oVirt.
the class AffinityGroupModel method validate.
protected boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new I18NNameValidation() });
getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() });
return getName().getIsValid() && getDescription().getIsValid();
}
use of org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation in project ovirt-engine by oVirt.
the class MoveOrCopyDiskModel method validate.
public boolean validate() {
boolean quotaValidated = true;
if (getQuotaEnforcementType() == QuotaEnforcementTypeEnum.DISABLED || getQuotaEnforcementType() == QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT) {
quotaValidated = false;
}
boolean isValid = true;
for (DiskModel diskModel : getDisks()) {
if (quotaValidated) {
diskModel.getQuota().validateSelectedItem(new IValidation[] { new SelectedQuotaValidation() });
isValid &= diskModel.getQuota().getIsValid();
}
diskModel.getAlias().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation() });
isValid &= diskModel.getAlias().getIsValid();
}
return isValid;
}
use of org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation in project ovirt-engine by oVirt.
the class IscsiBondModel method validate.
private boolean validate() {
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new I18NNameValidation(), new LengthValidation(50) });
getDescription().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation(), new LengthValidation(4000) });
if (getNetworks().getSelectedItems() == null || getNetworks().getSelectedItems().isEmpty()) {
getInvalidityReasons().add(constants.noNetworksSelected());
setIsValid(false);
} else {
setIsValid(true);
}
return getName().getIsValid() && getDescription().getIsValid() && getIsValid();
}
Aggregations