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: Difference between document version accessed by VersioningService or session.getObject
Date Wed, 01 Feb 2012 17:08:39 GMT

 Hi Mano,

 I can't tell you what's going wrong here. Probably a caching issue.

 But before I dig deeper, two questions:
 1) Does the CMIS Workbench show the correct property values?
 2) Is there any reason not to use Document.getAllVersions()?


 Cheers,

 Florian


 [1] 
 http://chemistry.apache.org/java/0.6.0/maven/apidocs/org/apache/chemistry/opencmis/client/api/Document.html#getAllVersions%28%29


 Am Mittwoch, den 01.02.2012, 16:37 +0100 schrieb Mano Swerts 
 <m.swerts@aca-it.be>:
> Hi all,
>
> I seem to have a little problem with the display of all versions of a
> particular document to users. I do not know if this is a bug in CMIS, 
> in
> Alfresco or if this is as designed.
>
> I fetch all versions of a particular document using the
> VersioningService object.
> Then I loop over these versions to get convert them to a CMIS 
> Document to
> be able to fetch all properties. In the my custom user interface I 
> noticed
> that the first version did not have any custom properties filled in. 
> Then I
> also noticed that the last version in my listing (which is equal to 
> the
> current working version in the repository and therefore also in my 
> app)
> does not reflect the latest metadata as the current working document 
> does
> in the rest of the application. So it seems that when I list the 
> metadata
> of all versions, that they are 1 off. So this means metadata for 
> version
> 1.0 is not filled in (when it actually is), metadata for version 2.0 
> seems
> to be the metadata for version 1.0, and so forth.
>
> When I look into node browser that comes with Alfresco, I can only 
> see the
> current version. The current version is *3.0* and contains a data 
> property
> called park:documentCreationDate. It is set to the *2nd of February*.
> However when I list versions using the VersioningService, it shows 
> the same
> property with a value of the *1th of February*, also version *3.0*.
>
> I confirmed the above behavior with the following code:
>
> String repositoryId = cmisSession.getRepositoryInfo().getId();
>
> String documentId =
> "workspace://SpacesStore/81b81e8c-ec20-4cdd-b650-552cb9eb5e5b";
>
> List<ObjectData> versions =
> 
> cmisSession.getBinding().getVersioningService().getAllVersions(repositoryId,
> documentId, null, null, null, null);
>
> ObjectFactoryImpl factory = new ObjectFactoryImpl();
>
> factory.initialize(cmisSession, null);
>
>
> Document cmisDocument = (Document) 
> factory.convertObject(versions.get(0),
> cmisSession.createOperationContext());
>
>
> cmisDocument.getPropertyValue("cmis:objectId"); //
> output 
> workspace://SpacesStore/81b81e8c-ec20-4cdd-b650-552cb9eb5e5b;3.0
>
> cmisDocument.getPropertyValue("cmis:versionLabel"); // output 3.0
>
> cmisDocument.getPropertyValue("park:documentCreationDate"); // output
> GregorianCalendar with value of 1th of February 2012
>
>
> Document cmisDocument2 = cmisSession.getObject(new 
> ObjectIdImpl(documentId
> ));
>
> cmisDocument2.getPropertyValue("cmis:versionLabel"); // output 3.0
> cmisDocument2.getPropertyValue("park:documentCreationDate"); // 
> output
> GregorianCalendar with value of 2th of February 2012
>
> So it seems that although they have the same version and should point 
> to
> the same document, it seems that putting the version number in the ID
> directs to an other document. However then the second way to access 
> it
> should return 4.0 and not 3.0. I am very confused of what is going on 
> here,
> because I request the versions for a specific ID and they can have
> different values for the same version.
>
> Thanks.
>
> -- Mano


Mime
View raw message