cancel
Showing results for 
Search instead for 
Did you mean: 

Cmis - Comments from node

jeremiebal
Confirmed Champ
Confirmed Champ
Hi

i don't find how to get children from a node in Alfresco with OpenCmis.
i'm working on JAVA.
I have a document in my repository.
I can access to it with my java class who call methods from OpenCmis but i don't find any function or method to get children. i have need this to get comments of my node.

Thanks to help me 🙂

info :
Alfresco One 4.2.4
OpenCmis 0.10.0
2 REPLIES 2

ddelapasse
Champ in-the-making
Champ in-the-making
YOu can get the CMIS folder object
import org.apache.chemistry.opencmis.client.api.Folder;

Folder f = (Folder) userSession.getObjectByPath(path);  <- or by ID

There's a getChildren method on Folder.  There is also a getDescendants which is slightly different.  Check the cmis docs for definitions!

NOTE:  Be careful to stay within one version of cmis.  The old stuff 1.0 uses slightly different classes AlfrescoFolder/AlfrescoDoc and mingling the two versions is not good!

Thanks but it doesn't work. I'd already tried.
The node is not a folder but a document so i have this error :

Exception in thread "main" java.lang.ClassCastException: org.apache.chemistry.opencmis.client.runtime.DocumentImpl cannot be cast to org.apache.chemistry.opencmis.client.api.Folder
   at fr.alfea.Test.main(Test.java:99)