I am having trouble getting the parent folder for a document using Apache Chemistry OpenCMIS. The problem I am experiencing seems like it has more to do with Alfresco than OpenCMIS, but if I am posting this in the wrong place, I apologize.I am using OpenCMIS 0.6.0 and Alfresco 4.0.0. I have been using the /alfresco/service/cmis Atom service, but I have come to understand that is deprecated and I should be using /alfresco/cmisatom instead. When I switched to cmisatom, now my Document objects are suddenly not returning any parents. I wrote a simple test to demonstrate this:
public void testDocParents() {
CmisObject obj = getSession().getObject("workspace://SpacesStore/a8d4729e-c060-4a59-bdfd-480313d2f9a9");
if(obj instanceof Document) {
Document doc = (Document)obj;
System.out.println("Found document: "+doc.getId());
List<Folder> parents = doc.getParents();
System.out.println("Found "+parents.size()+" parents");
for(Folder folder : parents) {
System.out.println("\t"+folder.getId());
}
}
}
Using the old CMIS service URL results in the following output:
ATOMPUB_URL = http://alfserver:8080/alfresco/service/cmis
Found document: workspace://SpacesStore/a8d4729e-c060-4a59-bdfd-480313d2f9a9
Found 1 parents
workspace://SpacesStore/74e2dd7c-c71e-4f33-ab07-f0c1209c388d
Changing nothing but the service URL results in the following output:
ATOMPUB_URL = http://alfserver:8080/alfresco/cmisatom
Found document: workspace://SpacesStore/a8d4729e-c060-4a59-bdfd-480313d2f9a9;1.0
Found 0 parents
Has anyone else experienced this problem? What am I doing wrong?Thanks in advance for your help!