Changeset 3168


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

* empty log message *

Location:
trunk/protemix
Files:
7 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/protemix/etc/collect.cfg

    r3162 r3168  
    44
    55buildtype     mgpp
    6 #indexes       text,Title,Class1,Class2,Class3
    76indexes       text,metadata
    8 #levels        Section
    9 #defaultindex  text,Title,Class1,Class2,Class3
     7levels        Section
    108defaultindex  text,metadata
    119
     10collectionmeta .text,metadata    "all"
    1211
    1312plugin        GAPlug
     
    1817classify      AZList -metadata Title
    1918
     19format CL1VList \
     20  '<p>[Title]<br><small>\[ [link]HTML</a> \]\[ <a href="_httpcollection_/index/assoc/[archivedir]/[pdf]">PDF</a> \]</small></p>'
     21
    2022format SearchVList \
    21   "<td>[link][icon][/link]</td>{If}{[srclink],<td>[srclink]_iconpdf_</a></td>}<td>{If}{[parent(All': '):Title],[parent(All': '):Title]:}[link][Title][/link]</td>"
    22 
    23 format DocumentText \
    24   "<center><table border=0 cellspacing=0 cellpadding=0 width=_pagewidth_><tr><td>[srclink]_iconpdf_ View PDF version</a></td></tr></table></center>[Text]"
     23  '<p>[parent:Title] <small><i>(page [Title])</i><br>\[ [link]HTML</a> \]\[ <a href="_httpcollection_/index/assoc/[parent:archivedir]/[pdf]">Single Page PDF</a> \]\[ <a href="_httpcollection_/index/assoc/[parent:archivedir]/[parent:pdf]">Article PDF</a> \]</small></p>'
    2524
    2625collectionmeta collectionname      "Protemix FDA Submission"
    2726collectionmeta collectionextra     ""
    2827
    29 
    30 
     28cgiarg          shortname=a argdefault=q
  • trunk/protemix/macros/base.dm

    r3162 r3168  
    3232_collectionname_ {}
    3333
    34 _imagecollection_ {_If_("_iconcollection_" ne "",
    35 <a href="_httppageabout_"><img src="_iconcollection_" border=0></a>,
    36 _imagecollectionv_}
    37 _imagecollectionv_ {_If_(_collectionname_,<br><br><h2><a href="_httppageabout_">_collectionname_</a></h2>)}
     34_imagecollection_ {<img src="_httpcollection_/images/protemixlogo.gif">}
    3835
    3936#######################################################################
     
    140137# the page.
    141138
    142 _javalinks_ {_imagehome_}
     139_javalinks_ {}
    143140
    144141
  • trunk/protemix/macros/english.dm

    r3162 r3168  
    131131_texticonexpandtext_ {Display all text}
    132132_texticoncontracttext_ {Display text only for currently selected section}
     133_texticonpagepdf_ {Display PDF file of this page}
     134_texticonartpdf_ {Display PDF file of entire article}
     135
    133136
    134137_textgoto_ {go to page}
     
    170173_httpiconenhlof_ {_httpimg_/enhlof.gif}
    171174_httpiconenhlon_ {_httpimg_/enhlon.gif}
     175
     176## "SINGLE PAGE PDF" ## document_button ## sppdf ##
     177_httpiconsppdfof_ {_httpcollection_/images/sppdfof.gif}
     178_httpiconsppdfon_ {_httpcollection_/images/sppdfon.gif}
     179
     180## "ARTICLE PDF" ## document_button ## apdf ##
     181_httpiconapdfof_ {_httpcollection_/images/apdfof.gif}
     182_httpiconapdfon_ {_httpcollection_/images/apdfon.gif}
    172183
    173184######################################################################
  • trunk/protemix/macros/query.dm

    r3162 r3168  
    2828
    2929_iconthispage_ {<img src="_httpiconhsearch_" alt="_texticonthispage_" width="_widthhsearch_" height="_heighthsearch_">}
    30 _iconthispage_ [v=1] {<h2>_texticonthispage_</h2>}
    3130
    3231_iconqueryresultsbar_ {<img src="_httpiconqryresb_" width="_widthqryresb_" height="_heightqryresb_" alt="_texticonqueryresultsbar_">}
    33 _iconqueryresultsbar_[v=1] {_texticonqueryresultsbar_}
    3432
    3533# _iconnext_ and _iconprev_ are overridden in this package as we
    3634# don't want alt text here
    3735_iconnext_{<img src="_httpiconmore_" width=_widthmore_ height=_heightmore_ border=0 align=top>}
    38 _iconnext_ [v=1] {}
    3936_iconprev_{<img src="_httpiconless_" width=_widthless_ height=_heightless_ border=0 align=top>}
    40 _iconprev_ [v=1] {}
    4137
    4238#######################################################################
     
    7571  form.c3.options.length = 0;
    7672
     73  var isselected = 0;
    7774  for (i = 0; i < options[c2].length; i++) \{
    7875    form.c3.options[i] = new Option(options[c2][i], options[c2][i]);
     76    if (options[c2][i] == "_cgiargc3_") \{
     77      form.c3.selectedIndex = i;
     78      isselected = 1;
     79    \}
    7980  \}
    80 
    81   form.c3.selectedIndex = 0;
    82 
     81  if (!isselected) form.c3.selectedIndex = 0;
    8382\}
    8483}
     
    8887}
    8988
    90 _pagetitle_ {_If_(_cgiargq_,_textquerytitle_,_textnoquerytitle_)}
     89_pagetitle_ {}
    9190
    9291_content_ {
     
    9796_queryform_
    9897</center>
    99 _If_(_cgiargq_,<center>_iconqueryresultsbar_</center><br>
    100 <small>
    101 _freqmsg_
    102 _textpostprocess_</small><br>
     98<center>_iconblankbar_</center><br>
    10399_resultline_
    104 ,<center>_iconblankbar_</center>)<br>
    105100}
    106101
     
    109104<input type=hidden name="a" value="q">
    110105<input type=hidden name="r" value="1">
     106<input type=hidden name="g" value="Section">
    111107<input type=hidden name="e" value="_decodedcompressedoptions_">
    112108<p>
     
    116112<td align="center">
    117113<select name="c1">
    118 <option value="">Any
    119 <option value="Animal">Animal
    120 <option value="Human">Human
    121 <option value="Other">Other
     114<option value=""_If_(_cgiargc1_,, selected)>Any
     115<option value="Animal"_If_("_cgiargc1_" eq "Animal", selected)>Animal
     116<option value="Human"_If_("_cgiargc1_" eq "Human", selected)>Human
     117<option value="Other"_If_("_cgiargc1_" eq "Other", selected)>Other
    122118</select>
    123119</td>
     
    129125<td align="center">
    130126<select name="c2" onChange='initialize()'>
    131 <option value="">Any
    132 <option value="Pharmacokinetics">Pharmacokinetics
    133 <option value="Pharmacodynamics">Pharmacodynamics
    134 <option value="Safety/Side Effects/Toxicity">Safety/Side Effects/Toxicity
    135 <option value="Other">Other
    136 <option value="Efficacy">Efficacy
    137 <option value="Contraindications">Contraindications
    138 <option value="Precautions">Precautions
     127<option value=""_If_(_cgiargc2_,, selected)>Any
     128<option value="Pharmacokinetics"_If_("_cgiargc2_" eq "Pharmacokinetics", selected)>Pharmacokinetics
     129<option value="Pharmacodynamics"_If_("_cgiargc2_" eq "Pharmacodynamics", selected)>Pharmacodynamics
     130<option value="Safety/Side Effects/Toxicity"_If_("_cgiargc2_" eq "Safety/Side Effects/Toxicity", selected)>Safety/Side Effects/Toxicity
     131<option value="Other"_If_("_cgiargc2_" eq "Other", selected)>Other
     132<option value="Efficacy"_If_("_cgiargc2_" eq "Efficacy", selected)>Efficacy
     133<option value="Contraindications"_If_("_cgiargc2_" eq "Contraindications", selected)>Contraindications
     134<option value="Precautions"_If_("_cgiargc2_" eq "Precautions", selected)>Precautions
    139135</select>
    140136</td>
     
    153149
    154150<tr valign="top"><td colspan="5">
     151<b>AND</b><br>
    155152<nobr>
    156153<input type="text" name="q" value="_cgiargq_" size="40">
     
    162159</form>
    163160}
     161
     162# we want to put the links to previous/next pages of results
     163# in the footer
     164_pagefooterextra_ {
     165<center>
     166<table cellspacing=0 cellpadding=0 width=_pagewidth_>
     167<tr>
     168<td align=left>_If_(_prevfirst_,<a href="_httpquery_&r=_prevfirst_">_iconprev__textmatches__prevfirst_ - _prevlast_</a>)</td>
     169<td align=right>_If_(_nextfirst_,<a href="_httpquery_&r=_nextfirst_">_textmatches__nextfirst_ - _nextlast__iconnext_</a>)</td>
     170</tr></table>
     171</center>
     172}
  • 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 ++;
  • trunk/protemix/rename.pl

    r3162 r3168  
    9797    $noncss =~ s/(<table.*?)rules=\"all\"\s+/$1/sig;
    9898
     99    # remove empty <div> tags
     100    while ($noncss =~ s/(<div[^>]*>\s*<\/div>)//sig) {}
     101
     102    # remove empty table rows
     103    $noncss =~ s/(<tr[^>]*>(\s*<td[^>]*>\s*<\/td>)*\s*<\/tr>)//sig;
     104    $noncss =~ s/<table[^>]*>\s*<\/table>//sig;
     105
    99106    open (FILE, ">$filename") || die;
    100107    print FILE $header . $noncss . $footer;
     
    108115    $filename =~ s/\s+//g;
    109116    $filename =~ s/^protemix\(\d+\)-?//;
     117    $filename =~ s/^OCR\d+-0//;
    110118
    111119    return $filename;
  • trunk/protemix/src/recpt/Makefile.in

    r3167 r3168  
    6565    $(COMPILE) $<
    6666
    67 HEADERS = ptmxqueryaction.h
     67HEADERS = ptmxqueryaction.h ptmxdocaction.h
    6868
    69 SOURCES = ptmxmain.cpp ptmxqueryaction.cpp browsetools.cpp
     69SOURCES = ptmxmain.cpp ptmxqueryaction.cpp ptmxdocaction.cpp browsetools.cpp
    7070
    71 OBJECTS = ptmxmain.o ptmxqueryaction.o browsetools.o
     71OBJECTS = ptmxmain.o ptmxqueryaction.o ptmxdocaction.o browsetools.o
    7272
    7373EXEC    = ptmx
  • trunk/protemix/src/recpt/browsetools.cpp

    r3167 r3168  
    2323 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2424 *
    25  * $Id$
    2625 *
    2726 *********************************************************************/
     
    3837              ostream &/*logout*/) {
    3938
    40   if (args["u"] != "1") {
    41    
    42     FilterResponse_t response;
    43     text_tarray metadata;
    44     text_tarray buttons;
    45    
    46     text_tarray::const_iterator here = ibuttons.begin();
    47     text_tarray::const_iterator end = ibuttons.end();
    48    
    49     while (here != end) {
    50      
    51       if (*here == "Detach")
    52     buttons.push_back ("_document:imagedetach_");
    53       else if (*here == "Highlight") {
    54     if (args["hl"] == "1")
    55       buttons.push_back ("_document:imagenohighlight_");
    56     else
    57       buttons.push_back ("_document:imagehighlight_");
    58       } else if (*here == "Expand Contents") {
    59     if (args["gc"] == "1")
    60       buttons.push_back ("_document:imagecontracttoc_");
    61     else
    62       buttons.push_back ("_document:imageexpandtoc_");
    63       } else if (*here == "Expand Text") {
    64     if (args.getintarg("gt"))
    65       buttons.push_back ("_document:imagecontracttext_");
    66     else
    67       buttons.push_back ("_document:imageexpandtext_");
    68       }
    69       here ++;
    70     }
    71    
    72     here = buttons.begin();
    73     end = buttons.end();
    74     int count = 0;
    75     while (here != end) {
    76       if ((count != 0) && ((count % 2) == 0)) textout << "<br>\n";
    77       textout << outconvert << disp << *here;
    78       count ++;
    79       here ++;
    80     }
    81   }
    82 }
    83 
     39  textout << outconvert << disp
     40      << "_document:imagepagepdf_"
     41      << "_document:imagearticlepdf_"
     42      << "_document:imagedetach_";
     43  if (args["hl"] == "1") {
     44    textout << outconvert << disp << "_document:imagenohighlight_";
     45  } else {
     46    textout << outconvert << disp << "_document:imagehighlight_";
     47  }
     48}
    8449
    8550// at the moment this just writes out the html to display
     
    765730  if ((!fulltoc) && (!args["d"].empty())) {
    766731    textout << "<center>\n";
    767     textout << outconvert << disp << "<p><table width=_pagewidth_ cellpadding=0 cellspacing=0><tr>\n";
    768     textout << "<td valign=top align=left";
    769     if (formatinfo.DocumentContents) textout << " width=200>\n";
    770     else textout << " width=100%>\n";
    771     if (formatinfo.DocumentImages)
    772       output_cover_image (args, collectproto, disp, outconvert, textout, logout);
    773     else if (formatinfo.DocumentTitles)
    774       output_titles (args, collectproto, formatinfo, disp, outconvert, textout, logout);
    775     if (args["u"] != "1") {
    776       output_controls (args, formatinfo.DocumentButtons, collectproto, disp,
    777                outconvert, textout, logout);
    778     }
    779     textout << "</td><td valign=top>\n"; 
     732    textout << outconvert << disp
     733        << "<p><table width=\"_pagewidth_\" cellpadding=\"0\" cellspacing=\"0\">\n"
     734        << "<tr valign=\"top\">\n"
     735        << "<td>\n";
     736    output_titles (args, collectproto, formatinfo, disp, outconvert, textout, logout);
     737    textout << "</td></tr>\n"
     738        << "<tr><td>\n";
    780739    havecontrols = true;
    781740  }
     
    800759  }
    801760
    802   if (havecontrols) textout << "</td></tr></table></center>\n";
    803 
    804   //if there is a format specified in the config file then
    805   //try to display the related documents (may not be displayed
    806   //if preference file does not indicate a wish to display
    807   //related documents.
    808   if (!formatinfo.RelatedDocuments.empty())
    809     output_related_docs(args, collectproto, formatinfo, disp, outconvert, textout, logout);
    810  
    811 }
    812 
     761  if (havecontrols) {
     762    textout << "</td></tr>\n"
     763        << "<tr><td>\n";
     764    output_controls (args, formatinfo.DocumentButtons, collectproto, disp,
     765             outconvert, textout, logout);
     766    textout << "</td></tr></table></center>\n";
     767  }
     768}
     769
  • trunk/protemix/src/recpt/ptmxmain.cpp

    r3167 r3168  
    4343#include "pageaction.h"
    4444#include "ptmxqueryaction.h"
    45 #include "documentaction.h"
     45#include "ptmxdocaction.h"
    4646#include "extlinkaction.h"
    4747#include "phindaction.h"
     
    8484  recpt.add_action (&aqueryaction);
    8585
    86   documentaction adocumentaction;
     86  ptmxdocaction adocumentaction;
    8787  adocumentaction.set_receptionist (&recpt);
    8888  recpt.add_action (&adocumentaction);
  • trunk/protemix/src/recpt/ptmxqueryaction.h

    r3162 r3168  
    2626
    2727
    28 #ifndef PTMXQUERYDOCACTION_H
     28#ifndef PTMXQUERYACTION_H
    2929#define PTMXQUERYACTION_H
    3030
Note: See TracChangeset for help on using the changeset viewer.