Arik Hadas has uploaded a new change for review. Change subject: webadmin: validate ......................................................................
webadmin: validate Change-Id: If4b65bbcd2429a3eb167ba93c193367dfe16727f Signed-off-by: Arik Hadas <aha...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ImportVmsFromSourceModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java 2 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/36810/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ImportVmsFromSourceModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ImportVmsFromSourceModel.java index 822c395..3b8853e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ImportVmsFromSourceModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ImportVmsFromSourceModel.java @@ -51,4 +51,18 @@ } })); } + + public boolean validate() { + for (Object item : getItems()) { + VM vmToImport = ((ImportVmData) item).getVm(); + for (VM vm : vms) { + if (vm.getName().equals(vmToImport.getName())) { + setMessage("arik!!"); ////$NON-NLS-1$ + return false; + } + } + } + + return true; + } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java index 2630578..be71e8f 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ImportVmFromExportDomainModel.java @@ -578,6 +578,10 @@ } public boolean validate() { + if (!super.validate()) { + return false; + } + if (QuotaEnforcementTypeEnum.HARD_ENFORCEMENT.equals(storagePool.getQuotaEnforcementType())) { getClusterQuota().validateSelectedItem( new IValidation[] { new NotEmptyValidation() }); -- To view, visit http://gerrit.ovirt.org/36810 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If4b65bbcd2429a3eb167ba93c193367dfe16727f Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches