user3855589
user3855589

Reputation: 1103

How can I get Folder detail from document Id in Alfresco using cmis api

I have one question. How can I get Folder Name,Id etc...(Folder details) from document Id in alfresco using cmis api? Is there any way??? Thanks

Upvotes: 2

Views: 1213

Answers (2)

Florian Müller
Florian Müller

Reputation: 3235

This one is shorter:

// get the first parent of the document 
Folder parent = doc.getParents().get(0);

System.out.println("ID: "+ parent.getId());
System.out.println("Name: "+ parent.getName());

Upvotes: 2

user3855589
user3855589

Reputation: 1103

Finally I got the answer..use following line..

 ObjectData bindingParent=cmisSession.getBinding().getNavigationService().getFolderParent(cmisSession.getRepositoryInfo().getId(), doc.getId(), null, null);
System.out.println("\n --> id "+ bindingParent.getId());

Upvotes: 1

Related Questions