0

By using Apache Cmis query, if I understand correctly, you can get either

  1. a List of Cmis Folders (SELECT * FROM cmis:folder WHERE...)
  2. a List of Cmis Documents (SELECT * FROM cmis:document WHERE...)

But what I need, is a List of cmisObjects. I need this abstraction, because I want to get all the children (Folder or Document) of the selected Parent Folder.

Using 2 queries (1 for each type) is not an option, as I also have to use paging (using OperationContext.setMaxItemsPerPage) over the query results

EDIT : Just to make sure I made myself clear, I need to

  1. Use the query Function, as I need to filter my results by using a specific custom aspect
  2. Use Pagination, because even after filtering, the results (Folder Children) can be up to hundreds
yannicuLar
  • 3,083
  • 3
  • 32
  • 50

2 Answers2

2

If you know your parent, why don't you just call getChildren on the parent? Do you really have to use a query?

http://chemistry.apache.org/java/0.9.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/Folder.html#getChildren()

billerby
  • 1,977
  • 12
  • 22
2

This one has hit me years ago (I gave up on CMIS at that time). As of CMIS 1.1, there is this optional cmis:item. Have a look at http://docs.oasis-open.org/cmis/CMIS/v1.1/CMIS-v1.1.html#x1-220002 . You may be lucky and find that working with Alfresco. It might be required to use the v.1.1 implementation of the spec.

If that does not work, I guess your only option is to abondon CMIS for this query and either use another search service or roll your own.

Good luck ! ;)

Andreas Steffan
  • 6,039
  • 2
  • 23
  • 25
  • cmis:item sounds sweet !! thanx a lot – yannicuLar Mar 17 '14 at 15:35
  • Just out of curiosity, if you've quit CMIS, what are you using instead ? I've been thinking of quiting too, lots of times – yannicuLar Mar 17 '14 at 15:38
  • JSON data webscripts. Either used what was already there, or rolled my own. The "advantages" of CMIS turned out to be disadvantages for me - e.g. Standards <=> lowest common denominator. – Andreas Steffan Mar 17 '14 at 15:51
  • Just out of curiosity: Does cmis:item work for you ? ;) – Andreas Steffan Mar 18 '14 at 11:15
  • I haven't tried that yet. But I'll tell you when I do – yannicuLar Mar 18 '14 at 11:19
  • cmis:item isn't supported in Alfresco yet (as of 4.2). Even if it was, it would only help you if it was defined as an ancestor of cmis:document and cmis:folder. It may make sense for that to be the case but I do not think the spec requires it. – Jeff Potts Mar 18 '14 at 18:27