> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Namens Michiel Meeuwissen
> Verzonden: woensdag 3 september 2003 21:08
> Aan: [EMAIL PROTECTED]
> Onderwerp: Re: [MMBASE CVS] src/org/mmbase/module/tools MMAdmin.java
> 
> 
> nico <[EMAIL PROTECTED]> wrote:
> > Update of /usr/local/cvs/src/org/mmbase/module/tools
> > In directory UE450:/tmp/cvs-serv13089/src/org/mmbase/module/tools
> > 
> > Modified Files:
> >     MMAdmin.java
> > Log Message:
> > imported nodes with fields of type NODE failed to insert 
> when the notnull flag was set to true.
> > The insert happened before replacing the value for a real 
> node number.
> > The ApplicationResult will have an errormessage when the 
> import fails to find the referenced node (maybe not imported yet).
> > if notnull = false then the node will be updated after all 
> nodes of all datasources are imported.
> > 
> > Cleaned some unused local variables
> ....
> 
> > +                       // guess that failed
> > +                       result.error("Insert of node " + 
> newnode + " 
> > + failed. A field with type NODE is not allowed to have a 
> null value. " +
> >                                     "The referenced node is 
> not found. 
> > Try to reorder the nodes so the referenced node is imported before 
> > this one.");
> 
> Interesting. Will the application-writer order the nodes 
> containing NODE-fields in the right way?

Not at the moment. I was looking at it, but I haven't figured out the
algorithm. 
The datasources and nodes have to be in the right order from top to
bottom. The thing is that the NODE field doesn't mention to which
nodetype it is pointing. You have to grap all the nodes and find out
which nodetypes they have. This has to happen a couple of levels deep.
After this the nodes should be sorted. The sorting process requires
cycle detection and other graph related stuff. If everything went well
then you know which nodes and datasources should load first.
I think that I am not going to rewrite the backup stuff now. It is just
too much work for my vacation.

Nico

----------------------------------------------------------------------
"You can't have everything. Where would you put it?" - Steven Wright


Reply via email to