Changeset 12893
- Timestamp:
- 2006-09-28T11:29:39+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/GenericList.pm
r12892 r12893 256 256 # The root node of the classification hierarchy 257 257 my $childtype = $self->{$first_metadata_group . ".list_type"}; 258 my %classif yinfo= ( 'thistype' => "Invisible",259 'childtype' => $childtype,260 'Title' => $self->{'title'},261 'contains' => [] );258 my %classifier_node = ( 'thistype' => "Invisible", 259 'childtype' => $childtype, 260 'Title' => $self->{'title'}, 261 'contains' => [] ); 262 262 263 263 # Recursively create the classification hierarchy, one level for each metadata element 264 &add_az_list($self, \@metadata_groups, \@OIDs, \%classif yinfo);265 return \%classif yinfo;264 &add_az_list($self, \@metadata_groups, \@OIDs, \%classifier_node); 265 return \%classifier_node; 266 266 } 267 267 … … 272 272 my @metadata_groups = @{shift(@_)}; 273 273 my @OIDs = @{shift(@_)}; 274 my $classif yinfo= shift(@_);275 # print STDERR "\nAdding AZ list for " . $classif yinfo->{'Title'} . "\n";274 my $classifier_node = shift(@_); 275 # print STDERR "\nAdding AZ list for " . $classifier_node->{'Title'} . "\n"; 276 276 277 277 my $metadata_group = $metadata_groups[0]; … … 306 306 # Is this the start of a new partition? 307 307 if ($metavaluepartition ne $lastpartition) { 308 &add_hlist_partition($self, \@metadata_groups, $classif yinfo, $lastpartition, \%metavaluetoOIDsubhash);308 &add_hlist_partition($self, \@metadata_groups, $classifier_node, $lastpartition, \%metavaluetoOIDsubhash); 309 309 %metavaluetoOIDsubhash = (); 310 310 $lastpartition = $metavaluepartition; … … 315 315 316 316 # Don't forget to add the last partition 317 &add_hlist_partition($self, \@metadata_groups, $classif yinfo, $lastpartition, \%metavaluetoOIDsubhash);317 &add_hlist_partition($self, \@metadata_groups, $classifier_node, $lastpartition, \%metavaluetoOIDsubhash); 318 318 319 319 # The partitions are stored in an HList 320 $classif yinfo->{'childtype'} = "HList";320 $classifier_node->{'childtype'} = "HList"; 321 321 } 322 322 … … 348 348 } 349 349 350 &add_hlist_partition($self, \@metadata_groups, $classif yinfo, $partitionname, \%metavaluetoOIDsubhash);350 &add_hlist_partition($self, \@metadata_groups, $classifier_node, $partitionname, \%metavaluetoOIDsubhash); 351 351 %metavaluetoOIDsubhash = (); 352 352 $lastpartitionend = $partitionend; … … 355 355 356 356 # The partitions are stored in an HList 357 $classif yinfo->{'childtype'} = "HList";357 $classifier_node->{'childtype'} = "HList"; 358 358 } 359 359 360 360 # Otherwise just add all the values to a VList 361 361 else { 362 &add_vlist($self, \@metadata_groups, $classif yinfo, \%metavaluetoOIDhash);362 &add_vlist($self, \@metadata_groups, $classifier_node, \%metavaluetoOIDhash); 363 363 } 364 364 } … … 418 418 my $self = shift(@_); 419 419 my @metadata_groups = @{shift(@_)}; 420 my $classif yinfo= shift(@_);420 my $classifier_node = shift(@_); 421 421 my $partitionname = shift(@_); 422 422 my %metavaluetoOIDhash = %{shift(@_)}; 423 423 424 424 # Create an hlist partition 425 my % subclassifyinfo= ( 'Title' => $partitionname,426 427 425 my %child_classifier_node = ( 'Title' => $partitionname, 426 'childtype' => "VList", 427 'contains' => [] ); 428 428 429 429 # Add the children to the hlist partition 430 &add_vlist($self, \@metadata_groups, \% subclassifyinfo, \%metavaluetoOIDhash);431 push(@{$classif yinfo->{'contains'}}, \%subclassifyinfo);430 &add_vlist($self, \@metadata_groups, \%child_classifier_node, \%metavaluetoOIDhash); 431 push(@{$classifier_node->{'contains'}}, \%child_classifier_node); 432 432 } 433 433 … … 437 437 my $self = shift(@_); 438 438 my @metadata_groups = @{shift(@_)}; 439 my $classif yinfo= shift(@_);439 my $classifier_node = shift(@_); 440 440 my %metavaluetoOIDhash = %{shift(@_)}; 441 441 … … 448 448 # If there is only one item and 'always_bookshelf' is false, add the item to the list 449 449 if (@OIDs == 1 && $self->{$metadata_group . ".always_bookshelf"} eq "f") { 450 push(@{$classif yinfo->{'contains'}}, { 'OID' => $OIDs[0] });450 push(@{$classifier_node->{'contains'}}, { 'OID' => $OIDs[0] }); 451 451 } 452 452 453 453 # Otherwise create a sublist (bookshelf) for the metadata value 454 454 else { 455 my % subclassifyinfo= ( 'Title' => $metavalue,456 457 455 my %child_classifier_node = ( 'Title' => $metavalue, 456 'childtype' => "VList", 457 'contains' => [] ); 458 458 459 459 # If there are metadata elements remaining, recursively apply the process … … 461 461 my $next_metadata_group = $metadata_groups[0]; 462 462 my $childtype = $self->{$next_metadata_group . ".list_type"}; 463 $ subclassifyinfo{'childtype'} = $childtype;464 &add_az_list($self, \@metadata_groups, \@OIDs, \% subclassifyinfo);463 $child_classifier_node{'childtype'} = $childtype; 464 &add_az_list($self, \@metadata_groups, \@OIDs, \%child_classifier_node); 465 465 } 466 466 # Otherwise just add the documents as children of this list … … 476 476 477 477 foreach my $OID (@OIDs) { 478 push(@{$ subclassifyinfo{'contains'}}, { 'OID' => $OID });478 push(@{$child_classifier_node{'contains'}}, { 'OID' => $OID }); 479 479 } 480 480 } 481 481 482 482 # Add the sublist to the list 483 push(@{$classif yinfo->{'contains'}}, \%subclassifyinfo);483 push(@{$classifier_node->{'contains'}}, \%child_classifier_node); 484 484 } 485 485 }
Note:
See TracChangeset
for help on using the changeset viewer.