cancel
Showing results for 
Search instead for 
Did you mean: 

Simple CMIS 1.1 search problem

mangar
Star Contributor
Star Contributor
I am googleing away and I am sure I am mixing my atompub, cmis 1.0, and cmis 1.1

I am using CMIS 1.1, I have a custom model, and I am trying to get all documents with my custom property value equaling something.

My query is:

SELECT cmisSmiley SurprisedbjectId FROM cmis:document D WHERE jis:myProperty = "someText"

I have tried several combos of D:, P:, etc…

What is the correct answer?
Is there a tutorial somewhere specifically for Alfresco CMIS 1.1?

6 REPLIES 6

mrogers
Star Contributor
Star Contributor
try

select * from cmis:document WHERE jis:myProperty = 'someText'

mangar
Star Contributor
Star Contributor
I am getting:
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Invalid column for cmis:document.jis:myProperty

I know I have done the modeling correctly, because 1: I used this property when I used CMIS to import the documents, and 2: when I view the properties in explorer they are there.  I have no errors in the logs.

Any Ideas?

jpotts
World-Class Innovator
World-Class Innovator
I assume your custom property belongs to either a custom type or a custom aspect. If it belongs to a custom type, your from needs to include it, so it would be something like:


SELECT cmis:objectId FROM jis:myType WHERE jis:myProperty = "someText"


However, if your property is defined in an aspect, it would be something like:


SELECT D.cmis:objectId, J.jis:myProperty FROM cmis:document as D join jis:myAspect as J on D.cmis:objectId = J.cmis:objectId where J.jis:myProperty = , jis:myType as J WHERE J.jis:myProperty = "someText"


The custom content types tutorial has a CMIS section that includes example queries:
http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html

And the CMIS & Apache Chemistry book has an entire chapter on query syntax:
http://www.manning.com/mueller/

Jeff

mrogers
Star Contributor
Star Contributor
Sorry just noticed cmis:document wont have your property.   You need to use the name of your type.  

Perhaps if you posted details of your model then we would be able to answer better.

jpotts
World-Class Innovator
World-Class Innovator
Sorry for the duplication, Mark–I didn't see your response until I hit save!

Jeff

mangar
Star Contributor
Star Contributor
Thank you both.  works great.

Jeff, thanks for the links, that is exactly what I was looking for.