jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Diephouse (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-977) jcr:deref in xpath predicates
Date Mon, 06 Jul 2009 20:39:14 GMT

    [ 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.


Mime
View raw message