jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-225) Sling I18N queries not supported by Oak
Date Wed, 08 Aug 2012 12:30:22 GMT

    [ https://issues.apache.org/jira/browse/OAK-225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431082#comment-13431082
] 

Alexander Klimetschek commented on OAK-225:
-------------------------------------------

{quote}I'm not sure if it's worth the effort to support such XPath queries.{quote}

The point is to specify a property matching on a higher level (jcr:language + mix:language)
and in the tree below that get only certain nodes (sling:Message). While I could imagine that
for the sling use case this could be modified (i.e. first search for matching jcr:language
nodes, then traverse the tree below to fetch sling:Message nodes via the JCR API), I think
this use case is very normal in a hierarchical content structure.

Personally, I would love if Oak would give more love (and improvements over the JCR 1.0 spec
state) to Xpath as the main search language than SQL, as SQL is really awkward with tree structures.
                
> Sling I18N queries not supported by Oak
> ---------------------------------------
>
>                 Key: OAK-225
>                 URL: https://issues.apache.org/jira/browse/OAK-225
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.3
>            Reporter: Jukka Zitting
>            Priority: Minor
>              Labels: sling, xpath
>
> The Sling I18N component issues XPath queries like the following:
> {code:none}
> //element(*,mix:language)[fn:lower-case(@jcr:language)='en']//element(*,sling:Message)[@sling:message]/(@sling:key|@sling:message)
> {code}
> Such queries currently fail with the following exception:
> {code:none}
> javax.jcr.query.InvalidQueryException: java.text.ParseException: Query: //element(*,mix:language)[fn:lower-(*)case(@jcr:language)='en']//element(*,sling:Message)[@sling:message]/(@sling:key|@sling:message);
expected: (
>         at org.apache.jackrabbit.oak.jcr.query.QueryManagerImpl.executeQuery(QueryManagerImpl.java:115)
>         at org.apache.jackrabbit.oak.jcr.query.QueryImpl.execute(QueryImpl.java:85)
>         at org.apache.sling.jcr.resource.JcrResourceUtil.query(JcrResourceUtil.java:52)
>         at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.queryResources(JcrResourceProvider.java:262)
>         ... 54 more
> Caused by: java.text.ParseException: Query: //element(*,mix:language)[fn:lower-(*)case(@jcr:language)='en']//element(*,sling:Message)[@sling:message]/(@sling:key|@sling:message);
expected: (
>         at org.apache.jackrabbit.oak.query.XPathToSQL2Converter.getSyntaxError(XPathToSQL2Converter.java:704)
>         at org.apache.jackrabbit.oak.query.XPathToSQL2Converter.read(XPathToSQL2Converter.java:410)
>         at org.apache.jackrabbit.oak.query.XPathToSQL2Converter.parseExpression(XPathToSQL2Converter.java:336)
>         at org.apache.jackrabbit.oak.query.XPathToSQL2Converter.parseCondition(XPathToSQL2Converter.java:279)
>         at org.apache.jackrabbit.oak.query.XPathToSQL2Converter.parseAnd(XPathToSQL2Converter.java:252)
>         at org.apache.jackrabbit.oak.query.XPathToSQL2Converter.parseConstraint(XPathToSQL2Converter.java:244)
>         at org.apache.jackrabbit.oak.query.XPathToSQL2Converter.convert(XPathToSQL2Converter.java:153)
>         at org.apache.jackrabbit.oak.query.QueryEngineImpl.parseQuery(QueryEngineImpl.java:86)
>         at org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:99)
>         at org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:39)
>         at org.apache.jackrabbit.oak.jcr.query.QueryManagerImpl.executeQuery(QueryManagerImpl.java:110)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message