AnsweredAssumed Answered

Get CmisObject from Custom model query - EXCEPTION: TransientCmisObject

Question asked by pajumbo on Mar 2, 2016
Latest reply on Mar 2, 2016 by pajumbo
Hi everyone,

I'm tring to get a CustomModel document serching it from "name"

and i'm getting the following exception:

java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/api/TransientCmisObject


I try with the newest CMIS versions (10, 11 ,13 )


      protected CmisObject searchDocumentByName( String fileName ){
      String queryString = "select * from kd:doc where "+PropertyIds.NAME+" = '"+fileName+"'";
       ItemIterable<QueryResult> results = getSession().query(queryString, false);
       
      CmisObject checkingDocument = null;
       for (QueryResult qResult : results) {
          String objectId = "";
          PropertyData<?> propData = qResult.getPropertyById("cmis:objectId"); // Atom Pub binding
          if (propData != null) {
             objectId = (String) propData.getFirstValue();
          } else {
             objectId = qResult.getPropertyValueByQueryName("d.cmis:objectId"); // Web Services binding
          }
          checkingDocument = getSession().getObject(getSession().createObjectId(objectId));
       }
      return checkingDocument;
   }




I'm using the Alfresco Community v5.0.0

Outcomes