Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53BDFDBCD for ; Wed, 8 Aug 2012 13:05:21 +0000 (UTC) Received: (qmail 86182 invoked by uid 500); 8 Aug 2012 13:05:21 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 86148 invoked by uid 500); 8 Aug 2012 13:05:21 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 86140 invoked by uid 99); 8 Aug 2012 13:05:21 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2012 13:05:21 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id C093D141E28 for ; Wed, 8 Aug 2012 13:05:20 +0000 (UTC) Date: Wed, 8 Aug 2012 13:05:20 +0000 (UTC) From: "Thomas Mueller (JIRA)" To: oak-dev@jackrabbit.apache.org Message-ID: <471021074.101.1344431120793.JavaMail.jiratomcat@issues-vm> In-Reply-To: <735530681.5739.1343921042348.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (OAK-225) Sling I18N queries not supported by Oak MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OAK-225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431099#comment-13431099 ] Thomas Mueller commented on OAK-225: ------------------------------------ I tried to add the comment on OAK-225 yesterday, but Jira was not working properly. It seems even today it sometimes doesn't work, let's see. The fix I did so far was to support "fn:lower-case". This wasn't supported before (even for very very simple queries). The query is not converted correctly, I know, and this needs to be either fixed or it has to fail (throw an exception). For XPath queries of this form, a join would be needed I believe. I didn't look into that so far, I'm not sure how easy it is to support it (all I know is that it's not trivial). I guess it's not just a question on whether we 'want' to support it (I want :-) but also if it's worth the effort, and this I'm not convinced yet. It sounds like, as a short term solution, it would be relatively easy to change the query in Sling, but in the long term I guess it would be better to support such queries. > 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