Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 67360 invoked from network); 21 Mar 2009 02:01:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Mar 2009 02:01:35 -0000 Received: (qmail 55743 invoked by uid 500); 21 Mar 2009 02:01:34 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 55724 invoked by uid 500); 21 Mar 2009 02:01:34 -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 55713 invoked by uid 99); 21 Mar 2009 02:01:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Mar 2009 19:01:33 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.97.132.74] (HELO homiemail-a3.dreamhost.com) (208.97.132.74) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Mar 2009 02:01:26 +0000 Received: from [192.168.1.114] (60-242-7-167.static.tpgi.com.au [60.242.7.167]) by homiemail-a3.dreamhost.com (Postfix) with ESMTP id 07DA8C58EA for ; Fri, 20 Mar 2009 19:01:02 -0700 (PDT) Message-ID: <49C44A5D.7070605@charlie.brooking.id.au> Date: Sat, 21 Mar 2009 12:01:01 +1000 From: Charles Brooking User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: users@jackrabbit.apache.org Subject: Re: How to modify CND in live repository References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Matt Fulford wrote: > Is the only way to make a change to the repository CND file: > 1. export data > 2. clear/initialize repository > 3. register modified CND > 4. re-import data > > Or can I update some file 'on the fly'? > See registerNodeTypes in NodeTypeManagerImpl: NodeTypeManagerImpl manager = (NodeTypeManagerImpl) session.getWorkspace().getNodeTypeManager(); NodeType[] nodeTypes = manager.registerNodeTypes( in, // input stream for new CND file NodeTypeManagerImpl.TEXT_X_JCR_CND, true // reregister existing node types ); I have found this to work even when existing nodes have types being replaced. You can write "migration" code that does the nodetype reregistration (above) and then makes the relevant changes to content. When you call save, nodes are validated against the new node types. Later Charlie