You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Costin Leau <co...@gmail.com> on 2006/01/09 15:30:05 UTC

Re[2]: escape/unescape jcr names implementation

Thanks Marcel.

I've found the class but at a different path:
http://svn.apache.org/viewcvs.cgi/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/ISO9075.java
However, I've seen that internally it relies on Jackrabbit qname
implementation - is there any way to remove this dependency? I need to
the code to use only JCR api (javax.jcr) code.


> Hi Costin,

> there is a utility class in jackrabbit-commons that you can use:
> org.apache.jackrabbit.util.ISO9075

> the jackrabbit-commons library is built in:
> trunk/jackrabbit/modules/commons

> regards
>   marcel

> Costin Leau wrote:
>> # sorry for the previous email, I hit the send button accidentally ...
>> 
>> Hello everybody.
>> 
>> I'm having some problems with some jcr name which contain illegal
>> characters as defined in Section 6.2.5.2 of the spec. I am looking for
>> advices and an implementation that could do the escaping and unescaping using the
>> _xHHHH_ method and I only found one that does escaping inside
>> JackRabbit. Isn't there a need to unescape the values into its
>> original format (so that
>> String specialStr == unescape(escape(specialStr)) ) ?
>> 
>> I've seen also a thread from some time ago opened by Brian and the
>> answer (and the solution used not in Cosmo by looking at the code)
>> seems to be hex encoding similar to the url one.
>> 
>> What is the recommended way of encoding/decoding and are some
>> implementations available out there? I'm trying to find one that
>> affects the repository as little as possible so that clients
>> connecting to the repository from outside my app should be able to decode the
>> names in a standard manner.
>> 



-- 
Best regards,
 Costin                            mailto:costin.leau@gmail.com


Re: escape/unescape jcr names implementation

Posted by Marcel Reutegger <ma...@day.com>.
the jackrabbit-commons module is only a dummy module that does not 
contain code itself but borrows it from the 'core'. that's why the class 
is located under trunk/jackrabbit.

if you intend to use the jackrabbit-commons.jar you get the QName class 
anyway because it is also part of that jar file ;)

regards
  marcel

Costin Leau wrote:
> Thanks Marcel.
> 
> I've found the class but at a different path:
> http://svn.apache.org/viewcvs.cgi/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/util/ISO9075.java
> However, I've seen that internally it relies on Jackrabbit qname
> implementation - is there any way to remove this dependency? I need to
> the code to use only JCR api (javax.jcr) code.
>