Ignore:
Timestamp:
2002-06-23T22:58:30+12:00 (22 years ago)
Author:
sjboddie
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/protemix/perllib/plugins/ProtemixPlug.pm

    r3162 r3168  
    7575    }
    7676
    77     # read in directory and process individual files
    7877    my $dir = File::Basename::dirname($filename);
    7978
     79    # associate article level pdf file
     80    my ($pdffile) = $dir =~ /([^\/\\]+)$/;
     81    $pdffile = &util::filename_cat($dir, $pdffile);
     82    $pdffile .= "-all.pdf";
     83    die "$pdffile does not exist" unless -e $pdffile;
     84    $doc_obj->associate_file($pdffile, "article.pdf", undef, $topsection);
     85    $doc_obj->add_utf8_metadata ($cursection, "pdf",  "article.pdf");
     86
     87    # read in directory and process individual files
    8088    opendir(DIR, $dir) || die;
    8189    my @files = readdir DIR;
     
    103111        $self->process_section (\$text, '', $thisfile, $doc_obj, $cursection);
    104112
    105         # associate PDF file with doc object
     113        # associate PDF page level pdf file
    106114        my $pdffile = $thisfile;
    107115        $pdffile =~ s/\.html?$/\.pdf/;
    108116        die "no PDF file for $thisfile" unless -e $pdffile;
    109         $doc_obj->associate_file($pdffile, "doc$count.pdf", undef, $cursection);
    110         my $doclink = "<a href=\"_httpcollection_/index/assoc/[parent(Top):archivedir]/doc$count.pdf\">";
    111 #       $doc_obj->add_utf8_metadata ($cursection, "srclink",  $doclink);
     117        $doc_obj->associate_file($pdffile, "page$count.pdf", undef, $cursection);
     118        $doc_obj->add_utf8_metadata ($cursection, "pdf",  "page$count.pdf");
    112119        $doc_obj->add_utf8_metadata ($cursection, "Title", $count);
    113120
    114121        # add any section level metadata we have for this page (set from within the meta.xml file)
    115 #       if (defined ($self->{'section_metadata'}->{$filesuf})) {
    116 #       foreach my $key (keys %{$self->{'section_metadata'}->{$filesuf}}) {
    117 #           $doc_obj->add_utf8_metadata ($cursection, $key, $self->{'section_metadata'}->{$filesuf}->{$key});
    118 #       }
    119 #       }
     122        if (defined ($self->{'section_metadata'}->{$filesuf})) {
     123        foreach my $key (keys %{$self->{'section_metadata'}->{$filesuf}}) {
     124            $doc_obj->add_utf8_metadata ($cursection, $key, $self->{'section_metadata'}->{$filesuf}->{$key});
     125        }
     126        }
    120127
    121128        $count ++;
Note: See TracChangeset for help on using the changeset viewer.