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 EB7AE10924 for ; Thu, 26 Dec 2013 15:30:14 +0000 (UTC) Received: (qmail 59982 invoked by uid 500); 26 Dec 2013 15:30:03 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 59909 invoked by uid 500); 26 Dec 2013 15:29:59 -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 59899 invoked by uid 99); 26 Dec 2013 15:29:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Dec 2013 15:29:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [87.230.106.24] (HELO vwp1524.webpack.hosteurope.de) (87.230.106.24) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Dec 2013 15:29:52 +0000 Received: from [2a02:810c:ac0:d4c:9c45:e908:4532:3050] (helo=laptop-2.fritz.box); authenticated by vwp1524.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1VwCsN-0001hn-0I; Thu, 26 Dec 2013 16:29:31 +0100 Message-ID: <52BC4B5A.6000305@apache.org> Date: Thu, 26 Dec 2013 16:29:30 +0100 From: =?ISO-8859-1?Q?Florian_M=FCller?= User-Agent: Postbox 3.0.8 (Macintosh/20130427) MIME-Version: 1.0 To: Denis Andreev CC: dev@chemistry.apache.org, 'Alfresco Team' Subject: Re: Alfresco - DotCmis - GetAcl issue References: <00c101cf0227$0353aff0$09fb0fd0$@com> <52BC0C91.1060908@apache.org> <00c901cf024b$69a29860$3ce7c920$@com> In-Reply-To: <00c901cf024b$69a29860$3ce7c920$@com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;fmui@apache.org;1388071793;d1fbf15e; X-Virus-Checked: Checked by ClamAV on apache.org Hi Denis, there is no "normal logic" here. The CMIS specification defines that object IDs are opaque strings. Clients cannot and should not try to interpret these strings because they are repository specific. Other repositories use totally different formats. Therefore, DotCMIS treats object IDs just as strings. When you provide an invalid ID, its passes it to the repository and the repository returns an error message. When you need the latest version, you have to call GetObjectOfLatestVersion or GetAllVerions. You don't have to call GetAcl, though. You can provide an operation context, that indicates that you want the object ACL with the object metadata. The repository then attaches the ACL to the IDocument object. Regards, Florian > Hi Florian > I consider it's normal logic - if document ID does not contain a version > number then the latest version should be returned by default. Otherwise to > get ACL three methods should be invoked instead of one. > Let's assume there is a document id - > workspace://SpacesStore/4d7f6e4f-692e-4adc-afc8-039d7604245a > The last version is 3.1. The problem is I don't know the last version > number. > Thereby to get ACL I should do the following: > 1. Get the document for first version > doc = > Session.GetObject(workspace://SpacesStore/4d7f6e4f-692e-4adc-afc8-039d760424 > 5a;1.0) > > 2. Get the latest version > doc.GetObjectOfLatestVersion > > 3. Get ACL for the latest version > Session.GetAcl(workspace://SpacesStore/4d7f6e4f-692e-4adc-afc8-039d7604245a; > 3.1) > > It's not good logic. It's going to be a performance issue if these > operations are going to be repeated for hundreds of thousands documents. > There is really no way to not use version number? > > I tried to add the following code into GetObjectInternal: > if (idOrPath == IdentifierType.Id && > !objectIdOrPath.Contains(";")) > { > int i = entry.Id.IndexOf(';'); > if (i != -1) > entry.Id = entry.Id.Substring(0, i); > } > But I'm not sure it will work properly in all cases:) > > Best regards, > Denis Andreev > > > -----Original Message----- > From: Florian M�ller [mailto:fmui@apache.org] > Sent: Thursday, December 26, 2013 2:02 PM > To: dev@chemistry.apache.org > Cc: Alfresco Team > Subject: Re: Alfresco - DotCmis - GetAcl issue > > Hi Denis, > > Alfresco document IDs without a version number are not valid CMIS object > IDs. Alfresco accepts them in some places for convenience but you shouldn't > rely on it. That is, DotCMIS behaves as excepted. (See also [1].) > > > Regards, > > Florian > > > [1] > http://stackoverflow.com/questions/19364811/client-cache-enabled-but-ignored > -on-alfresco/19367870#19367870 > > > Denis Andreev schrieb: >> Hi Everyone >> >> There is an issue with getting ACL for a document. The method >> Session.GetAcl throws DotCMIS.Exceptions.CmisObjectNotFoundException : > Unknown object! >> >> >> Exception stack: >> >> at > DotCMIS.Binding.AtomPub.AbstractAtomPubService.ThrowLinkException(String >> repositoryId, String id, String rel, String type) in atompub.cs: line 394 > >> at >> DotCMIS.Binding.AtomPub.AbstractAtomPubService.GetAclInternal(String >> repositoryId, String objectId, Nullable`1 onlyBasicPermissions, >> IExtensionsData extension) in atompub.cs: line 645 >> >> at DotCMIS.Binding.AtomPub.AclService.GetAcl(String repositoryId, >> String objectId, Nullable`1 onlyBasicPermissions, IExtensionsData > extension) in >> atompub.cs: line 2760 >> >> at DotCMIS.Client.Impl.Session.GetAcl(IObjectId objectId, Boolean >> onlyBasicPermissions) in client-impl.cs: line 869 >> >> >> >> It happens when ObjectId passed to the Session.GetAcl does not have >> document version. >> >> For example >> >> There is a document id - >> workspace://SpacesStore/96f5a5ae-aea2-497b-80db-d3f646adb293 >> >> >> >> If the ID is passed to Session.GetAcl() as >> "workspace://SpacesStore/96f5a5ae-aea2-497b-80db-d3f646adb293;1.0" the >> it works. >> >> If workspace://SpacesStore/96f5a5ae-aea2-497b-80db-d3f646adb293 then >> it doesn't work >> >> >> >> I looked into the code and found out that the problem can be in the >> method AbstractAtomPubService.GetObjectInternal >> >> The object is requested from Alfresco >> >> >> >> HttpUtils.Response resp = Read(url); >> >> AtomEntry entry = Parse(resp.Stream); >> >> >> >> That is the parameter "url" contains the object id without version >> number but response contains ID with version. >> >> In the issue further in GetObjectInternal >> >> AddLink(repositoryId, entry.Id, (AtomLink)element.Object) >> >> Adds the object link with version number but then in the method >> LoadLink >> >> GetObjectInternal(repositoryId, IdentifierType.Id, id, >> ReturnVersion.This, null, null, null, null, null, null, null); >> >> link = GetLink(repositoryId, id, rel, type); >> >> link is null >> >> >> >> I think the method should work in spite of the version number is >> available or not. >> >> Would you please have a look at the code and do something with it. >> >> >> >> Best regards, >> >> Denis Andreev >> >> >> >> > >