cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS, versions and getObject

darionis
Champ on-the-rise
Champ on-the-rise
Good day to all,

I was happy CMIS client, fetching documents with
Document doc = (Document)session.getObject("workspace://SpacesStore/d396bcb3-4a12-48bf-a9fd-e314c72a7c15");

It was all well until i created a new version of this document.

Version ID is now 0.1.


When i try again getObject("workspace://SpacesStore/d396bcb3-4a12-48bf-a9fd-e314c72a7c15"), I get

2014-03-10 12:51:50,452  ERROR [impl.atompub.CmisAtomPubServlet] [http-9080-1] Object Info not found for: workspace://SpacesStored396bcb3-4a12-48bf-a9fd-e314c72a7c15;1.0


Obviously, CMIS adds incorrect version id 1.0 to the end of the nodeId. If I explicitelly add version id 0.1, getObject(…) works. Does that mean that I MUST provide version ID to the object's nodeRef when calling getObject()? What if I am not aware of latest version id?

I know about getObjectOfLatestVersion(false), but it requires 'Document' reference first which I can not obtain with getObject().


Document object fetching somehow changed with multiple version but I don't know how to handle it. Can anybody please help, how to call getObject() if version id is uknown.


Thanks to all!

3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator
It works fine in my environment
You can try with

Document doc = (Document)session.getObject("d396bcb3-4a12-48bf-a9fd-e314c72a7c15");

That is exactly what I do and it works as long as node is not versioned.
As soon as you add new version, getObject() call produces error.

Is your node versioned or not?

Thanks!

kaynezhang
World-Class Innovator
World-Class Innovator
Of course my node is versioned .I have tried exactly as your step:
1. Use getObject method to get an unversioned object.
2. Create a new version of that object.
3. Use getObject method to get that object again.

It works fine.