[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Using Namespaces, IDs etc.

My thought was that when the ID URI's might not actualy be WWW URL's
of the resources they identify, but something like
phpbb://User@xxxxxxxxxxxxxx/, then it's not a good idea to rely on
toURI().toURL() because that would assume things about the
implementations. There should be a way to know if the ID can be
converted to an URL that a user could copy&paste to the browser's
address bar and find something useful there.

But maybe this could be done by checking whether the URL's protocol is
http? That still leaves the possibility of ID's that could also be
represented by a http URL but aren't. For example if I'd use phpbb://
instead of http://

On 9/4/06, slewis <slewis@xxxxxxxxxxxxx> wrote:
Hi Erkki,

Erkki Lindpere wrote:
> Why would it be good to include the username in the ID? One thing I
> can think of is that the same bulletin board objects might look
> different to different users, if they have different privileges.

Yes.  I've been thinking that the ID could optionally include the
username as the URI spec
(http://www.gbiv.com/protocols/uri/rfc/rfc3986.html) includes an
optional 'authority' that is intended to represent the user@host:port
combination for the URI...and service URIs and IDs are generally
similar.   But I have also been thinking that it would be up to the
service/namespace provider implementation to define what the appropriate
URI syntax would be for its namespace...so it may be that some providers
include/require the username in the ID, and others don't.  For a
bulletin board API it seems to me the use of username needs to be
optional, as they don't all require/use them, but many do.

> So far I've used actual WWW URL's, and some applications actually need
> to get the actual WWW URL's somehow (for example the example.bbreader,
> which gets them using id.toURI().toURL()), which is kind of bad, I
> admit.

It doesn't seem so bad to me...why do you see this id.toURI().toURL() as

> One thing I can think of to replace this method of getting the URL's
> is to make the ID implementations adapt to URL, since ID's are
> IAdaptable anyway and this would require no API change. Another way is
> to  implement an interface with a getURL() method and use instanceof
> to know if an object has a WWW URL. I think I'd prefer adapting.

Yes we could easily introduce an adapter to do toURL(), but that would
actually be more code (to get the adapter) than the id.toURI().toURL()
idiom.  Let me know why you would prefer an adapter that has getURL() to
the toURI().toURL().



> >> I would also be inclined to make the ID include the username (if not in >> anonymous mode). I assume that the ID could have URI-nature like: >> >> phpbb://slewis@xxxxxxxxxxxxxxxxxxx/index.php?topic=68 >> >> or something like that. Having flexibility in the definition of the >> targetID is the reason for the ECF namespace extension point (so >> basically you can define your own URI for the given service). > _______________________________________________ > ecf-dev mailing list > ecf-dev@xxxxxxxxxxx > https://dev.eclipse.org/mailman/listinfo/ecf-dev

ecf-dev mailing list