cancel
Showing results for 
Search instead for 
Did you mean: 

Unique objectId for different document versions?

adamwilmer
Champ in-the-making
Champ in-the-making
The CMIS 1.0 spec says

Note: When a document is versioned, each version of the document is a separate document object. Thus, for document objects, an object ID actually identifies a specific version of a document."

so when I make a query "SELECT * FROM cmis:document" and then upload a new version of a document and rerun that query I'd expect the result row for that document to have the same cmis:versionSeriesId but a new cmisSmiley SurprisedbjectId. However, each time a new version is uploaded I always get the same cmisSmiley SurprisedbjectId (identical to cmis:versionSeriesId) although I can see cmis:versionLabel/cmis:contentStreamId etc changing correctly. This is with openCMIS v0.4.0 running against Alfresco v4.0.a. Is this a known issue with the Alfresco CMIS implementation?
4 REPLIES 4

fmui
Champ in-the-making
Champ in-the-making
Hi,

That's a known issue in Alfresco 3.x. If you are seeing this issue with Alfresco 4.x, you are probably using the wrong (old) CMIS URLs.
Check this page for the new URLs: http://<host>/alfresco/service/cmis/index.html


- Florian

adamwilmer
Champ in-the-making
Champ in-the-making
I was using the old CMIS Atom feed so thanks for pointing that out and I confirm I now see the unique Ids. This actually solves many of the difficulties I was dealing with in terms of accessing metadata from older versions of a document. Do you know if it's possible to extract the Paths for an older version? For example I am doing  ((DocumentImpl)session.getObject(<OBJECTID>)).getPaths() which returns the path for the most recent version of an object but an empty array for older versions of an object.

Many thanks

Adam

fmui
Champ in-the-making
Champ in-the-making
Hi Adam,

From a CMIS perspective older document versions are not filed. They are not children of a folder. Therefore they don't have a path.
You have to go back to the latest version to get the path. For example:

((Document)session.getObject(<OBJECTID>)).getObjectOfLatestVersion(false).getPaths()

Florian

adamwilmer
Champ in-the-making
Champ in-the-making
Ok.. perfect! Thanks for your help.