hi,

On Tue, Sep 2, 2014 at 8:11 AM, Michael Dürig <mdue...@apache.org> wrote:
>
> Hi,
>
> There was a discussion on the user list re. this [1]: When upgrading a
> repository that contains SNSs, those are treated according to Oak's basic
> same name sibling support. That is, the names of such nodes are suffixed
> with their indexes in square brackets (see OAK-203 [2]). This is problematic
> as there is virtually nothing you can do later to such nodes through the JCR
> API apart from iterating them from the parent. Most other actions throw a
> "PathNotFoundException: sibling[42]" or some variant thereof.
>
> What would be the best way forward here?
>
> - Should we generally allow square brackets in the node names in Oak?
>
> or
>
> - Should we allow square brackets only when the name of an existing node
> already contained them?
>
> or
>
> - Should we not allow square brackets altogether and update the upgrade tool
> accordingly?
>
> Any other approach?

I would allow the "*[n]" suffix format for names and paths but not
being smart about it. eg:

session.getNode("/foo/bar[5]");
  -> works if such a node exists

"/foo".addNode("bar")
  -> works, if "bar" does not exist, otherwise fails

"/foo".addNode("bar[3]")
  -> works, if "bar[3]" does not exist, otherwise fails

"/foo".setProperty("name[n]")
  -> always fails.

different to jackrabbit:
  session.getNode("/foo/bar[5]").getName() = ""bar[5]" (where jr returns "bar").

I can't remember/didn't look-up the behavior for brackets not being
used as suffix, such as: "test[node". but the behavior should be
according JSR283.

regards, toby



regards, toby

>
> Michael
>
>
> [1] http://markmail.org/message/qge5nnyev3hzzipx
> [2] https://issues.apache.org/jira/browse/OAK-203

Reply via email to