1

I want to check whether the Aspect property is present or not and if present it should not be blank... On some docs the aspect applied but no properties are populated. On some docs all the properties of aspect are populated but few are blank.

I tried below queries..

select * from myType:myCase as d join myAspect:myTest as p on d.cmis:objectId = p.cmis:objectId WHERE
CONTAINS(d, 'PATH:"//app:company_home/cm:DROP-FOLDER/*"')

AND p:myAspect:caseId = ''

I also tried p:myAspect:caseId = <> '' **p:myAspect:caseId IS NOT NULL (Doesn't give error but return the row with blank property value)

In short how can I check whether the aspect property is present or not and if present it is not blank?

Thank you

Sam
  • 2,972
  • 6
  • 34
  • 62

2 Answers2

2

I'm not sure I understand what you mean by "if present it should not be blank" (you're probably thinking about properties). If you want to check whether some aspect is there, this in an option:

SELECT * FROM cmis:document where contains('ASPECT:\'myNs:myAspect\'')

Be careful about transactional queries, though. http://docs.alfresco.com/5.0/concepts/intrans-metadata-query.html

Lista
  • 2,186
  • 1
  • 15
  • 18
  • I have applied an aspect to the content. But as I have not added any property value for that aspect it will not show any property of this aspect in the node browser. For some content I have added few property values so it will show all the aspect properties into node browser. Search the content which has this aspect with 1 property (example. myAspect:caseId) not null or not present. select * from myType:myCase as d join myAspect:myTest as p on d.cmis:objectId = p.cmis:objectId WHERE CONTAINS(d, 'PATH:"//app:company_home/cm:DROP-FOLDER/*"') AND p:myAspect:caseId != '' – Sam Mar 21 '17 at 12:29
1

you can make a query as below to get the documents that doesn't have specific aspect, just an update to @Lista's answer

SELECT * FROM myType:myCase WHERE NOT CONTAINS('ASPECT:\'myNs:myAspect\'')
Srikanth Josyula
  • 790
  • 7
  • 15