Search in sources :

Example 6 with AsciiNameValidation

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

the class NewClusterPolicyModel method validate.

private boolean validate() {
    getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(50), new AsciiNameValidation() });
    getDescription().validateEntity(new IValidation[] { new LengthValidation(400), new AsciiOrNoneValidation() });
    return getName().getIsValid() && getDescription().getIsValid() && getCustomPropertySheet().validate();
}
Also used : AsciiOrNoneValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation) 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 7 with AsciiNameValidation

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

the class PosixStorageModel method validate.

@Override
public boolean validate() {
    getPath().validateEntity(new IValidation[] { new NotEmptyValidation() });
    getVfsType().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
    return getPath().getIsValid() && getVfsType().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)

Example 8 with AsciiNameValidation

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

the class ProviderModel method validate.

private boolean validate() {
    getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
    getType().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
    getNeutronAgentModel().validate();
    getVmwarePropertiesModel().validate();
    getKvmPropertiesModel().validate();
    getXenPropertiesModel().validate();
    boolean connectionSettingsValid = validateConnectionSettings();
    return connectionSettingsValid && getName().getIsValid() && getType().getIsValid() && getNeutronAgentModel().getIsValid() && getKvmPropertiesModel().getIsValid() && getXenPropertiesModel().getIsValid() && getVmwarePropertiesModel().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)

Example 9 with AsciiNameValidation

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

the class DataCenterModel method validate.

public boolean validate() {
    getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(40), new LengthValidation(getMaxNameLength()), new AsciiNameValidation() });
    getVersion().validateSelectedItem(new IValidation[] { new NotEmptyValidation() });
    getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() });
    getComment().validateEntity(new IValidation[] { new SpecialAsciiI18NOrNoneValidation() });
    boolean validationResult = getName().getIsValid() && getDescription().getIsValid() && getComment().getIsValid() && getVersion().getIsValid();
    return validationResult;
}
Also used : AsciiOrNoneValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) AsciiNameValidation(org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation) SpecialAsciiI18NOrNoneValidation(org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation) LengthValidation(org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)

Example 10 with AsciiNameValidation

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

the class VolumeModel method validate.

public boolean validate() {
    if (!validateBrickCount()) {
        setMessage(VolumeBrickModel.getValidationFailedMsg(getTypeList().getSelectedItem(), true));
        return false;
    }
    getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(50), new AsciiNameValidation() });
    setMessage(null);
    boolean validTransportTypes = true;
    if (!getTcpTransportType().getEntity() && !getRdmaTransportType().getEntity()) {
        validTransportTypes = false;
        setMessage(ConstantsManager.getInstance().getConstants().volumeTransportTypesValidationMsg());
    }
    return getName().getIsValid() && validTransportTypes;
}
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)

Aggregations

AsciiNameValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation)12 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)11 LengthValidation (org.ovirt.engine.ui.uicommonweb.validation.LengthValidation)6 AsciiOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation)3 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)2 SpecialAsciiI18NOrNoneValidation (org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation)2 HashSet (java.util.HashSet)1 NewVnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel)1 VnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel)1 BrickMountPointValidation (org.ovirt.engine.ui.uicommonweb.validation.BrickMountPointValidation)1 CidrValidation (org.ovirt.engine.ui.uicommonweb.validation.CidrValidation)1 Ipv4AddressValidation (org.ovirt.engine.ui.uicommonweb.validation.Ipv4AddressValidation)1 RegexValidation (org.ovirt.engine.ui.uicommonweb.validation.RegexValidation)1