jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Brooking <public+jackrab...@charlie.brooking.id.au>
Subject Re: How to modify CND in live repository
Date Sat, 21 Mar 2009 02:01:01 GMT
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)
  NodeType[] nodeTypes = manager.registerNodeTypes(
    in, // input stream for new CND file
    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.


View raw message