03-04-2019 04:37 AM
I am using the alfresco repository with cmis and Alfresco Content Services REST API in my web application.
Executing a select query statement will get two documents, including the pwc version.
I want to get a list of documents except the pwc version.
I do not want to remove the pwc document from the query result after executing the doc for easy paging processing.
It seems that all properties about checking-out including cmis:versionLabel are not available in where clause.
Am I misinformed?
How can i get document list excluding private working copy version by cmis query or ACS REST api?
Thanks for reading.
03-05-2019 07:06 PM
The problem was solved by removing pwc from the query result statement.
There was no need to worry about this problem in the paging process.
06-05-2020 05:04 AM
Hello
I got same issue, how did you remove pwc in the cmis query ?
I am using Alfresco 5 and Apache chemistry java api.
thank you.
06-05-2020 05:36 AM
Hi @devor,
Have you looked at this documentation? It's deprecated but explains that pwc is to get the "private working copy".
Gets the specified information for the private working copy (for checking out & working with versions I believe).
Gets the specified information for the object (Folder or Document).
So, is it just a case of removing pwc from the query call?
HTH
06-05-2020 06:21 AM
Thanks for your reply.
yes I looked this documentation.
I buid a document explorer, using paging feature of api.
// exemple
final String query = this.createQuery(props, gedProperties, sortingCriteria, orderBy); // createQuery method exemple return -> SELECT * FROM mw:doc WHERE mw:entiteId='103861' ORDER BY cmis:name ASC
ItemIterable<QueryResult> result = session.query(query, false); // with false I return only last version of documents
final long totalItems = result.getTotalNumItems();
final ItemIterable<QueryResult> pageQueryResult = result.skipTo(0).getPage(5);
--------------------------
-without checkout any document
My result query, return 5 items , and my pageQueryResult return 5 , this case is ok.
- after checkout one of this 5 documents
totalItems return now 6 items ( 5 items + 1 pwc)
and my pageQueryResult return only 4 and the fifth is now in second page.
so I want to exclude pwc from the result.
Explore our Alfresco products with the links below. Use labels to filter content by product module.