Re: XPath query

2016-10-11 Thread Thomas Mueller
Hi,

Sorry typo in "type", wanted to write "typo":

>I thought even in Jackrabbit 2.x, the "test" was assumed to be a type and
>automatically converted to "@test"...

Should read:

I thought even in Jackrabbit 2.x, the "test" was assumed to be a typo ...


Regards,
Thomas



Re: XPath query

2016-10-11 Thread Roy Teeuwen
Hey Thomas,

I tested the query on a JCR 2.x ;) it used to worked there. I would use it in 
situations where the query goes deeper, something like 
/jcr:root/content/site//element(*,cq:PageContent)[parsys/some-component] to 
select pages with a specific component in the parsys
But yup! your adjustment seems to work, thanks a lot

Greetings,
Roy
> On 11 Oct 2016, at 12:03, Thomas Mueller  wrote:
> 
> Hi,
> 
> I thought even in Jackrabbit 2.x, the "test" was assumed to be a type and
> automatically converted to "@test"... Maybe I'm wrong.
> 
> What should work (for both Jackrabbit 2.x and Oak) is using
> "test/@jcr:primaryType" instead of "test". So:
> 
>/jcr:root//*[test/@jcr:primaryType]
>/jcr:root/content/site//element(*,nt:unstructured)
>[@jcr:createdBy='admin' and test/@jcr:primaryType]
> 
> 
> Regards,
> Thomas
> 
> On 07/10/16 17:42, "Roy Teeuwen"  wrote:
> 
>> Hey all,
>> 
>> Seeing as I donąt seem to find a oak-users to subscribe to, Iąm going to
>> post the question here:
>> 
>> When doing the following XPath query in JCR 2, it would select me all the
>> nodes that has a subnode named test. But since oak, this query does not
>> work anymore. Is there a reason this stopped working or a way to make it
>> work again
>> 
>> Some query example:
>> /jcr:root//*[test] or
>> /jcr:root/content/site//element(*,nt:unstructured)[@jcr:createdBy='admin'
>> and test]
>> 
>> Greetings,
>> Roy
> 



Re: XPath query

2016-10-11 Thread Thomas Mueller
Hi,

I thought even in Jackrabbit 2.x, the "test" was assumed to be a type and
automatically converted to "@test"... Maybe I'm wrong.

What should work (for both Jackrabbit 2.x and Oak) is using
"test/@jcr:primaryType" instead of "test". So:

/jcr:root//*[test/@jcr:primaryType]
/jcr:root/content/site//element(*,nt:unstructured)
[@jcr:createdBy='admin' and test/@jcr:primaryType]


Regards,
Thomas

On 07/10/16 17:42, "Roy Teeuwen"  wrote:

>Hey all,
>
>Seeing as I don¹t seem to find a oak-users to subscribe to, I¹m going to
>post the question here:
>
>When doing the following XPath query in JCR 2, it would select me all the
>nodes that has a subnode named test. But since oak, this query does not
>work anymore. Is there a reason this stopped working or a way to make it
>work again
>
>Some query example:
>/jcr:root//*[test] or
>/jcr:root/content/site//element(*,nt:unstructured)[@jcr:createdBy='admin'
>and test]
>
>Greetings,
>Roy



XPath query

2016-10-07 Thread Roy Teeuwen
Hey all,

Seeing as I don’t seem to find a oak-users to subscribe to, I’m going to post 
the question here:

When doing the following XPath query in JCR 2, it would select me all the nodes 
that has a subnode named test. But since oak, this query does not work anymore. 
Is there a reason this stopped working or a way to make it work again

Some query example:
/jcr:root//*[test] or 
/jcr:root/content/site//element(*,nt:unstructured)[@jcr:createdBy='admin' and 
test]

Greetings,
Roy


[jira] [Resolved] (OAK-268) XPathQueryEvaluator generates incorrect XPath query

2012-08-22 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/OAK-268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Dürig resolved OAK-268.
---

   Resolution: Fixed
Fix Version/s: 0.5

Fixed at revision 1375928
Thanks Chetan Mehrotra for the patch

> XPathQueryEvaluator generates incorrect XPath query
> ---
>
> Key: OAK-268
> URL: https://issues.apache.org/jira/browse/OAK-268
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: jcr
>Affects Versions: 0.5
>Reporter: Chetan Mehrotra
>Assignee: Michael Dürig
>Priority: Minor
> Fix For: 0.5
>
> Attachments: OAK-268.patch
>
>
> XPathQueryEvaluator generated XPath query has two issues. For more details 
> refer to [1]
> # rep:principalName should be added as property exp. 
> jcr:like(rep:principalName,'%%') -> jcr:like(@rep:principalName,'%%')
> # fn:name(.) should be fn:name(). jcr:like(fn:name(.),'%%') -> 
> jcr:like(fn:name(),'%%')
> [1] http://markmail.org/thread/ygna4ld47b3wwgkc

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




[jira] [Assigned] (OAK-268) XPathQueryEvaluator generates incorrect XPath query

2012-08-22 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/OAK-268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Dürig reassigned OAK-268:
-

Assignee: Michael Dürig

> XPathQueryEvaluator generates incorrect XPath query
> ---
>
> Key: OAK-268
> URL: https://issues.apache.org/jira/browse/OAK-268
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: jcr
>Affects Versions: 0.5
>Reporter: Chetan Mehrotra
>Assignee: Michael Dürig
>Priority: Minor
> Attachments: OAK-268.patch
>
>
> XPathQueryEvaluator generated XPath query has two issues. For more details 
> refer to [1]
> # rep:principalName should be added as property exp. 
> jcr:like(rep:principalName,'%%') -> jcr:like(@rep:principalName,'%%')
> # fn:name(.) should be fn:name(). jcr:like(fn:name(.),'%%') -> 
> jcr:like(fn:name(),'%%')
> [1] http://markmail.org/thread/ygna4ld47b3wwgkc

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




[jira] [Updated] (OAK-268) XPathQueryEvaluator generates incorrect XPath query

2012-08-21 Thread Chetan Mehrotra (JIRA)

 [ 
https://issues.apache.org/jira/browse/OAK-268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chetan Mehrotra updated OAK-268:


Attachment: OAK-268.patch

> XPathQueryEvaluator generates incorrect XPath query
> ---
>
> Key: OAK-268
> URL: https://issues.apache.org/jira/browse/OAK-268
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: jcr
>Affects Versions: 0.5
>Reporter: Chetan Mehrotra
>Priority: Minor
> Attachments: OAK-268.patch
>
>
> XPathQueryEvaluator generated XPath query has two issues. For more details 
> refer to [1]
> # rep:principalName should be added as property exp. 
> jcr:like(rep:principalName,'%%') -> jcr:like(@rep:principalName,'%%')
> # fn:name(.) should be fn:name(). jcr:like(fn:name(.),'%%') -> 
> jcr:like(fn:name(),'%%')
> [1] http://markmail.org/thread/ygna4ld47b3wwgkc

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




[jira] [Created] (OAK-268) XPathQueryEvaluator generates incorrect XPath query

2012-08-21 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created OAK-268:
---

 Summary: XPathQueryEvaluator generates incorrect XPath query
 Key: OAK-268
 URL: https://issues.apache.org/jira/browse/OAK-268
 Project: Jackrabbit Oak
  Issue Type: Bug
  Components: jcr
Affects Versions: 0.5
Reporter: Chetan Mehrotra
Priority: Minor


XPathQueryEvaluator generated XPath query has two issues. For more details 
refer to [1]

# rep:principalName should be added as property exp. 
jcr:like(rep:principalName,'%%') -> jcr:like(@rep:principalName,'%%')
# fn:name(.) should be fn:name(). jcr:like(fn:name(.),'%%') -> 
jcr:like(fn:name(),'%%')

[1] http://markmail.org/thread/ygna4ld47b3wwgkc

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




Re: TCK: strange XPath query

2012-05-24 Thread Julian Reschke

On 2012-05-24 12:12, Thomas Mueller wrote:

Hi,

The test 
org.apache.jackrabbit.test.api.query.OrderByMultiTypeTest.testMultipleOrder 
currently fails at line 73, where it tries to run a query of the form:

(1) //testroot/*[@jcr:primaryType='nt:unstructured']

I believe there is a typo in the test, and the query should be:

(2) /jcr:root/testroot/*[@jcr:primaryType='nt:unstructured']

Queries of type (1) are currently not supported, because they would contain two 
wildcards: path like '%/testroot/%'. I wonder if such queries are important, 
that is, whether we need to support them in the XPath to SQL-2 converter. It's 
possible to support them, but I would like to not support them now, unless 
*really* necessary.

What do you think?


Indeed!


TCK: strange XPath query

2012-05-24 Thread Thomas Mueller
Hi,

The test 
org.apache.jackrabbit.test.api.query.OrderByMultiTypeTest.testMultipleOrder 
currently fails at line 73, where it tries to run a query of the form:

(1) //testroot/*[@jcr:primaryType='nt:unstructured']

I believe there is a typo in the test, and the query should be:

(2) /jcr:root/testroot/*[@jcr:primaryType='nt:unstructured']

Queries of type (1) are currently not supported, because they would contain two 
wildcards: path like '%/testroot/%'. I wonder if such queries are important, 
that is, whether we need to support them in the XPath to SQL-2 converter. It's 
possible to support them, but I would like to not support them now, unless 
*really* necessary.

What do you think?

In any case I will log a issue to change the TCK test.

Regards,
Thomas