How to filter folder children using cmis query?

前端 未结 1 1092
闹比i
闹比i 2021-01-29 02:27

I would like to filter the children of folders from a cmis 1.0 compliant repository with one query. So far that doesn\'t seem to be possible so I have settled to execute two que

相关标签:
1条回答
  • 2021-01-29 02:47

    I've used this query in order to get children of a particular folder

    String query;
    query = "SELECT * FROM cmis:document WHERE IN_FOLDER('" + folderId + "')";
    

    and to get all the children

    ItemIterable<QueryResult> resultList = session.query(query, false);// No need to say about session ???
    

    and finally

    for (QueryResult qr : resultList) {
    
    String idDocument = qr.getPropertyByQueryName("cmis:objectId").getFirstValue().toString();
    Document doc = (Document) session.getObject(idDocument);
    
    }
    

    Note that in my example i only get cmis:objectId you can get more from Cmis Query

    Hope that will help you.

    0 讨论(0)
提交回复
热议问题