Am 14.04.2008 um 14:42 schrieb Carsten Ziegeler:
Alexander Klimetschek wrote:
A minor, but very helpful addition:
For languages with Umlaute and other special characters, it would
be cool to support translating them into the nearest normal letter
instead of "_". For example, "รค" -> "ae" etc.
Hmm, yes and no :) Now, these characters are valid from the jcr pov
(at least I think they are), so there is no need to convert them.
JCR Names are XML Names, which have no intuitive description (not to
me), just a Unicode table of allowed characters:
Name/NameChar
http://www.w3.org/TR/REC-xml/#NT-NameChar
Table of allowed characters:
http://www.w3.org/TR/REC-xml/#NT-Letter
But are they very different from URIs? How does Sling handle the
translation of URIs to resource/JCR paths? What if there are
ambiguities? IMHO the create-valid-and-unique-node-name mechanism
should also consider URIs, because that's what website users see in
the end.
On the other hand it might be usefull to create "pretty names" or
web friendly names; but I'm not sure if this is the task of Sling to
do this.
Yes, in my experience all content-creating applications that want to
have meaningful URLs have the problem of finding a valid JCR/URI name
for a given user input. Having it part of the framework is IMHO
extremely useful.
We *could* create such a hook, but as this is only used in the case
of the post servlet and not if nodes are created through any other
way, I tend to leave this to the client code calling the post servlet.
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?
Alex
--
Alexander Klimetschek
[EMAIL PROTECTED]
>> Day JCR Cup 08 | Win a MacBook Pro: http://dev.day.com/ <<