Changeset 17463

Show
Ignore:
Timestamp:
02.10.2008 17:29:47 (11 years ago)
Author:
kjdon
Message:

some mods to make this a bit more useful in response to request from John Rose

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/ProCitePlugin.pm

    r16104 r17463  
    5050    'type' => "regexp", 
    5151    'deft' => &get_default_split_exp(), 
    52     'reqd' => "no" } 
     52    'reqd' => "no" }, 
     53       
     54      # The interesting options 
     55      { 'name' => "entry_separator", 
     56    'desc' => "{ProCitePlugin.entry_separator}", 
     57    'type' => "string", 
     58    'reqd' => "no", 
     59    'deft' => "//" }, 
    5360      ]; 
    5461 
     
    165172 
    166173    # Read the record's workform indicator and record number 
    167     $$textref =~ s/^\"([^\"]*)\",\"([^\"]*)\",//; 
     174    #$$textref =~ s/^\"([^\"]*)\",\"([^\"]*)\",//; 
     175    $$textref =~  s/^\"([^\"]*)\",//; 
    168176    my $workform_indicator = $1; 
    169     my $recordnum = $2; 
     177 
     178    # some procite files have a record number next 
     179     
     180    my $recordnum = $$textref =~ s/^\"(\d*)\",//; 
     181    $recordnum = "undefined" unless defined $recordnum; 
    170182 
    171183    # If necessary, map the workform indicator into something useful 
     
    205217        # Add the display name of the metadata field for format statement convenience 
    206218        my $field_name = $workform_values[$fieldnum]; 
    207         unless ($field_name eq "---") { 
    208         my $meta_name = "pc.Field" . ($fieldnum + 1) . "Name"; 
    209         $doc_obj->add_utf8_metadata($cursection, $meta_name, $field_name); 
     219        #unless ($field_name eq "---") { 
     220    #   my $meta_name = "pc.Field" . ($fieldnum + 1) . "Name"; 
     221    #   $doc_obj->add_utf8_metadata($cursection, $meta_name, $field_name); 
     222     #   } 
     223        if ($field_name eq "---") { 
     224        $field_name = "pc.Field" . ($fieldnum + 1); 
    210225        } 
    211  
    212226        $html_record .= "<tr><td valign=top><b>$field_name: </b></td><td valign=top>"; 
    213227 
    214228        # Multiple metadata values are separated with "//" 
    215         foreach my $field_value (split(/\/\//, $field_value_raw)) { 
    216         my $meta_name = "pc.Field" . ($fieldnum + 1) . "Value"; 
    217         $doc_obj->add_utf8_metadata($cursection, $meta_name, $field_value); 
    218  
     229        #foreach my $field_value (split(/\/\//, $field_value_raw)) { 
     230        foreach my $field_value (split($self->{'entry_separator'}, $field_value_raw)) { 
     231        #my $meta_name = "pc.Field" . ($fieldnum + 1) . "Value"; 
     232        #$doc_obj->add_utf8_metadata($cursection, $meta_name, $field_value); 
     233        $doc_obj->add_utf8_metadata($cursection, $field_name, $field_value); 
    219234        $html_record .= $field_value . "<br>"; 
    220235        }