Well, the equivalent from Oak in 
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/namepath/NameMapper.java
 only provides mappings from JCR (Expanded or Qualified) to Oak internal form 
(which always uses prefixes IIUC) but not the other way around. But maybe I 
miss something here…

Konrad

 

> On 16. Jan 2025, at 08:24, Julian Reschke <julian.reschke.apa...@gmail.com> 
> wrote:
> 
> On 15.01.2025 20:57, Konrad Windszus wrote:
>> Hi,
>> I am wondering what is the best way to get the expanded form name 
>> (https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.2.5.1%20Expanded%20Form)
>>  from a given javax.jcr.Item (Node or Property). There is no method exposed 
>> directly from 
>> https://developer.adobe.com/experience-manager/reference-materials/spec/javax.jcr/javadocs/jcr-2.0/javax/jcr/Item.html.
>> However there are some edge cases where you want to compare the returned 
>> names with the stable qualified form (regardless of potential session/global 
>> mapping).
>> There are workaround which require the consumer to deal with 
>> org.apache.jackrabbit.spi.commons.conversion.NameResolver 
>> (https://jackrabbit.apache.org/api/2.20/org/apache/jackrabbit/spi/commons/conversion/NameResolver.html),
>>  however there doesn’t seem to be an easy way to retrieve it (at least in 
>> Oak, while JR2 implemented this via its 
>> https://jackrabbit.apache.org/api/2.20/org/apache/jackrabbit/core/SessionImpl.html).
>> Am I missing something here?
>> WDYT about adding a JackrabbitItem to 
>> https://jackrabbit.apache.org/oak/docs/apidocs/org/apache/jackrabbit/api/package-summary.html
>>  which extends javax.jcr.Item to expose a “String getExpandedName()”?
>> Thanks for your input in advance,
>> Konrad
> 
> The actual operation is not that complex, right? (A simple concatenation).
> 
> But yes, we could add that (it would even come with a default implementation 
> we never would have to override).
> 
> Best regards, Julian
> 

Reply via email to