chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <f...@apache.org>
Subject Re: Which version should session.getObject(id) return?
Date Wed, 23 May 2012 11:00:16 GMT
 Hi Mano,

 This is an Alfresco specific question and you should ask there.

 Here are some general answers.

 The CMIS object id is an opaque string. You should never rely on the 
 format of this string. As you have seen, it changed from Alfresco 3 to 
 Alfresco 4 and might change in Alfresco 5 or 6 again. Other repositories 
 use a completely different format.

 Each version in CMIS has its own unique and opaque object id. A 
 getObject() call returns the document version that matches the id that 
 you have provided. It may or may not be the latest version.

 You can determine if the document is the latest version by calling 
 isLatestVersion() on the document object. If it is not, call 
 getObjectOfLatestVersion() to retrieve the latest version.


 - Florian



> Hi all,
>
> We use CMIS to connect to an Alfresco repository and are upgrading 
> from
> Alfresco 3.4.2 to Alfresco 4.0.1, which should be compliant to the 
> CMIS
> spec. Alfresco 3.4.2 wasn't entirely compliant, so we are running 
> into some
> problems.
>
> I have a document with 2 versions: version 1.0 and version 2.0. When
> executing the following query we get the latest version (2.0) as a 
> result:
>
> session.query("SELECT * FROM park:document WHERE cmis:objectId =
> 'workspace://SpacesStore/77f9e52f-6acf-47bd-83f1-f654c59e7b75'
>> ", false);
>
> Adding the version specifier suffix ";2.0" to the object id in the 
> query
> works as well. This didn't work with Alfresco 3.4.2, so I assume that 
> this
> is compliant as well?
>
>
> When executing the getObject(id) method with the same id (without 
> version
> specifier), return the first version (1.0) as a result:
>
>> session.getObject("
>> workspace://SpacesStore/77f9e52f-6acf-47bd-83f1-f654c59e7b75")
>
> We expected the latest version as a result. When adding the version
> specifier suffix ";2.0" to the object id, we are able to retrieve the
> latest version. Is this compliant behavior?
> I looked into the CMIS specification, but I could not find any 
> reference to
> which version should be returned when not specifying a version. If 
> this is
> compliant behavior, is there another way to
> easily retrieve the latest version of a document without using a CMIS 
> query?
>
>
> Thanks in advance.
>
>
> Met vriendelijke groeten,
> Kind regards,
> Bien à vous,
>
> Mano Swerts
> Solution Engineer
>
> _______________________________________________________
>
> ACA IT-Solutions
>
> Ilgatlaan 5C                        Clovislaan 82
> B-3500 Hasselt                   B-1000 Brussel
> Belgium                              Belgium
>
> T: +32 (0)11 26 50 10          E: m.swerts@aca-it.be
> F: +32 (0)11 26 50 11          U: www.aca-it.be
> M: +32 (0)484 80 81 45
> ______________________________________________________


Mime
View raw message