Return-Path: Delivered-To: apmail-incubator-jackrabbit-dev-archive@www.apache.org Received: (qmail 55593 invoked from network); 17 Mar 2005 05:22:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Mar 2005 05:22:34 -0000 Received: (qmail 23381 invoked by uid 500); 17 Mar 2005 05:22:28 -0000 Mailing-List: contact jackrabbit-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-dev@incubator.apache.org Received: (qmail 23304 invoked by uid 99); 17 Mar 2005 05:22:28 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from ip213-185-42-161.laajakaista.mtv3.fi (HELO hukka.local) (213.185.42.161) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 16 Mar 2005 21:22:28 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hukka.local (8.13.1/8.13.1) with ESMTP id j2H5MISx021677 for ; Thu, 17 Mar 2005 07:22:20 +0200 Subject: Re: namespaces From: Jukka Zitting To: Jackrabbit In-Reply-To: <4238B47E.6070509@wyona.com> References: <423835EC.6010802@wyona.com> <8be73188050316053744daf9e4@mail.gmail.com> <42385160.8@wyona.org> <3df33a250503161013307b03ef@mail.gmail.com> <4238ABA1.5040801@wyona.com> <8be73188050316141269c454cb@mail.gmail.com> <4238B47E.6070509@wyona.com> Content-Type: text/plain Organization: Yukatan Date: Thu, 17 Mar 2005 07:22:18 +0200 Message-Id: <1111036938.21580.9.camel@hukka.local> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, Michael Wechner wrote: > by stepping through all prefixes and according namespaces one > can find out what prefix is being used by Jackrabbit and then the > JCR path can be constructed. Another way would be to use XPath search or whatever mechanism to locate the Node you want to export and then get the JCR path with Node.getPath (). For example: Node node = ...; session.exportDocView(node.getPath(), ...); The Node.getPath() method will automatically do the prefix mappings for you. Alternatively, you do not need to iterate through all the namespace mappings to get the prefix for your namespace. You can use the NamespaceRegistry.getPrefix() method, as shown below: NamespaceRegistry registry = session.getWorkspace().getNamespaceRegistry(); String namespace = "http://apache.org/cocoon/lenya/sitetree/1.0"; String prefix = registry.getPrefix(namespace); session.exportDocView("/authoring/" + prefix + ":site", ...); BR, Jukka Zitting