Hi,

Am Montag, den 14.04.2008, 14:59 +0200 schrieb Alexander Klimetschek:
> 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?

The character set for URIs is not Unicode ...

>  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).

> 
> > 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?

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

Regards
Felix

Reply via email to