Kanagaraj M has uploaded a new change for review.

Change subject: webadmin: Adding validation for volume name
......................................................................

webadmin: Adding validation for volume name

The following validations are added for volume name.
- length cannot be more than 50
- name can have only ASCII letters, numbers, '_' or '-' signs

Change-Id: I691c7bbaecb764dcc722fd4d9f3fa7be5018a6d2
Signed-off-by: Kanagaraj M <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/13361/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
index dd1e540..28b465a 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
@@ -22,7 +22,9 @@
 import org.ovirt.engine.ui.uicommonweb.models.ListModel;
 import org.ovirt.engine.ui.uicommonweb.models.Model;
 import org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel;
+import org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation;
 import org.ovirt.engine.ui.uicommonweb.validation.IValidation;
+import org.ovirt.engine.ui.uicommonweb.validation.LengthValidation;
 import org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation;
 import org.ovirt.engine.ui.uicompat.ConstantsManager;
 import org.ovirt.engine.ui.uicompat.Event;
@@ -458,7 +460,8 @@
             return false;
         }
 
-        getName().ValidateEntity(new IValidation[] { new NotEmptyValidation() 
});
+        getName().ValidateEntity(new IValidation[] { new NotEmptyValidation(), 
new LengthValidation(50),
+                new AsciiNameValidation() });
 
         setMessage(null);
         boolean validTransportTypes = true;


--
To view, visit http://gerrit.ovirt.org/13361
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I691c7bbaecb764dcc722fd4d9f3fa7be5018a6d2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Kanagaraj M <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to