You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Frederic Esnault (JIRA)" <ji...@apache.org> on 2007/06/22 11:40:26 UTC

[jira] Created: (JCR-977) jcr:deref in xpath predicates

jcr:deref in xpath predicates
-----------------------------

                 Key: JCR-977
                 URL: https://issues.apache.org/jira/browse/JCR-977
             Project: Jackrabbit
          Issue Type: Improvement
          Components: query
    Affects Versions: 1.3
         Environment: n/a
            Reporter: Frederic Esnault
             Fix For: 1.3.1, 1.4


Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
book holds a reference property on its author(s)
authors have a name

We want all books from a specific author :

/jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']

This fails with an InvalidQueryException currently (not supported).

The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))

Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_LOCATION.

I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.

Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-977) jcr:deref in xpath predicates

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-977.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

> Are you going to put this into 2.x?

yes, this will go into 2.0.0

Applied patch in revision: 791737

Thanks again for your help.

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>             Fix For: 2.0.0
>
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-977) jcr:deref and parent axis in xpath predicates

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger updated JCR-977:
---------------------------------

    Summary: jcr:deref and parent axis in xpath predicates  (was: jcr:deref in xpath predicates)

Adjusted summary.

> jcr:deref and parent axis in xpath predicates
> ---------------------------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>            Assignee: Marcel Reutegger
>             Fix For: 2.0-alpha4
>
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-977) jcr:deref in xpath predicates

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-977:
------------------------------

        Fix Version/s:     (was: 1.3.1)
                           (was: 1.4)
    Affects Version/s:     (was: 1.3)

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: query
>         Environment: n/a
>            Reporter: Frederic Esnault
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-977) jcr:deref in xpath predicates

Posted by "Frederic Esnault (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frederic Esnault updated JCR-977:
---------------------------------

    Description: 
Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
book holds a reference property on its author(s)
authors have a name

We want all books from a specific author :

/jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']

This fails with an InvalidQueryException currently (not supported).

The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))

Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.

I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.

Frederic Esnault

  was:
Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
book holds a reference property on its author(s)
authors have a name

We want all books from a specific author :

/jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']

This fails with an InvalidQueryException currently (not supported).

The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))

Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_LOCATION.

I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.

Frederic Esnault


> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: query
>    Affects Versions: 1.3
>         Environment: n/a
>            Reporter: Frederic Esnault
>             Fix For: 1.3.1, 1.4
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-977) jcr:deref in xpath predicates

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger updated JCR-977:
---------------------------------

    Attachment: deref.patch

Good work, thanks a lot for the patch.

I've reviewed the patch an reworked it a bit. Streamlined some of the code and fixed a bug in LuceneQueryBuilder.

Dan, what do you think?

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (JCR-977) jcr:deref in xpath predicates

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger reopened JCR-977:
----------------------------------

      Assignee: Marcel Reutegger

There are some issues with the changes related to XPath QueryFormat.

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>            Assignee: Marcel Reutegger
>             Fix For: 2.0.0
>
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-977) jcr:deref in xpath predicates

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger updated JCR-977:
---------------------------------

    Component/s: jackrabbit-spi-commons

Also affect spi-commons.

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-977) jcr:deref in xpath predicates

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-977.
----------------------------------

    Resolution: Fixed

Fixed in revision: 792894

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>            Assignee: Marcel Reutegger
>             Fix For: 2.0.0
>
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-977) jcr:deref in xpath predicates

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727770#action_12727770 ] 

Dan Diephouse commented on JCR-977:
-----------------------------------

Thanks Marcel! Looks good, although I haven't had time to upgrade to the 2.x tree and really test it out. Are you going to put this into 2.x?

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-977) jcr:deref in xpath predicates

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12728723#action_12728723 ] 

Marcel Reutegger commented on JCR-977:
--------------------------------------

Fixed a bug in PredicateDerefQuery in revision: 792162

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, jackrabbit-spi-commons, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>             Fix For: 2.0.0
>
>         Attachments: deref.patch, deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-977) jcr:deref in xpath predicates

Posted by "Dan Diephouse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Diephouse updated JCR-977:
------------------------------

    Attachment: deref.patch

Here's a first stab at this. Needs cleanup, but the important part is it works. :-)

> jcr:deref in xpath predicates
> -----------------------------
>
>                 Key: JCR-977
>                 URL: https://issues.apache.org/jira/browse/JCR-977
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, query
>         Environment: n/a
>            Reporter: Frederic Esnault
>         Attachments: deref.patch
>
>
> Currently, the jcr:deref() function is not allowed in a xpath query predicate. Example :
> book holds a reference property on its author(s)
> authors have a name
> We want all books from a specific author :
> /jcr:root/element(*, bookType)[jcr:deref(@author, 'authorType')/@name = 'King']
> This fails with an InvalidQueryException currently (not supported).
> The error is raised in the XPathQueryBuilder class, in function : private QueryNode createFunction(SimpleNode node, QueryNode queryNode), in the block :
> else if (NameFormat.format(JCR_DEREF, resolver).equals(fName))
> Problem is that with this query, when evaluating the jcr:deref() function, then in this method at this point, queryNode.getType() is 0 and tests raise the exception if queryNode.getType() is neither QueryNode.TYPE_LOCATION nor QueryNode.TYPE_PATH.
> I think this is a useful place to put a deref function in a query, as I don't know how we could test the referenced node properties another way.
> Frederic Esnault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.