Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 329179B19 for ; Wed, 1 Feb 2012 17:09:07 +0000 (UTC) Received: (qmail 14327 invoked by uid 500); 1 Feb 2012 17:09:07 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 14275 invoked by uid 500); 1 Feb 2012 17:09:06 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 14267 invoked by uid 99); 1 Feb 2012 17:09:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2012 17:09:06 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [92.51.170.72] (HELO server01.mc0.hosteurope.de) (92.51.170.72) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2012 17:08:59 +0000 Received: from server06.webmailer.hosteurope.de ([10.9.0.185]); by mailout.hosteurope.de (server01.mc0.hosteurope.de) running EXperimental Internet Mailer with esmtps (TLSv1:AES256-SHA:256) id 1Rsdfj-0002Rp-I6; Wed, 01 Feb 2012 18:08:39 +0100 Received: from nobody by server06.webmailer.hosteurope.de with local (Exim 4.72) (envelope-from ) id 1Rsdfj-0001yq-GB; Wed, 01 Feb 2012 18:08:39 +0100 To: Subject: Re: Difference between document version accessed by VersioningService or session.getObject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 01 Feb 2012 18:08:39 +0100 From: =?UTF-8?Q?Florian_M=C3=BCller?= Cc: In-Reply-To: References: Message-ID: <3a39c870ea7948cf001a7d1a160ecbed-EhVcXl9JQQFXRwQFDQkEXR0wfgZLV15fQUBFBEFYXS9ZUF0WWlloB11LX15YLkQBXVJYQV5UWQE=-webmailer2@server06.webmailer.hosteurope.de> X-Sender: fmui@apache.org User-Agent: Host Europe Webmailer/2.0 X-HE-Access: Yes X-bounce-key: webpack.hosteurope.de;fmui@apache.org;1328116119;2ba0e21b; X-Virus-Checked: Checked by ClamAV on apache.org 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 : > 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 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