Hi Felix!

Am 14.04.2008 um 16:16 schrieb Felix Meschberger:
How does Sling handle the
translation of URIs to resource/JCR paths?

The URI is tested unmodified on a character level. There is no URI
mangling to get the node name applied.

What if there are ambiguities?

There are "none". Either a node with that exact name exists or not.

IMHO the create-valid-and-unique-node-name mechanism
should also consider URIs, because that's what website users see in
the end.

The goal of URIs is to read and send them easily. For this reason any
special characters, in particular characters needing some form of
encoding should be prevented (if at all possible).

The one important thing is that people cannot create nodes that aren't accessible later because they are not a valid URI. But as I can see, the set of all possible URIs is contained within JCR paths. The proposed auto-naming is restricted to an even smaller set (a-z,0-9) that is fully contained within the URI set. Then there won't be any problems.

There should be some central API (OSGi service) that can be called
anywhere and that creates a valid name, acts in case of an existing
node in the repository, etc. All the stuff. There could be a very
simple implementation in Sling, and others could extend it by
replacing it with their own bundle. WDYT?

If you could come up with such a service, we might certainly consider
adding it.

Argh, I shouldn't have raised my arm. ;-)

Actually, actually my minimum requirement is that the auto-naming code is available as a (static) utility method for all code running in sling, because you need it very often. And nobody should be forced to re-invent the idea of valid characters every time....

The extensibility for special umlaute would be a nice-to-have, but less important.

Alex

--
Alexander Klimetschek
[EMAIL PROTECTED]

>> Day JCR Cup 08 | Win a MacBook Pro: http://dev.day.com/ <<




Reply via email to