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 1814A1982 for ; Wed, 20 Apr 2011 12:47:59 +0000 (UTC) Received: (qmail 10123 invoked by uid 500); 20 Apr 2011 12:47:59 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 10088 invoked by uid 500); 20 Apr 2011 12:47: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 10080 invoked by uid 99); 20 Apr 2011 12:47:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2011 12:47:58 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [62.58.252.169] (HELO smtpserver.aca-it.be) (62.58.252.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2011 12:47:53 +0000 Received: from localhost (localhost [127.0.0.1]) by smtpserver.aca-it.be (Postfix) with ESMTP id C20DEBBD9; Wed, 20 Apr 2011 14:47:32 +0200 (CEST) Received: from smtpserver.aca-it.be ([127.0.0.1]) by localhost (smtpserver.aca-it.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r8L25sU7b8Uh; Wed, 20 Apr 2011 14:47:30 +0200 (CEST) Received: from itshas-sv06.aca-it.be (itshas-sv06.aca-it.be [10.32.1.37]) by smtpserver.aca-it.be (Postfix) with ESMTP id D8CA4BBD6; Wed, 20 Apr 2011 14:47:30 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by itshas-sv06.aca-it.be (Postfix) with ESMTP id CB99E7E6C1C; Wed, 20 Apr 2011 14:47:30 +0200 (CEST) X-Virus-Scanned: amavisd-new at itshas-sv06.aca-it.be Received: from itshas-sv06.aca-it.be ([127.0.0.1]) by localhost (itshas-sv06.aca-it.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TkHXXpHZup2M; Wed, 20 Apr 2011 14:47:28 +0200 (CEST) Received: by itshas-sv06.aca-it.be (Postfix, from userid 100) id EC8213D8401; Wed, 20 Apr 2011 14:47:27 +0200 (CEST) Received: from itshas-sv06.aca-it.be (itshas-sv06.aca-it.be [10.32.1.37]) by itshas-sv06.aca-it.be (Postfix) with ESMTP id D261B7E6C1C; Wed, 20 Apr 2011 14:47:27 +0200 (CEST) Date: Wed, 20 Apr 2011 14:47:27 +0200 (CEST) From: Geert Vanheusden To: =?utf-8?Q?Florian_M=C3=BCller?= Cc: dev@chemistry.apache.org Message-ID: <74262695.85785.1303303647639.JavaMail.root@itshas-sv06> In-Reply-To: <4DAECC11.2050005@alfresco.com> Subject: Re: Different result with same query but other OpenCMIS version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 6.0.7_GA_2473.RHEL5_64 (ZimbraWebClient - SAF3 (Mac)/6.0.7_GA_2473.RHEL5_64) X-Virus-Checked: Checked by ClamAV on apache.org Ok. Added the following: for (QueryResult queryResult : query) { System.out.println("- " + queryResult.getPropertyValueById("cmis:objec= tId")); } System.out.println("Total results: " + query.getTotalNumItems()); Results: 0.2.0: ------ - workspace://SpacesStore/586dbf3c-dc8d-4b5a-a331-7f04c5b9d7ad Total results: 1 0.3.0: ------ Total results: 0 And the links to the Wireshark packets: http://dl.dropbox.com/u/623463/alf/OpenCMIS-0.2.0-debug.txt http://dl.dropbox.com/u/623463/alf/OpenCMIS-0.3.0-debug.txt The POST url looks identical... very strange. Kind regards, Geert ----- Original Message ----- From: "Florian M=C3=BCller" To: dev@chemistry.apache.org, "Geert Vanheusden" Sent: Wednesday, April 20, 2011 2:05:37 PM Subject: Re: Different result with same query but other OpenCMIS version Could you please iterate through all results - even though getTotalNumItems= () returns 0 - and count the results? Would it be possible to capture the network traffic? Florian On 20/04/2011 12:30, Geert Vanheusden wrote: > Ok, I extracted some code in a separate application. >=20 > ------------------------------------- >=20 > package be.idewe.park; >=20 > import java.util.HashMap; > import java.util.Map; >=20 > import org.apache.chemistry.opencmis.client.api.ItemIterable; > import org.apache.chemistry.opencmis.client.api.QueryResult; > import org.apache.chemistry.opencmis.client.api.Session; > import org.apache.chemistry.opencmis.client.api.SessionFactory; > import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl; > import org.apache.chemistry.opencmis.commons.SessionParameter; > import org.apache.chemistry.opencmis.commons.enums.BindingType; >=20 > public class TestQuery { >=20 > =09/** > =09 * @param args > =09 */ > =09public static void main(String[] args) { > =09=09TestQuery testQuery =3D new TestQuery(); > =09=09 > =09=09Session session =3D testQuery.getSession(); > =09=09ItemIterable query =3D session.query("SELECT DOCUMENT= .*, EMPLOYEEDOCUMENT.* FROM park:document AS DOCUMENT JOIN park:employeeDoc= ument AS EMPLOYEEDOCUMENT ON DOCUMENT.cmis:objectId =3D EMPLOYEEDOCUMENT.cm= is:objectId WHERE (EMPLOYEEDOCUMENT.employeeDoc:currentEmployeeName LIKE '%= VANHEUSDEN%')", false); > =09=09 > =09=09System.out.println(query.getTotalNumItems()); >=20 > =09} > =09 > =09public Session getSession() { > =09=09// default factory implementation of client runtime > =09=09SessionFactory f =3D SessionFactoryImpl.newInstance(); > =09=09Map parameter =3D new HashMap(); >=20 > =09=09// user credentials > =09=09parameter.put(SessionParameter.USER, "admin"); > =09=09parameter.put(SessionParameter.PASSWORD, "admin"); >=20 > =09=09// connection settings > =09=09parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:7070/= alfresco/s/cmis"); > =09=09parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.va= lue()); >=20 > =09=09// session locale > =09=09parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, "be"); > =09=09parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "nl"); > =09=09parameter.put(SessionParameter.LOCALE_VARIANT, ""); > =09=09 > =09=09parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.= cmis.client.impl.AlfrescoObjectFactoryImpl"); >=20 > =09=09return f.getRepositories(parameter).get(0).createSession(); > } >=20 > } > ---------------------------- >=20 > And here a POM snippet: >=20 > > =09=09 > =09=09 > =09=09org.apache.chemistry.opencmis > =09=09chemistry-opencmis-client-impl > =09=090.3.0 > =09=09 > =09=09 > =09=09org.alfresco.cmis.client > =09=09alfresco-opencmis-extension > =09=090.2 > =09=09 > >=20 > --------------------------- >=20 > So when I execute this code I get "0" (incorrect). If I replace the depen= dency with "0.2.0-incubating" it returns "1". >=20 > Kind regards, >=20 > Geert >=20 >=20 > ----- Original Message ----- > From: "Florian M=C3=BCller" > To: dev@chemistry.apache.org > Sent: Wednesday, April 20, 2011 12:44:01 PM > Subject: Re: Different result with same query but other OpenCMIS version >=20 > No, Alfresco uses a different parser. > If the CMIS query didn't change and the repository implementation didn't = change, only the interpretation of the results can be different on the clie= nt side. But we haven't touched that code for quite a while. >=20 > Florian >=20 >=20 > On 20/04/2011 11:37, Jens H=C3=BCbel wrote: >> Does the Alfresco implementation use the opencmis query parser? Even tha= t should not have been changed with the exception of a few minor patches. I= s there a chance to find out what native queries are generated from the CMI= S one? >> >> Jens >> >> >> -----Original Message----- >> From: Geert Vanheusden [mailto:g.vanheusden@aca-it.be] >> Sent: Mittwoch, 20. April 2011 11:41 >> To: dev >> Subject: Different result with same query but other OpenCMIS version >> >> Dear, >> >> I just upgraded to OpenCMIS 0.3.0 (coming from 0.2.0-incubating) and I n= oticed that the same query I used before returns an incorrect result. >> >> I have a custom document type (park:document) and a park:employeeDocumen= t aspect. >> >> When I execute the following query using OpenCMIS 0.2.0-incubating I hav= e one document as a result (correct). If I execute the same query using Ope= nCMIS 0.3.0 then there are no documents returned. >> >> cmisSession.query(" >> SELECT DOCUMENT.*, EMPLOYEEDOCUMENT.* >> FROM park:document AS DOCUMENT >> JOIN park:employeeDocument AS EMPLOYEEDOCUMENT >> ON DOCUMENT.cmis:objectId =3D EMPLOYEEDOCUMENT.cmis:objectId >> WHERE (EMPLOYEEDOCUMENT.employeeDoc:currentEmployeeName LIKE '%VANHEUSDE= N%') >> ", false) >> >> I am using the alfresco-opencmis-extension 0.2 and querying against an A= lfreso enterprise 3.4. >> If I execute the same query in the latest version of the OpenCMIS workbe= nch I have also one document as a result (correct). >> >> Any ideas? Maybe a bug in OpenCMIS 0.3.0? >> >> Kind regards, >> >> Geert Vanheusden >> >> >> _________________________________________________ >> >> We published a new company movie featuring YOU! >> See http://www.aca-it.be/movie >> _________________________________________________ >=20