You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Anton Slutsky <an...@hotmail.com> on 2007/02/22 13:45:03 UTC

Re: Node type modification (Was: Commented: (JCR-322) Support node type modification and removal)

Jukka Zitting <jukka.zitting <at> gmail.com> writes:

> 
> Hi,
> 
> [Taking the discussion back to dev <at> , as the mailing list is better for
> general discussion]
> 
> On 2/15/07, Anton Slutsky (JIRA) <jira <at> apache.org> wrote:
> > Soooo.  Any thoughts?  Anybody?
> 
> For now I'd opt for the brute force alternative of traversing all
> workspaces. The ItemStateVisitor solution discussed just yesterday for
> the backup tool could well be used also for this purpose.
> 
> BR,
> 
> Jukka Zitting
> 
> 

Basically just to through all ideas out there, here's another one.

When deleting a type do two things:

1. Check for all types that reference the one being deleted.  I think we can do
this already fairly easily.

If anything has this type referenced as its child or a property definition,
throw an exception preventing the type from being unregistered.

If no node type references are found, delete the type.

2. We leave content nodes of the just deleted type untouched until that time
when a node of type is being loaded from persistent storage.  When the node is
loaded, if the node type of this node doesnt exist, we simply reassign the type
to nt:unstructured

We can do this because in step 1, we made sure that no nodes require this node
type in their definition.