Changeset 20008

Show
Ignore:
Timestamp:
17.07.2009 19:05:24 (10 years ago)
Author:
ak19
Message:

Adjusted the code to deal with 1. semicolons and commas separating metadata fieldnames, 2. Greenstone extracted metadata fieldnames being referred to with the ex. prefix, 3. List's partition_type_within_level option is to be an enumerated type (dropdown list).

Location:
gsdl/trunk/perllib
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/classify/AZCompactList.pm

    r19495 r20008  
    190190 
    191191    $metaname =~ s/(\/|\|).*//; # grab first name in n1/n2/n3 or n1|n2|n3 list 
    192     my @commameta_list = split(/,/, $metaname); 
     192    my @commameta_list = split(/,|;/, $metaname); 
    193193 
    194194    if ($self->{'doclevel'} =~ /^top(level)?/i) 
  • gsdl/trunk/perllib/classify/BaseClassifier.pm

    r18555 r20008  
    361361    return "" unless defined $metadata && $metadata =~ /\S/; 
    362362     
    363     my @metalist = split(/,/, $metadata); 
     363    my @metalist = split(/,|;/, $metadata); 
    364364    my $firstmeta = $metalist[0]; 
    365365    if ($firstmeta =~ /\./) { 
  • gsdl/trunk/perllib/classify/List.pm

    r19645 r20008  
    6060    'desc' => "{List.bookshelf_type.duplicate_only}" }, 
    6161      { 'name' => "never", 
    62     'desc' => "{List.bookshelf_type.never}" } ];       
     62    'desc' => "{List.bookshelf_type.never}" } ];   
    6363 
    6464my $arguments =  
     
    7979      { 'name' => "partition_type_within_level", 
    8080    'desc' => "{List.partition_type_within_level}", 
    81     'type' => "string", 
    82     'deft' => "none" }, 
     81    'type' => "enum", 
     82    'list' => $partition_type_list, 
     83    'deft' => "per_letter" }, 
    8384      { 'name' => "partition_size_within_level", 
    8485    'desc' => "{List.partition_size_within_level}", 
     
    139140    if (!$self->{'buttonname'}) { 
    140141    my $first_metadata_group = $metadata_groups[0]; 
    141     my $first_metadata_element = (split(/\;/, $first_metadata_group))[0]; 
     142    my $first_metadata_element = (split(/\;|,/, $first_metadata_group))[0]; 
    142143    $self->{'buttonname'} = $self->generate_title_from_metadata($first_metadata_element); 
    143144    } 
     
    296297    my $classify_section = 0; 
    297298    my $first_metadata_group = $metadata_groups[0]; 
    298     foreach my $first_metadata_group_element (split(/\;/, $first_metadata_group)) { 
     299    foreach my $first_metadata_group_element (split(/\;|,/, $first_metadata_group)) { 
    299300    my $first_metadata_group_element_value = $doc_obj->get_metadata_element($section, $first_metadata_group_element);    
    300301     
     
    334335    # Take care not to do a metadata group more than once 
    335336    unless ($metadata_groups_done{$metadata_group}) { 
    336         foreach my $metadata_element (split(/\;/, $metadata_group)) {        
     337        foreach my $metadata_element (split(/\;|,/, $metadata_group)) {      
    337338        my $remove_prefix_expr = $self->{$metadata_element . ".remove_prefix_expr"}; 
    338339        my $remove_suffix_expr = $self->{$metadata_element . ".remove_suffix_expr"}; 
  • gsdl/trunk/perllib/classify/SimpleList.pm

    r19234 r20008  
    7575    my (@meta_list,$meta1); 
    7676    if ($self->{"metadata"}) { 
    77     @meta_list = split(/,/, $self->{"metadata"}); 
     77    @meta_list = split(/,|;/, $self->{"metadata"}); 
    7878    $meta1 = $meta_list[0]; 
    7979    $self->{'meta_list'} = \@meta_list; 
  • gsdl/trunk/perllib/strings.properties

    r19549 r20008  
    596596List.desc:A general and flexible list classifier with most of the abilities of AZCompactList, but with better Unicode, metadata and sorting capabilities. 
    597597 
     598List.level_partition.none:None. 
    598599List.level_partition.per_letter:Create a partition for each letter. 
    599600List.level_partition.constant_size:Create partition with constant size. 
     
    606607List.partition_size_within_level:The number of items in each partition (only applies when partition_type_within_level is set to 'constant_size'). 
    607608 
    608 List.partition_type_within_level:The type of partitioning done: either 'per_letter', 'constant_size', or 'none'. 
     609List.partition_type_within_level:The type of partitioning done: either 'per_letter', 'per_letter_fixed_size', 'constant_size', or 'none'. 
    609610 
    610611List.sort_leaf_nodes_using:Metadata fields used for sorting the leaf nodes. Use '|' to separate the metadata groups to stable sort and ';' to separate metadata fields within each group.