You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Joshy Augustine <jo...@gmail.com> on 2014/08/11 17:26:06 UTC

Open CMIS 0.11 + Alfresco 4.2 Community Edition Question

Hi All,

I am a newbie to Open CMIS. I am very fascinated by Open CMIS framework
that allowed me to write(almost in no time) a sample test program that
interacts with a various ECM Vendors. However, I am encountering a strange
issue with Alfresco and wondered whether any of you had the time to help?

In the sample code I am developing, I perform the following actions

1) Create a Folder in Alfresco
2) Add  a few documents to it
3) Search (via CMIS Query) for the list of documents in a folder tree that
matches with search criteria.

 In step 3, I execute the following API


ItemIterable<QueryResult> queryResult = session.query(complete_statement,
*false*,operationContext);

Iterator<QueryResult> iterator = queryResult.iterator();

*while* (iterator.hasNext())

{

QueryResult qr = (QueryResult) iterator.next();

String id = (String) qr.getPropertyByQueryName("cmis:objectId"
).getFirstValue());

}

that results in the following query being executed.

*SELECT cmis:objectId FROM cmis:document WHERE cmis:name like 'Hello Wor%'
AND IN_TREE('c4714b61-2800-4995-8e37-2cc07549d4b2') ORDER BY
cmis:creationDate desc*
When I run the test program, most of the times, this query does not return
any results. If i put a breakpoint in the line session.query() and execute
the statement using CMIS Workbench, I am able to find results.
Sometimes(but not always) even putting a Thread.sleep() before
session.query() allows me to find the documents that query should have
found.


Any idea what is the best way to debug this issue?


Cheers,
Josh