--- nfo/perl/libs/Data/Storage/Handler/Tangram.pm 2003/07/02 11:07:12 1.43 +++ nfo/perl/libs/Data/Storage/Handler/Tangram.pm 2003/12/14 01:48:36 1.45 @@ -1,8 +1,15 @@ ############################################ # -# $Id: Tangram.pm,v 1.43 2003/07/02 11:07:12 jonen Exp $ +# $Id: Tangram.pm,v 1.45 2003/12/14 01:48:36 jonen Exp $ # # $Log: Tangram.pm,v $ +# Revision 1.45 2003/12/14 01:48:36 jonen +# small HACK at _insertChildNode: some special Childnodes should not be created because existing objects have to be selected! +# TODO: make this more generic, e.g. implement a special flag at Schema +# +# Revision 1.44 2003/12/04 01:01:50 joko +# + sendQuery now returns result even on crud=UPDATE +# # Revision 1.43 2003/07/02 11:07:12 jonen # re-activate filtering of results *after* results are fetched from tangram # (needed for e.g. UserManagment) @@ -183,6 +190,7 @@ # get logger instance my $logger = Log::Dispatch::Config->instance; +#$Tangram::TRACE = *STDOUT; # this holds the complete instantiated schema from tangram my $schema_tangram; @@ -809,8 +817,11 @@ my $options = { utf8 => 1, php => 1 }; merge_to($object, $query->{payload}, $options); + #print Dumper($object); + # Execute update operation at orm. $self->update($object); + $result = $self->createResult([ $object ]); } elsif ($crud eq 'DELETE') { @@ -1013,7 +1024,16 @@ $obj->{$_} = '0000-00-00 00:00:00'; } elsif($attr_types->{$_} eq 'ref') { if($attr_options->{$_}->{class}) { - $obj->{$_} = $self->createNode($attr_options->{$_}->{class}); + # HACK!!! + # STANDALONE Objects (objects which make sense to instanciat alone) should not created automaticly + # because they maybe exists and should only be SETTED not CREATED! + # TODO: Create a flag at the scheme for that reason! + # (e.g child_node => 1 for child-nodes only like e.g. UserData) + if($attr_options->{$_}->{class} eq 'NetPerson' || $attr_options->{$_}->{class} eq 'Event') { + #$obj->{$_} = undef(); + } else { + $obj->{$_} = $self->createNode($attr_options->{$_}->{class}); + } } else { #$obj->{$_} = undef(); }