Bug 740763

Summary: [webadmin] Implement uicompat UriValidator
Product: [Retired] oVirt Reporter: Vojtech Szocs <vszocs>
Component: ovirt-engine-webadminAssignee: Einav Cohen <ecohen>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: asaf, ecohen, gchaplik, iheim, ykaul
Target Milestone: m2   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ux
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-17 13:50:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vojtech Szocs 2011-09-23 09:41:19 UTC
Implement validation logic for org.ovirt.engine.ui.uicompat.UriValidator
  
Actual results:
UriValidator IsValid() method currently always returns true.

Expected results:
UriValidator IsValid() method should return true only for valid URIs. The method should not throw any exceptions.

Additional info:
http://stackoverflow.com/questions/2098750/regex-in-gwt-to-match-urls

Comment 1 Einav Cohen 2011-10-09 14:42:01 UTC
*** Bug 744568 has been marked as a duplicate of this bug. ***

Comment 2 Asaf Shakarchi 2011-10-10 01:37:43 UTC
This is a bit harder in client (GWT) code and cannot use the same approach used by backend in ValidationUtils class as URI is not a JRE enumated class,

Probably best approach is to implement by GWT RegExp.

Comment 3 Vojtech Szocs 2011-10-21 15:01:22 UTC
I see two options here,
1) use JSNI - native JS regexp support, or
2) use GWT com.google.gwt.regexp.shared.RegExp

Comment 4 Gilad Chaplik 2011-10-30 15:08:44 UTC
Take a look in the java URI code, and it seems to be native code (some string manipulation) that does the validation. maybe we can copy that code to a static util method and invoke it, to match the backend.

Comment 5 Itamar Heim 2012-05-17 09:06:21 UTC
still relevant?

Comment 6 Vojtech Szocs 2012-05-17 09:39:59 UTC
I think this is not relevant anymore.

uicompat's org.ovirt.engine.ui.uicompat.UriValidator is only used in uicommon's HostAddressValidation. Since UriValidator isn't implemented yet (always returns true), uicommon's HostAddressValidation doesn't really do any kind of validation.

On the other hand, in uicommonWEB, HostAddressValidation has been modified not to use UriValidator, and implements host address (IP or fully-qualified-domain-name) validation on its own.

Since both WebAdmin and new UserPortal use uicommonWEB, I guess we can close this ticket. [uicompat's UriValidator is only used by legacy UserPortal which isn't part of the build anymore]

Comment 7 Vojtech Szocs 2012-05-17 13:50:52 UTC
Closing this ticket as uicompat's UriValidator class is not used in uicommonweb, and therefore not used in WebAdmin & new UserPortal.

(it's used only in old UserPortal through uicommon dependency)

In WebAdmin & new UserPortal, UriValidator functionality is implemented directly in uicommonweb's HostAddressValidation.