cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Model and CMIS Query

adolfho
Champ in-the-making
Champ in-the-making
Hi All,
I have a custom model and in types definition I have the following definition:
<type name="spuSmiley Tonguerocesso">
  <title>Processo</title>
  <parent>cm:folder</parent>
  <properties>
       <property name="spuSmiley Tonguerocesso.Numero">
         <title>Número</title>
         <type>d:text</type>
       </property>
       <property name="spuSmiley Tonguerocesso.Externo">
          <title>Externo?</title>
          <type>d:boolean</type>
       </property>
       .
       .
       .
My question is how do I build a query using CMIS to check if spuSmiley Tonguerocesso.Externo = 'true'?
I made this query but it doesnt like the dot in processo.Externo.
SELECT F.cmisSmiley SurprisedbjectId FROM cmis:folder AS F JOIN spuSmiley Tonguerocesso AS P ON F.cmisSmiley SurprisedbjectId = P.cmisSmiley SurprisedbjectId WHERE IN_TREE (F,'workspace://SpacesStore/8571db40-0d85-4fd3-b583-e02a6d43539f') and spuSmiley Tonguerocesso.Externo='false'  ORDER BY F.cmis:creationDate DESC

It returns this error: Search failed due to: org.alfresco.cmis.CMISQueryException: 04228045 Unknown column/property Externo

Thx in advance
A.
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Go look at the type definition for your custom aspect (using a tool like OpenCMIS Workbench or a client library) and check (1) that the property is queryable and (2) that you are using the query name which could be different than the actual property name. (Especially with your non-alphanumeric character in the property name).

For example, using my SomeCo examples, I can successfully query in the sc:isActive boolean property like this:

<blockcode>
SELECT * FROM cmis:document as D join sc:webable as W on D.cmisSmiley SurprisedbjectId = W.cmisSmiley SurprisedbjectId where W.sc:isActive = true
</blockcode>
Jeff

adolfho
Champ in-the-making
Champ in-the-making
Hi Jeff, thank you for your answer but unfortunately we faced this problem after the whole application is already developed and we have to keep the non-alpha character. We are using CONTAINS(P, 'spuSmiley Tonguerocesso.Externo: \'false\'') but is getting slower and now I know it isnt the right function to use once this isnt text to be searched.
Following our model I tried 'P.Externo:isActive' but it didnt work because I have its name as ":spu.processo.Externo" like is showed in the definition I pasted. Do you think there is another way?

Thanks
A.