my( $graph_data, $rel_data ) = graphml_parse( $opts );
my $collation = $tradition->collation;
+ my $tmeta = $tradition->meta;
+ my $cmeta = $collation->meta;
+
my %witnesses;
# print STDERR "Setting graph globals\n";
$tradition->name( $graph_data->{'name'} );
-
my $use_version;
foreach my $gkey ( keys %{$graph_data->{'global'}} ) {
my $val = $graph_data->{'global'}->{$gkey};
} else {
warn( "DROPPING user assignment without a specified userstore" );
}
+ # Is this key an attribute of the tradition or collation?
+ } elsif( $tmeta->has_attribute( $gkey ) ) {
+ my $attr = $tmeta->get_attribute( $gkey );
+ warn( "Nonexistent tradition attribute $gkey" ) unless $attr;
+ my $method = $attr->get_write_method();
+ $tradition->$method( $val );
+ } elsif( $cmeta->has_attribute( $gkey ) ) {
+ my $attr = $cmeta->find_attribute_by_name( $gkey );
+ warn( "Nonexistent collation attribute $gkey" ) unless $attr;
+ my $method = $attr->get_write_method();
+ $collation->$method( $val );
+ # Or is it an indirect attribute or other method?
} elsif( $tradition->can( $gkey ) ) {
$tradition->$gkey( $val );
} elsif( $collation->can( $gkey ) ) {
$collation->$gkey( $val );
+ # Nope? Oh well.
} else {
warn( "DROPPING unsupported attribute $gkey" );
}