Bug 272530 - [repository] Add location validation method suitable for use by UI
Summary: [repository] Add location validation method suitable for use by UI
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Henrik Lindberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 272066
  Show dependency tree
 
Reported: 2009-04-16 13:13 EDT by Henrik Lindberg CLA
Modified: 2009-04-23 12:36 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Lindberg CLA 2009-04-16 13:13:38 EDT
The current repository factory methods for validation are not suitable for validating user input as they perform long running communication (in some cases) to perform real validation. A method is needed that only performs those checks that are safe to use in a UI.
Comment 1 Henrik Lindberg CLA 2009-04-16 13:17:10 EDT
Fixed in HEAD.

RepositoryHelper#checkRepositoryLocationSyntax can now be used. It returns IStatus.ERROR with appropriate NLS message, or IStatus.OK
Comment 2 Susan McCourt CLA 2009-04-16 19:22:34 EDT
Updated the UI to use this method.
Had to add the UI as a friend in the manifest.
(And I noticed the milestone was marked 3.4M7 so am changing to 3.5M7)

thanks...
Comment 3 Pascal Rapicault CLA 2009-04-16 21:17:42 EDT
The testing of scheme in RepositoryHelper#checkRepositoryLocation is incorrect because we are not using URL to actually load the file. For example if someone was to add a new protocol (e.g. "db:") using ECF pluggable transport layer, then we could not add a repository.
The proper check should involve ECF, however I don't think there is an API to get the list of protocols it understand.
Comment 4 Henrik Lindberg CLA 2009-04-16 21:31:56 EDT
(In reply to comment #3)
> The testing of scheme in RepositoryHelper#checkRepositoryLocation is incorrect
> because we are not using URL to actually load the file. For example if someone
> was to add a new protocol (e.g. "db:") using ECF pluggable transport layer,
> then we could not add a repository.
> The proper check should involve ECF, however I don't think there is an API to
> get the list of protocols it understand.
> 
See Bug 272557. I asked Scott how it should be done, and I used his recommendation.
As I understand it, ECF makes sure that schemes gets recognized when creating a URL.
We should check again with Scott to make sure (adding him as cc).

Inside ECF, the URI (or String) passed as location will (afaik) be turned into a URL, so I do believe that the check is ok.
Comment 5 Pascal Rapicault CLA 2009-04-16 22:19:00 EDT
I was not aware about this. I naively thought ECF would not force ppl to register their protocol as a URL handler.
Comment 6 Scott Lewis CLA 2009-04-16 23:00:42 EDT
(In reply to comment #5)
> I was not aware about this. I naively thought ECF would not force ppl to
> register their protocol as a URL handler.
> 

It doesn't force them to do anything :).  Rather it registers protocols declared via extension as URL handlers automatically...so that they can create and then use the URLs as input to IFileID creation.  

Now that we've moved to CDC 1.1 environment, where URI is available (rather than URL), we can relax this...but that change did not get in under the API freeze wire.

Comment 7 Henrik Lindberg CLA 2009-04-17 12:46:31 EDT
Thanks Scott. Marking this fixed.
Comment 8 Susan McCourt CLA 2009-04-23 12:36:34 EDT
noticed this was marked 3.5 while culling the remaining 3.5 bugs.
Changing to 3.5M7