cancel
Showing results for 
Search instead for 
Did you mean: 

opencmis getParents only showing primary parent

glaenen
Champ in-the-making
Champ in-the-making
Hello,

I trying write an application using the alfresco opencmis plugin and when using getParents on a document it only returns the primary parent.
Also because of this the method removeFromFolder doens't work.

example:
AlfrescoDocument alfDoc = (AlfrescoDocument) session.getObjectByPath("/usual-tux.jpg");
      System.out.println(alfDoc.getName());
      System.out.println(alfDoc.getId());
      
      System.out.println("—————");
      List<Folder> parents = alfDoc.getParents();
      for (Folder folder : parents) {
         System.out.println(folder.getName());
         System.out.println(folder.getId());
      }

      System.out.println("—————");
      AlfrescoFolder folder = (AlfrescoFolder) session.getObjectByPath("/cmcdata");
      ItemIterable<CmisObject> childeren = folder.getChildren();
      for (CmisObject cmisObject : childeren) {
         System.out.println(cmisObject.getName());
         System.out.println(cmisObject.getId());
      }

output:
usual-tux.jpg
workspace://SpacesStore/0bcde99a-a6e4-4d23-b834-93648a2b4c4c
—————
Company Home
workspace://SpacesStore/c2d05d8b-d2c5-49be-ad07-f3722cb64e7f
—————
productmaster
workspace://SpacesStore/d78f025f-1e4f-479a-b4ac-89c25d5edec2
usual-tux.jpg
workspace://SpacesStore/0bcde99a-a6e4-4d23-b834-93648a2b4c4c


As you can see asking the document for it's parents only returns Company Home.
But asking an other folder for it's children shows that this document has other parents.
I've added this document to multiple folders using the addToFolder method and the parents are visible in the node browser.

Does anybody know why I'm not able to see all the parents for a document?

Regrads,

Glenn
1 REPLY 1

glaenen
Champ in-the-making
Champ in-the-making
Apparently a bug was filled one day after this post.

http://issues.alfresco.com/jira/browse/ALF-7286?page=com.atlassian.jira.plugin.system.issuetabpanels...

But no reply on the forum.

Glenn
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.