From users-return-19238-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Tue Nov 13 18:09:16 2012 Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53115DFE7 for ; Tue, 13 Nov 2012 18:09:16 +0000 (UTC) Received: (qmail 18349 invoked by uid 500); 13 Nov 2012 18:09:15 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 18288 invoked by uid 500); 13 Nov 2012 18:09:15 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 18277 invoked by uid 99); 13 Nov 2012 18:09:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 18:09:14 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jjverderber@gmail.com designates 209.85.215.170 as permitted sender) Received: from [209.85.215.170] (HELO mail-ea0-f170.google.com) (209.85.215.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 18:09:09 +0000 Received: by mail-ea0-f170.google.com with SMTP id a13so5476725eaa.1 for ; Tue, 13 Nov 2012 10:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=QlipgoV1dkC0A5gygqojGLEoWijE1V+NLC9zdOz6j4I=; b=H3JzHXtSKexNlLsKzH3/0KJnWrKhHDzc2L739gtw0TNTBLrd4MuwwMoljNt4sJLd8l 8GGAddYXeB99gGIpNvikwxkSzhxgqGYgKZvw3jhWzkXKeCZMNDTqh6SfKOC7jZG8Dpq8 EHdMtXR5OhWgCpl97JcqhZmLmlw1sQdN/yi4cjoXyEBicGUA9wyuh0JvnT0VPoE2LQP5 aT5O1x1nBjMkiRnmHEOXvm506UquZhnqKmFpXe0dfHWopFPw7WwIwAL/VQZ8xRBcqgjL q7WXQc4QW6O0kbQ0dC81rv0I6FQxMyjr+rVtcNE5ntBruwH1DtPv2+nFkHmLJDmzANQU 4Eng== MIME-Version: 1.0 Received: by 10.14.193.136 with SMTP id k8mr77327668een.30.1352830127583; Tue, 13 Nov 2012 10:08:47 -0800 (PST) Received: by 10.223.179.7 with HTTP; Tue, 13 Nov 2012 10:08:47 -0800 (PST) In-Reply-To: References: Date: Tue, 13 Nov 2012 13:08:47 -0500 Message-ID: Subject: Re: JCR_SQL2, query on jcr:mimeType From: joe verderber To: users@jackrabbit.apache.org Content-Type: multipart/alternative; boundary=047d7b343e3632367904ce644fed X-Virus-Checked: Checked by ClamAV on apache.org --047d7b343e3632367904ce644fed Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have a local CQ5 instance running and the following seems to work for me: Repository r =3D JcrUtils.getRepository("http://localhost:4502/crx/server/"= ); Session s =3D r.login( new SimpleCredentials("admin", "admin".toCharArray()= ) ,"crx.default"); System.out.println("logged in!!!"); NodeIterator ni =3D s.getWorkspace().getQueryManager().createQuery("select= * from [nt:unstructured] where" + " [nt:unstructured].'jcr:mimeType' like '%/%' ", "JCR-SQL2" ).execute().getNodes(); while(ni.hasNext()) { System.out.println("currentNode.path=3D'"+ni.nextNode().getPath()+"'"); System.out.println("currentNode.mimeType=3D'"+ni.nextNode().getProperty( "jcr:mimeType").getString()+"'"); } s.logout(); System.out.println("logged out."); On Sun, Nov 11, 2012 at 5:55 PM, oliver.gregory@gmail.com < oliver.gregory@gmail.com> wrote: > Hello, > > I would like to know if it's possible in Jackrabbit with JCR_SQL2 to quer= y > a node according to the jcr:mimeType property. > Something like : > SELECT * FROM [nt:unstructured] AS node WHERE node.id =3D 2 and > node.file.jcr:content[jcr:mimeType] =3D 'application/xml' > > Thanks, > > Gr=E9gory OLIVER > --047d7b343e3632367904ce644fed--