cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get document list excluding pwc version?

hs_j
Champ in-the-making
Champ in-the-making

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.

4 REPLIES 4

hs_j
Champ in-the-making
Champ in-the-making

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.

devor
Champ in-the-making
Champ in-the-making

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.

EddieMay
World-Class Innovator
World-Class Innovator

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).

GET /alfresco/service/cmis/pwc/i/{id}?filter={filter?}&includeAllowableActions={includeAllowableActions?...

Gets the specified information for the object (Folder or Document).

GET /alfresco/service/cmis/i/{id}?filter={filter?}&returnVersion={returnVersion?}&includeAllowableAction...

So, is it just a case of removing pwc from the query call?

HTH

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!

devor
Champ in-the-making
Champ in-the-making

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.