Search in sources :

Example 1 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.

the class BookmarkModel method validate.

public boolean validate() {
    LengthValidation tempVar = new LengthValidation();
    tempVar.setMaxLength(40);
    getName().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar });
    LengthValidation tempVar2 = new LengthValidation();
    tempVar2.setMaxLength(300);
    getSearchString().validateEntity(new IValidation[] { new NotEmptyValidation(), tempVar2 });
    return getName().getIsValid() && getSearchString().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 2 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.

the class GlusterStorageModel method validate.

@Override
public boolean validate() {
    getGlusterVolumes().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(128) });
    getVfsType().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
    if (getLinkGlusterVolume().getEntity()) {
        return getGlusterVolumes().getIsValid() && getVfsType().getIsValid();
    } else {
        return super.validate();
    }
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 3 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.

the class ProviderModel method validateConnectionSettings.

private boolean validateConnectionSettings() {
    getUsername().validateEntity(new IValidation[] { new NotEmptyValidation() });
    getPassword().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(200) });
    if (getType().getSelectedItem().isTenantRequired()) {
        getTenantName().validateEntity(new IValidation[] { new NotEmptyValidation() });
    }
    getAuthUrl().validateEntity(new IValidation[] { new NotEmptyValidation(), new UrlValidation(Uri.SCHEME_HTTP, Uri.SCHEME_HTTPS) });
    getUrl().validateEntity(new IValidation[] { new NotEmptyValidation(), new UrlValidation(Uri.SCHEME_HTTP, Uri.SCHEME_HTTPS) });
    return (getUrl().getEntity() == null || getUrl().getIsValid() || getUrl().getEntity().isEmpty()) && getUsername().getIsValid() && getPassword().getIsValid() && getTenantName().getIsValid() && getAuthUrl().getIsValid();
}
Also used : UrlValidation(org.ovirt.engine.ui.uicommonweb.validation.UrlValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 4 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.

the class VmwarePropertiesModel method validate.

public boolean validate() {
    if (!getIsAvailable()) {
        setIsValid(true);
    } else {
        getvCenter().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
        getEsx().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() });
        vmwareDatacenter.validateEntity(new IValidation[] { new NotEmptyValidation() });
        setIsValid(getvCenter().getIsValid() && getEsx().getIsValid() && getVmwareDatacenter().getIsValid());
    }
    return getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) HostAddressValidation(org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 5 with LengthValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LengthValidation in project ovirt-engine by oVirt.

the class KVMPropertiesModel method validate.

public boolean validate() {
    if (!getIsAvailable()) {
        setIsValid(true);
    } else {
        getUrl().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255) });
        setIsValid(getUrl().getIsValid());
    }
    return getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Aggregations

LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)31 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)31 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)9 SpecialAsciiI18NOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation)7 AsciiNameValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)6 HostAddressValidation (org.ovirt.engine.ui.uicommonweb.validation.HostAddressValidation)6 I18NNameValidation (org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation)4 AsciiOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation)3 HostnameValidation (org.ovirt.engine.ui.uicommonweb.validation.HostnameValidation)2 I18NExtraNameOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.I18NExtraNameOrNoneValidation)2 IValidation (org.ovirt.engine.ui.uicommonweb.validation.IValidation)2 MatchFieldsValidator (org.ovirt.engine.ui.uicommonweb.validation.MatchFieldsValidator)2 RegexValidation (org.ovirt.engine.ui.uicommonweb.validation.RegexValidation)2 Map (java.util.Map)1 SortedMap (java.util.SortedMap)1 TreeMap (java.util.TreeMap)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 VmInitNetwork (org.ovirt.engine.core.common.businessentities.VmInitNetwork)1 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)1 NewVnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel)1