JSR-170 SQL-like queries

We’re having problems with auto-slots in case where returned items should be filtered by folder id (this is related to items that are pasted-as-link). While trying to solve this, I came upon some interesting things.

So, in query debugger, if I run

select rx:sys_contentid, rx:sys_folderid from rx:rffgeneric where jcr:path like '//Sites/Corp%'

a bunch of records is returned. What’s interesting, folder id figures in select although it isn’t item property (as far as I know).

Then run this

select rx:sys_contentid, rx:sys_folderid from rx:rffgeneric where rx:sys_contentid=590

to get one record.

However statement

select rx:sys_contentid, rx:sys_folderid from rx:rffgeneric where rx:sys_folderid=532

returns empty set.

When I modify slot query to filter on folderid I get an error.
Could someone help me understand this? And how to write slot definition to get only items from particular folder?

Thanks guys…

Sinisa,

To select Content Items from a specific Folder, specify the fully-qualified path to that folder WITHOUT the “%” wildcard character. For example, if you use the query


select rx:sys_contentid, sys_folderid from rx:rffgeneric where jcr:path LIKE '//Sites/EnterpriseInvestments/InvestmentAdvice'

Only Content Items in that specific Folder will be returned.

The “%” wildcard character selects Content Items from the specified Folder and its child Folders.

RLJII

This doesn’t work for items that are pasted as link. For example, lets say there’s an item 123 in folder “regional”. Then you copy that item and paste it as a link to folder “coastal”. Now if JSR query is executed with filtering on “coastal” jcr:path, only item 123 from “regional” folder will be returned.

I just tested this on your environment and its working fine. If you need further help with this please contact support and we will look at this with you.