CMIS aspect query with path

cancel
Showing results for 
Search instead for 
Did you mean: 
alfresco_one
Member II

CMIS aspect query with path

Hi all,

I need to query a particular folder in the repository using a java based scheduler in alfresco.

I need to check whether the custom aspect's property is present or not. 

Below query works for me when I don't use the path query.

select * from myType:caseDoc as d join myAspect:caseId as s on d.cmisSmiley SurprisedbjectId = s.cmisSmiley SurprisedbjectId 

The problem with the above query is it searches all the contents in the repository but I want to target a particular folder.

When I try to put the CONTAINS in the above query it fails.

select * from cch:caseDoc as d
join cch:caseId as s on d.cmisSmiley SurprisedbjectId = s.cmisSmiley SurprisedbjectId WHERE CONTAINS('PATH:"//app:company_home/cm:FDLE/cm:CCH/cm:CCH-DROP-FOLDER/*"')

It gives below exception

A selector must be specified when there are two or more selectors

Thank you

1 Reply
jpotts
Professional

Re: CMIS aspect query with path

Old post, but the problem here is explained by the exception: the selector is missing.

The fix is to add it. Change:

WHERE CONTAINS('PATH:"//app:company_home/cm:FDLE/cm:CCH/cm:CCH-DROP-FOLDER/*"')

to:

WHERE CONTAINS(d, 'PATH:"//app:company_home/cm:FDLE/cm:CCH/cm:CCH-DROP-FOLDER/*"')