Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 50821 invoked from network); 15 Nov 2006 08:50:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2006 08:50:46 -0000 Received: (qmail 80389 invoked by uid 500); 15 Nov 2006 08:50:55 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 80377 invoked by uid 500); 15 Nov 2006 08:50:55 -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 80367 invoked by uid 99); 15 Nov 2006 08:50:55 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jukka.zitting@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 00:50:53 -0800 Received: by ug-out-1314.google.com with SMTP id 78so61194ugn for ; Wed, 15 Nov 2006 00:49:21 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EQlGEvud22Ov/mUDnVGMRDUUhO5YLRL/KGj/sqF5yajx8mGh1TC6o30bzAWHsZZFlBJnceROFDikknUEacpvAdbfmy8iGt3UgZj1+x5CJ/m3gEX4iCE9kTmwaa0NoRBzXHHLg7791DrBzqHZ4fGwRz9H7K6Mq9tbPboQOny/970= Received: by 10.78.128.11 with SMTP id a11mr2108820hud.1163580561135; Wed, 15 Nov 2006 00:49:21 -0800 (PST) Received: by 10.78.175.15 with HTTP; Wed, 15 Nov 2006 00:49:20 -0800 (PST) Message-ID: <510143ac0611150049jb10fbcfk95538a3f42593db6@mail.gmail.com> Date: Wed, 15 Nov 2006 10:49:20 +0200 From: "Jukka Zitting" To: users@jackrabbit.apache.org Subject: Re: Checking existence of the repository In-Reply-To: <2f35a2640611150041jeb005adl7206c1fc8a946ae5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2f35a2640611150041jeb005adl7206c1fc8a946ae5@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, On 11/15/06, Ted Roeloffzen wrote: > I have made a small web application with JackRabbit and the first time that > i run it I have to register the new nodetypedefinitions and the namespace > URI. Now is my question this: Is there a generic way to check whether or not > your using the repository for the first time? I generally check whether my namespaces or nodetypes are already registered. Something like this: try { session.getNamespacePrefix(MY_NAMESPACE); } catch (NamespaceException e) { // register the namespace(s) } or: try { session.getWorkspace().getNodeTypeManager() .getNodeType(MY_NODETYPE); } catch (NoSuchNodeTypeException e) { // register the node type(s) } BR, Jukka Zitting