Changeset 1554


Ignore:
Timestamp:
2000-09-20T14:54:05+12:00 (24 years ago)
Author:
sjboddie
Message:

* empty log message *

Location:
trunk/niupepa/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/niupepa/perllib/plugins/AbstractPlug.pm

    r1551 r1554  
    7373
    7474    # process each issue
    75     $$textref =~ s/(<p(?:\s[^>]*)?>\s*\n
    76             [^\n]+\n # series title line
    77             <\/p>\n
    78             <p(?:\s[^>]*)?>\s*\n
    79             <b>(.*?)<\/b>.*?\n # issue line (i.e. volume, issue number, date)
    80             <\/p>\n
    81             (?:<table[^>]*>.*?<\/table>)?) # the table itself (may not always be defined)
     75    $$textref =~ s/<p(?:\s[^>]*)?>\s*\n
     76           [^\n]+\n # series title line
     77           <\/p>\n
     78           <p(?:\s[^>]*)?>\s*\n
     79           <b>(.*?)<\/b>.*?\n # issue line (i.e. volume, issue number, date)
     80           <\/p>\n
     81           (<table[^>]*>.*?<\/table>)? # the table itself (may not always be defined)
    8282              /$self->process_issue($1, $2, $seriesnum, $dir)/isgxe;
    8383}
     
    8585sub process_issue {
    8686    my $self = shift @_;
    87     my ($text, $issue, $seriesnum, $dir) = @_;
     87    my ($issue, $text, $seriesnum, $dir) = @_;
    8888
    8989    my $OID = $seriesnum . "_";
     
    108108    }
    109109
    110     # links to page numbers
    111     $text =~ s/(td(?:\s[^>]*)?>\s*\n
    112         <p(?:\s[^>]*)?>\s*\n)
    113             (pp?\s*\.\s*(\d+)(?:-\d+)?)(\s*\n)
    114           /$1<a href=\"_httpdocument_&cl=_cgiargcl_&d=${OID}\.$3\">$2<\/a>$4/isgx;
    115 
    116110    my $abfile = &util::filename_cat ($dir, "$OID.abstract");
    117111    open (ABFILE, ">$abfile") || die;
    118     print ABFILE $text;
     112
     113    # links to page numbers
     114    if (defined $text) {
     115    $text =~ s/(td(?:\s[^>]*)?>\s*\n
     116           <p(?:\s[^>]*)?>\s*\n)
     117               (pp?\s*\.\s*(\d+)(?:-\d+)?)(\s*\n)
     118          /$1<a href=\"_httpdocument_&cl=_cgiargcl_&d=${OID}\.$3&gg=prev\">$2<\/a>$4/isgx;
     119
     120        print ABFILE $text;
     121    } else {
     122    # some don't have any abstract information - we'll just use
     123    # the issue line to prevent a completely empty page
     124        print ABFILE $issue;
     125    }
    119126    close ABFILE;
    120127}
     
    129136    $$textref =~ s/\s*?(row|col)span=\"1\"//igs; # rowspan|colspan=1 don't seem real useful
    130137    $$textref =~ s/\s*?line\-height:[^;]+;//igs; # don't really want hard-coded line heights either
     138    $$textref =~ s/(<td)/$1 valign=top/igs; # like to valign tables
    131139
    132140    # convert macron characters to _amn_ type macros
  • trunk/niupepa/perllib/plugins/NPPlug.pm

    r1043 r1554  
    198198    my $doc_obj = new doc ($file, "indexed_doc");
    199199    my $topsection = $doc_obj->get_top_section();
    200     my $cursection = $topsection;
    201200    $self->associate_cover_images ($doc_obj, $dir, $issuekey);
    202201    $doc_obj->set_metadata_element ($topsection, 'Title', $self->get_title_string($file));
     
    216215        $line =~ s/^\s+//;
    217216        $line =~ s/\s+$//;
    218         $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection));
    219217        my ($pagenum) = $line =~ /(\d+)$/;
    220         $doc_obj->set_metadata_element($cursection, 'Title', $pagenum);
    221         $self->process_text ($dir, $line, $doc_obj, $cursection);
    222         $self->process_images ($dir, $line, $doc_obj, $cursection);
     218        $doc_obj->create_named_section($pagenum);
     219        $doc_obj->set_metadata_element($pagenum, 'Title', $pagenum);
     220        $self->process_text ($dir, $line, $doc_obj, $pagenum);
     221        $self->process_images ($dir, $line, $doc_obj, $pagenum);
    223222    }
    224223    }
     
    289288    my $cursection = $doc_obj->get_top_section();
    290289    $self->associate_cover_images ($doc_obj, $dir, $issuekey);
    291     $doc_obj->set_metadata_element ($cursection, 'Title', "_abstract_ " .
    292                     $self->get_title_string($file));
     290    $doc_obj->set_metadata_element ($cursection, 'Title', $self->get_title_string($file));
    293291    $self->set_main_metadata ($doc_obj, $dir);
    294292    map { $doc_obj->set_metadata_element ($cursection, $_, $meta->{$_}); } keys %$meta;
     
    416414    $title .= "_vol_ $vol" if defined $vol && $vol =~ /\w/;
    417415    if (defined $num && $num =~ /\w/) {
    418     $title .= ": " if defined $vol && $vol =~ /\w/;
     416    $title .= ", " if defined $vol && $vol =~ /\w/;
    419417    $title .= "_num_ $num";
    420418    }
Note: See TracChangeset for help on using the changeset viewer.