From afbbed25081e1be03d8143e0a5a7824e0ea0a0a3 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 4 Mar 2005 23:00:57 +0000 Subject: [PATCH] fixed logic error in adding children to the tree git-svn-id: svn://svn.open-ils.org/ILS/trunk@231 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Cat/Utils.pm | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm index ece9bad60a..acdd064c1c 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Utils.pm @@ -2,18 +2,7 @@ package OpenILS::Application::Cat::Utils; use strict; use warnings; use OpenILS::Utils::Fieldmapper; -=head blah -use constant INTRA_DOC => 2; -use constant parent_node => 3; -use constant TYPE => 4; -use constant NAME => 5; -use constant VALUE => 6; -use constant CHILDREN => 7; -use constant ALTERED => 8; -use constant DELETED => 9; -=cut - - +# --------------------------------------------------------------------------- # Converts an XML nodeset into a tree sub nodeset2tree { my($class, $nodeset) = @_; @@ -25,13 +14,16 @@ sub nodeset2tree { next unless $child; if( defined($child->parent_node) ) { - my $parent = Fieldmapper::biblio::record_node->new($nodeset->[$child->parent_node]); - $parent->children( [ $parent->children(), $child ]); + my $parent = $nodeset->[$child->parent_node]; + $parent->children( + [ @{$parent->children() ? $parent->children() : [] }, $child ]); } } return $nodeset->[0]; } +# --------------------------------------------------------------------------- +# Converts a tree into an xml nodeset my @_nodelist = (); sub tree2nodeset { @@ -70,6 +62,10 @@ sub tree2nodeset { return \@_nodelist; } +# --------------------------------------------------------------------------- +# Walks a nodeset and checks for insert, update, and delete and makes +# appropriate db calls + sub commit_nodeset { my($self, $nodeset) = @_; @@ -121,4 +117,18 @@ sub _deletenode { return 1; } +# --------------------------------------------------------------------------- + + +sub nodeset_to_mods_nodeset { + + +} + + + + + + + 1; -- 2.43.2