AnsweredAssumed Answered

CMIS query is querying Relationship instead of Type - Naming clash for Alfresco Type and Association

Question asked by patquinn00 on Mar 27, 2014
Latest reply on Mar 27, 2014 by kaynezhang
Executing this simple query using CMIS Workbench fails:

SELECT * FROM tdm:publicManual


We get this log output:

Mar 26, 2014 5:11:42 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Type is not queryable tdm:publicManual -> R:tdm:publicManual
        at org.alfresco.opencmis.search.CMISQueryParser.buildSource(CMISQueryParser.java:1417)


Using CMIS Workbench, I can see that <em>R:tdm:publicManual</em> is a cmis:relationship…not a type as I had expected. I can see <em>D:tdm:publicManual</em> exists with a Base Type of cmis:document…this is what I want to query on.

Inspecting the model we have a type and relationship with the same name.


   <type name="tdm:publicManual">
      ……
   </type>
   <aspect name="tdm:staged">
      ….
      <associations>
         <association name="tdm:publicManual">
            ……
         </association>
         ……
      </associations>
   </aspect>


This model has been deployed in production since mid 2013 with no problems. e.g. Lucene queries work fine, model deploys without error, we can create content of type tdm:publicManual and also associations with the name tdm:publicManual.

We are just starting to use the CMIS API for new client apps, and this has raised it's head now.

<ul>
<li>
Does anyone know if there a way to request CMIS to explicitly query against the type and not the relationship?
</li>
<li>
Is it a case that our model is inherently flawed, and should be changed, by having a type and relationship with the same name?
</li>
</ul>

Thanks,
Patrick

Outcomes