You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Torgeir Veimo <to...@gmail.com> on 2014/08/04 16:39:23 UTC

oak: allowing sns for nt:file using mixin

I have a mixin I use with nt:file nodes to allow some same name
sibling child nodes (when of a specific node type).

Is this not supported with oak? I am getting
javax.jcr.ItemExistsException when I add several child nodes with the
same name, while it works in jackrabbit 2.8.


-- 
-Tor

Re: oak: allowing sns for nt:file using mixin

Posted by Michael Dürig <md...@apache.org>.

On 2.9.14 2:38 , Michael Dürig wrote:
>
> No need, I could reproduce this on trunk. Will follow up with an issue.
> I think we need to change something here as the same name siblings
> created through the upgrade tool are really unusable.

I spawned a thread on oak-dev for working out possible approaches: 
http://markmail.org/message/7qczhkpicvq7q5ea

Michael

>
> Michael
>
> On 2.9.14 2:20 , Torgeir Veimo wrote:
>> Correct. This was with oak-run built from 1.0.3 if I remember
>> correctly. I can try again with 1.0.5.
>>
>> On 02/09/2014, Michael Dürig <md...@apache.org> wrote:
>>>
>>>
>>> On 2.9.14 2:05 , Torgeir Veimo wrote:
>>>> I did actually convert the content using oak-run. We don't actually
>>>> need SNS support, we only need to migrate existing content, and it
>>>> would be preferable if oak-run uses a pattern for renaming them that
>>>> allows later editing of said nodes.
>>>
>>> IIUC you used oak-run to migrate an existing repo containing SNSs and
>>> ended up with a Oak repo where these nodes are named like[1] this[2].
>>> Now you can't rename these nodes as this throws a RepositoryException!?
>>>
>>>
>>> Michael
>>>
>>
>>

Re: oak: allowing sns for nt:file using mixin

Posted by Michael Dürig <md...@apache.org>.
No need, I could reproduce this on trunk. Will follow up with an issue. 
I think we need to change something here as the same name siblings 
created through the upgrade tool are really unusable.

Michael

On 2.9.14 2:20 , Torgeir Veimo wrote:
> Correct. This was with oak-run built from 1.0.3 if I remember
> correctly. I can try again with 1.0.5.
>
> On 02/09/2014, Michael Dürig <md...@apache.org> wrote:
>>
>>
>> On 2.9.14 2:05 , Torgeir Veimo wrote:
>>> I did actually convert the content using oak-run. We don't actually
>>> need SNS support, we only need to migrate existing content, and it
>>> would be preferable if oak-run uses a pattern for renaming them that
>>> allows later editing of said nodes.
>>
>> IIUC you used oak-run to migrate an existing repo containing SNSs and
>> ended up with a Oak repo where these nodes are named like[1] this[2].
>> Now you can't rename these nodes as this throws a RepositoryException!?
>>
>>
>> Michael
>>
>
>

Re: oak: allowing sns for nt:file using mixin

Posted by Torgeir Veimo <to...@gmail.com>.
Correct. This was with oak-run built from 1.0.3 if I remember
correctly. I can try again with 1.0.5.

On 02/09/2014, Michael Dürig <md...@apache.org> wrote:
>
>
> On 2.9.14 2:05 , Torgeir Veimo wrote:
>> I did actually convert the content using oak-run. We don't actually
>> need SNS support, we only need to migrate existing content, and it
>> would be preferable if oak-run uses a pattern for renaming them that
>> allows later editing of said nodes.
>
> IIUC you used oak-run to migrate an existing repo containing SNSs and
> ended up with a Oak repo where these nodes are named like[1] this[2].
> Now you can't rename these nodes as this throws a RepositoryException!?
>
>
> Michael
>


-- 
-Tor

Re: oak: allowing sns for nt:file using mixin

Posted by Michael Dürig <md...@apache.org>.

On 2.9.14 2:05 , Torgeir Veimo wrote:
> I did actually convert the content using oak-run. We don't actually
> need SNS support, we only need to migrate existing content, and it
> would be preferable if oak-run uses a pattern for renaming them that
> allows later editing of said nodes.

IIUC you used oak-run to migrate an existing repo containing SNSs and 
ended up with a Oak repo where these nodes are named like[1] this[2]. 
Now you can't rename these nodes as this throws a RepositoryException!?


Michael

Re: oak: allowing sns for nt:file using mixin

Posted by Torgeir Veimo <to...@gmail.com>.
I did actually convert the content using oak-run. We don't actually
need SNS support, we only need to migrate existing content, and it
would be preferable if oak-run uses a pattern for renaming them that
allows later editing of said nodes.

On 8 August 2014 17:59, Michael Dürig <md...@apache.org> wrote:
>
>
> On 5.8.14 12:56 , Torgeir Veimo wrote:
>>
>> Two questions: Is there any technical reason jcr clients can't use the
>> name[index] name pattern, similar to oak internal?
>
>
> The only reason I see is that there didn't seem to be much of a need so far.
> That's probably also why OAK-203 is still open.
>
>
>>
>> When importing content from jackrabbit which contains content with
>> SNS, what't the recommended approach to edit such nodes? Now I'm
>> getting exceptions like
>
>
> How do you import that content? It is recommended to go through the upgrade
> functionality of oak-run. See
> https://github.com/apache/jackrabbit-oak/tree/trunk/oak-run.
>
> Michael
>
>
>>
>> 20:38:35,833 ERROR services.RepositoryAdminService.addProperty() -
>> line 331 [127.0.0.1] - unable to add property;
>> javax.jcr.PathNotFoundException: /nen:content[2]
>> at
>> org.apache.jackrabbit.oak.jcr.session.SessionContext.getOakPathOrThrowNotFound(SessionContext.java:358)
>> at
>> org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.getOakPathOrThrowNotFound(VersionManagerImpl.java:248)
>> at
>> org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.access$000(VersionManagerImpl.java:53)
>>
>> Is it expected that all content imported from jackrabbit is to fixup
>> all existing node names to avoid SNS and avoid using the name[index]
>> name pattern, before such content can be modified in oak?
>>
>>
>>
>> On 5 August 2014 17:13, Michael Dürig <md...@apache.org> wrote:
>>>
>>>
>>>
>>> On 5.8.14 2:56 , Torgeir Veimo wrote:
>>>>
>>>>
>>>> So since that issue is unresolved, I assume I have to add the index
>>>> manually. If I then use a naming scheme like name[index], I get an
>>>> exception;
>>>>
>>>> javax.jcr.RepositoryException: Cannot create a new node using a name
>>>> including an index
>>>
>>>
>>>
>>> AFAIR you currently can't do that through the JCR API with Oak. This is
>>> only
>>> supported on Oak's internal interfaces: "the underlying oak-core and
>>> microkernel -level SNS nodes simply used the "name[index]" naming pattern
>>> with no extra semantics associated with it." [1]. We added this so Oak
>>> can
>>> cope with e.g. node type definitions, which make use of SNSs.
>>>
>>> Michael
>>>
>>> [1] https://issues.apache.org/jira/browse/OAK-203
>>
>>
>>
>>
>



-- 
-Tor

Re: oak: allowing sns for nt:file using mixin

Posted by Michael Dürig <md...@apache.org>.

On 5.8.14 12:56 , Torgeir Veimo wrote:
> Two questions: Is there any technical reason jcr clients can't use the
> name[index] name pattern, similar to oak internal?

The only reason I see is that there didn't seem to be much of a need so 
far. That's probably also why OAK-203 is still open.

>
> When importing content from jackrabbit which contains content with
> SNS, what't the recommended approach to edit such nodes? Now I'm
> getting exceptions like

How do you import that content? It is recommended to go through the 
upgrade functionality of oak-run. See 
https://github.com/apache/jackrabbit-oak/tree/trunk/oak-run.

Michael

>
> 20:38:35,833 ERROR services.RepositoryAdminService.addProperty() -
> line 331 [127.0.0.1] - unable to add property;
> javax.jcr.PathNotFoundException: /nen:content[2]
> at org.apache.jackrabbit.oak.jcr.session.SessionContext.getOakPathOrThrowNotFound(SessionContext.java:358)
> at org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.getOakPathOrThrowNotFound(VersionManagerImpl.java:248)
> at org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.access$000(VersionManagerImpl.java:53)
>
> Is it expected that all content imported from jackrabbit is to fixup
> all existing node names to avoid SNS and avoid using the name[index]
> name pattern, before such content can be modified in oak?
>
>
>
> On 5 August 2014 17:13, Michael Dürig <md...@apache.org> wrote:
>>
>>
>> On 5.8.14 2:56 , Torgeir Veimo wrote:
>>>
>>> So since that issue is unresolved, I assume I have to add the index
>>> manually. If I then use a naming scheme like name[index], I get an
>>> exception;
>>>
>>> javax.jcr.RepositoryException: Cannot create a new node using a name
>>> including an index
>>
>>
>> AFAIR you currently can't do that through the JCR API with Oak. This is only
>> supported on Oak's internal interfaces: "the underlying oak-core and
>> microkernel -level SNS nodes simply used the "name[index]" naming pattern
>> with no extra semantics associated with it." [1]. We added this so Oak can
>> cope with e.g. node type definitions, which make use of SNSs.
>>
>> Michael
>>
>> [1] https://issues.apache.org/jira/browse/OAK-203
>
>
>

Re: oak: allowing sns for nt:file using mixin

Posted by Torgeir Veimo <to...@gmail.com>.
Renaming imported nodes with names such as name[index] isn't possible,
since session.move() takes the nodes path, containing 'name[index]',
which throws javax.jcr.PathNotFoundException.

On 5 August 2014 20:56, Torgeir Veimo <to...@gmail.com> wrote:
> Two questions: Is there any technical reason jcr clients can't use the
> name[index] name pattern, similar to oak internal?
>
> When importing content from jackrabbit which contains content with
> SNS, what't the recommended approach to edit such nodes? Now I'm
> getting exceptions like
>
> 20:38:35,833 ERROR services.RepositoryAdminService.addProperty() -
> line 331 [127.0.0.1] - unable to add property;
> javax.jcr.PathNotFoundException: /nen:content[2]
> at org.apache.jackrabbit.oak.jcr.session.SessionContext.getOakPathOrThrowNotFound(SessionContext.java:358)
> at org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.getOakPathOrThrowNotFound(VersionManagerImpl.java:248)
> at org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.access$000(VersionManagerImpl.java:53)
>
> Is it expected that all content imported from jackrabbit is to fixup
> all existing node names to avoid SNS and avoid using the name[index]
> name pattern, before such content can be modified in oak?
>
>
>
> On 5 August 2014 17:13, Michael Dürig <md...@apache.org> wrote:
>>
>>
>> On 5.8.14 2:56 , Torgeir Veimo wrote:
>>>
>>> So since that issue is unresolved, I assume I have to add the index
>>> manually. If I then use a naming scheme like name[index], I get an
>>> exception;
>>>
>>> javax.jcr.RepositoryException: Cannot create a new node using a name
>>> including an index
>>
>>
>> AFAIR you currently can't do that through the JCR API with Oak. This is only
>> supported on Oak's internal interfaces: "the underlying oak-core and
>> microkernel -level SNS nodes simply used the "name[index]" naming pattern
>> with no extra semantics associated with it." [1]. We added this so Oak can
>> cope with e.g. node type definitions, which make use of SNSs.
>>
>> Michael
>>
>> [1] https://issues.apache.org/jira/browse/OAK-203
>
>
>
> --
> -Tor



-- 
-Tor

Re: oak: allowing sns for nt:file using mixin

Posted by Torgeir Veimo <to...@gmail.com>.
Two questions: Is there any technical reason jcr clients can't use the
name[index] name pattern, similar to oak internal?

When importing content from jackrabbit which contains content with
SNS, what't the recommended approach to edit such nodes? Now I'm
getting exceptions like

20:38:35,833 ERROR services.RepositoryAdminService.addProperty() -
line 331 [127.0.0.1] - unable to add property;
javax.jcr.PathNotFoundException: /nen:content[2]
at org.apache.jackrabbit.oak.jcr.session.SessionContext.getOakPathOrThrowNotFound(SessionContext.java:358)
at org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.getOakPathOrThrowNotFound(VersionManagerImpl.java:248)
at org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.access$000(VersionManagerImpl.java:53)

Is it expected that all content imported from jackrabbit is to fixup
all existing node names to avoid SNS and avoid using the name[index]
name pattern, before such content can be modified in oak?



On 5 August 2014 17:13, Michael Dürig <md...@apache.org> wrote:
>
>
> On 5.8.14 2:56 , Torgeir Veimo wrote:
>>
>> So since that issue is unresolved, I assume I have to add the index
>> manually. If I then use a naming scheme like name[index], I get an
>> exception;
>>
>> javax.jcr.RepositoryException: Cannot create a new node using a name
>> including an index
>
>
> AFAIR you currently can't do that through the JCR API with Oak. This is only
> supported on Oak's internal interfaces: "the underlying oak-core and
> microkernel -level SNS nodes simply used the "name[index]" naming pattern
> with no extra semantics associated with it." [1]. We added this so Oak can
> cope with e.g. node type definitions, which make use of SNSs.
>
> Michael
>
> [1] https://issues.apache.org/jira/browse/OAK-203



-- 
-Tor

Re: oak: allowing sns for nt:file using mixin

Posted by Michael Dürig <md...@apache.org>.

On 5.8.14 2:56 , Torgeir Veimo wrote:
> So since that issue is unresolved, I assume I have to add the index
> manually. If I then use a naming scheme like name[index], I get an
> exception;
>
> javax.jcr.RepositoryException: Cannot create a new node using a name
> including an index

AFAIR you currently can't do that through the JCR API with Oak. This is 
only supported on Oak's internal interfaces: "the underlying oak-core 
and microkernel -level SNS nodes simply used the "name[index]" naming 
pattern with no extra semantics associated with it." [1]. We added this 
so Oak can cope with e.g. node type definitions, which make use of SNSs.

Michael

[1] https://issues.apache.org/jira/browse/OAK-203

Re: oak: allowing sns for nt:file using mixin

Posted by Torgeir Veimo <to...@gmail.com>.
So since that issue is unresolved, I assume I have to add the index
manually. If I then use a naming scheme like name[index], I get an
exception;

javax.jcr.RepositoryException: Cannot create a new node using a name
including an index
at org.apache.jackrabbit.oak.jcr.session.SessionImpl.checkIndexOnName(SessionImpl.java:98)
at org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(NodeImpl.java:252)



On 5 August 2014 00:47, Michael Dürig <md...@apache.org> wrote:
>
>
> On 4.8.14 4:39 , Torgeir Veimo wrote:
>>
>> I have a mixin I use with nt:file nodes to allow some same name
>> sibling child nodes (when of a specific node type).
>>
>> Is this not supported with oak? I am getting
>> javax.jcr.ItemExistsException when I add several child nodes with the
>> same name, while it works in jackrabbit 2.8.
>
>
>
> SNSs are deprecated in Oak. See
> http://jackrabbit.apache.org/oak/docs/differences.html#Same_name_siblings
>
> Michael



-- 
-Tor

Re: oak: allowing sns for nt:file using mixin

Posted by Michael Dürig <md...@apache.org>.

On 4.8.14 4:39 , Torgeir Veimo wrote:
> I have a mixin I use with nt:file nodes to allow some same name
> sibling child nodes (when of a specific node type).
>
> Is this not supported with oak? I am getting
> javax.jcr.ItemExistsException when I add several child nodes with the
> same name, while it works in jackrabbit 2.8.


SNSs are deprecated in Oak. See 
http://jackrabbit.apache.org/oak/docs/differences.html#Same_name_siblings

Michael