Cmis - Comments from node
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 05:04 AM
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
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
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 09:31 AM
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!
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!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 10:07 AM
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)
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)
