Changeset 33454

Show
Ignore:
Timestamp:
03.09.2019 14:41:11 (2 weeks ago)
Author:
kjdon
Message:

updated metadata_selection_mode to be metadata_selection_mode_within_level - I had changed the param name, but not teh code to match. if either partition_type or numeric_partition_type is none, then set the other one for the same level to be none. Can't have half the values partitioned and not the other half

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/classify/List.pm

    r33452 r33454  
    137137       
    138138      { 'name' => "metadata_selection_mode_within_level", 
    139     'desc' => "{List.metadata_selection_mode}", 
     139    'desc' => "{List.metadata_selection_mode_within_level}", 
    140140    'type' => "enumstring", # Must be enumstring because multiple values can be specified (separated by '/') 
    141141    'list' => $metadata_selection_mode_list, 
     
    143143       
    144144      { 'name' => "metadata_sort_mode_within_level", 
    145     'desc' => "{List.metadata_sort_mode}", 
     145    'desc' => "{List.metadata_sort_mode_within_level}", 
    146146    'type' => "enumstring", # Must be enumstring because multiple values can be specified (separated by '/') 
    147147    'list' => $metadata_sort_mode_list, 
     
    289289 
    290290    # meta selection mode for each level 
    291     $self->set_metadata_groups_info_per_level("metadata_selection_mode", $metadata_selection_mode_default, $valid_metadata_selection_modes); 
     291    $self->set_metadata_groups_info_per_level("metadata_selection_mode_within_level", $metadata_selection_mode_default, $valid_metadata_selection_modes); 
    292292    
    293293    # meta sort mode for each level 
     
    328328    $self->set_metadata_groups_info_per_level("numeric_partition_type_within_level", $numeric_partition_type_default, $valid_numeric_partition_types); 
    329329 
     330    # now check whether a level was none - need to set the equivalent level in the other half also to none 
     331    foreach my $metadata_group (@metadata_groups) { 
     332    if ($self->{$metadata_group . ".partition_type_within_level"} eq "none" || $self->{$metadata_group . ".numeric_partition_type_within_level"} eq "none") { 
     333         
     334        print STDERR "WARNING: one of -partition_type_within_level or -numeric_partition_type_within_level was set to 'none' for level $metadata_group, overriding current value of both these options to 'none'\n"; 
     335     
     336        $self->{$metadata_group . ".partition_type_within_level"} = "none"; 
     337        $self->{$metadata_group . ".numeric_partition_type_within_level"} = "none"; 
     338    } 
     339    } 
     340     
    330341    $self->set_metadata_groups_info_per_level("partition_size_within_level", $partition_size_default); 
    331342    $self->set_metadata_groups_info_per_level("numeric_partition_size_within_level", $numeric_partition_size_default); 
     
    379390    foreach my $sort_group (@sort_leaf_nodes_using_metadata_groups) { 
    380391    # set metadata_select_type, if not already set - might be already set if the same group was used in -metadata 
    381     if (!defined $self->{$sort_group . ".metadata_selection_mode"}) { 
    382         $self->{$sort_group . ".metadata_selection_mode"} = $metadata_selection_mode_default; 
     392    if (!defined $self->{$sort_group . ".metadata_selection_mode_within_level"}) { 
     393        $self->{$sort_group . ".metadata_selection_mode_within_level"} = $metadata_selection_mode_default; 
    383394    } 
    384395     
     
    428439    my $info_default = shift(@_); 
    429440    my $info_valid_types_hash_ref = shift(@_); 
    430      
     441 
     442    if (!defined $self->{$info_name}) { 
     443    print STDERR "**** undefined $info_name\n"; 
     444    } 
    431445    my @info_list = split(/\//, $self->{$info_name}); 
    432446 
     
    582596                } 
    583597            } 
    584             last if ($self->{$metadata_group . ".metadata_selection_mode"} eq "firstvalue"); 
     598            last if ($self->{$metadata_group . ".metadata_selection_mode_within_level"} eq "firstvalue"); 
    585599            } 
    586600        } # foreach metadatavalue 
    587         last if ((@metadata_values > 0) &&  $self->{$metadata_group . ".metadata_selection_mode"} =~ /^(firstvalue|firstvalidmetadata)$/ ); 
     601        last if ((@metadata_values > 0) &&  $self->{$metadata_group . ".metadata_selection_mode_within_level"} =~ /^(firstvalue|firstvalidmetadata)$/ ); 
    588602        } # foreach metadata element 
    589603