Ignore:
Timestamp:
2010-07-21T13:49:42+12:00 (14 years ago)
Author:
ak19
Message:

Added in missing routine that had forgotten to be brought over from export.pl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/inexport.pm

    r22460 r22464  
    3434use colcfg;
    3535use dbutil;
     36use doc;
    3637use plugin;
    3738use plugout;
     
    691692
    692693    # write out the archive information file
    693     $processor->close_file_output() if $groupsize > 1;
     694    $processor->close_file_output() if (defined $groupsize) && ($groupsize > 1);
    694695    $processor->close_group_output() if $processor->is_group();
    695696
     
    754755
    755756
    756 
    757 
    758 
     757sub store_collectionmeta
     758{
     759    my ($collectionmeta,$field,$doc_obj) = @_;
     760   
     761    my $section = $doc_obj->get_top_section();
     762   
     763    my $field_hash = $collectionmeta->{$field};
     764   
     765    foreach my $k (keys %$field_hash)
     766    {
     767    my $val = $field_hash->{$k};
     768   
     769    ### print STDERR "*** $k = $field_hash->{$k}\n";
     770   
     771    my $md_label = "ex.$field";
     772   
     773   
     774    if ($k =~ m/^\[l=(.*?)\]$/)
     775    {
     776       
     777        my $md_suffix = $1;
     778        $md_label .= "^$md_suffix";
     779    }
     780   
     781   
     782    $doc_obj->add_utf8_metadata($section,$md_label, $val);
     783   
     784    # see collConfigxml.pm: GS2's "collectionextra" is called "description" in GS3,
     785    # while "collectionname" in GS2 is called "name" in GS3.
     786    # Variable $nameMap variable in collConfigxml.pm maps between GS2 and GS3
     787    if (($md_label eq "ex.collectionname^en") || ($md_label eq "ex.collectionname"))
     788    {
     789        $doc_obj->add_utf8_metadata($section,"dc.Title", $val);
     790    }
     791   
     792    }
     793}
    759794
    760795
Note: See TracChangeset for help on using the changeset viewer.