Changeset 3207


Ignore:
Timestamp:
2002-07-03T12:57:49+12:00 (22 years ago)
Author:
sjboddie
Message:

* empty log message *

Location:
trunk/protemix
Files:
9 edited

Legend:

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

    r3193 r3207  
    2020plugin        WordPlug
    2121plugin        ArcPlug
    22 plugin        RecPlug
     22plugin        RecPlug -use_metadata_files
    2323
    2424classify      AZList -metadata Title
     
    2828
    2929format CL1VList \
    30   '<p>[Title]<br><small>\[ [link]text</a> \]{If}{[pdf],\\[ <a href="_httpcollection_/index/assoc/[archivedir]/[pdf]">pdf</a> \\]}</small></p>'
     30  '<p>[Title]<br><small>\[ [link]text</a> \]{If}{[pdf],\\[ <a href="_httpcollection_/index/assoc/[archivedir]/[pdf]">pdf</a> \\]}{If}{[srclink],\\[ [srclink][srcicon][/srclink] \\]}</small></p>'
    3131
    3232format SearchVList \
    33   '<p>{If}{[parent:Title],[parent:Title] <small><i>(page [Title])</i></small>,[Title]}<br><small>\[ [link]text</a> \]{If}{[pdf],\\[ <a href="_httpcollection_/index/assoc/[parent:archivedir]/[pdf]">page</a> \\]}{If}{[parent:pdf]{\\[ <a href="_httpcollection_/index/assoc/[parent:archivedir]/[parent:pdf]">article</a> \\]}</small></p>'
     33  '<p>{If}{[parent:Title],[parent:Title] <small><i>(page [Title])</i></small>,[Title]}<br><small>\[ [link]text</a> \]{If}{[pdf],\\[ <a href="_httpcollection_/index/assoc/[parent:archivedir]/[pdf]">page</a> \\]}{If}{[parent:pdf],\\[ <a href="_httpcollection_/index/assoc/[parent:archivedir]/[parent:pdf]">article</a> \\]}{If}{[srclink],\\[ [srclink][srcicon][/srclink] \\]}</small></p>'
    3434
    3535collectionmeta collectionname      "Protemix FDA Submission"
     
    3737
    3838cgiarg          shortname=a argdefault=q
    39 cgiarg          shortname=t argdefault=0
     39#cgiarg          shortname=t argdefault=0
  • trunk/protemix/macros/base.dm

    r3186 r3207  
    271271_iconclosedbook_ {<img src="_httpiconbook_" width=_widthbook_ height=_heightbook_ border=0 alt="_texticonclosedbook_">}
    272272
    273 _icondoc_ {<img border=0 align=absmiddle src="_httpiconimsword_" width=_widthimsword_ height=_heightimsword_ alt="_texticonmsword_">}
    274 
    275 _iconpdf_ {<img border=0 align=absmiddle src="_httpiconipdf_" width=_widthipdf_ height=_heightipdf_ alt="_texticonpdf_">}
     273_icondoc_ {doc}
     274
     275_iconpdf_ {pdf}
    276276
    277277#######################################################################
  • trunk/protemix/macros/query.dm

    r3177 r3207  
    118118<option value="Pharmacokinetics" _If_("_cgiargc2_" eq "Pharmacokinetics", selected)>Pharmacokinetics
    119119<option value="Pharmacodynamics" _If_("_cgiargc2_" eq "Pharmacodynamics", selected)>Pharmacodynamics
    120 <option value="Safety/Side Effects/Toxicity" _If_("_cgiargc2_" eq "Safety/Side Effects/Toxicity", selected)>Safety/Side Effects/Toxicity
     120<option value="SafetySideEffectsToxicity" _If_("_cgiargc2_" eq "Safety/Side Effects/Toxicity", selected)>Safety/Side Effects/Toxicity
    121121<option value="Other" _If_("_cgiargc2_" eq "Other", selected)>Other
    122122<option value="Efficacy" _If_("_cgiargc2_" eq "Efficacy", selected)>Efficacy
  • trunk/protemix/macros/subdocs.dm

    r3186 r3207  
    99</p>
    1010
    11 <p><a href="_httpcollection_/docs/IB/HTML/IB%20HTML.htm">Investigators Brocure</a>
    12 <br><a href="_httpcollection_/docs/IB/DOC/IB_vs3.9_31May02.doc">Investigators Brocure (Word document)</a></p>
     11<p><a href="_httpcollection_/docs/IB/HTML/IB%20HTML.htm">Investigators Brochure</a>
     12<br><a href="_httpcollection_/docs/IB/DOC/IB_vs3.9_31May02.doc">Investigators Brochure (Word document)</a></p>
    1313
    1414<p><a href="_httpcollection_/docs/Protocol/HTML/Protocol%20HTML.htm">Protocol</a>
  • trunk/protemix/perllib/plugins/ProtemixPlug.pm

    r3194 r3207  
    3232sub BEGIN {
    3333    @ISA = ('HTMLPlug');
     34    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
    3435}
    3536
     
    6869
    6970    # process the meta.xml file and set top level metadata
    70     my $parser = new XML::Parser('Style' => 'Stream');
     71    my $parser = new XML::Parser('Style' => 'Stream',
     72                 'Handlers' => {'Char' => \&Char}
     73                 );
    7174    $self->{'section_metadata'} = {};
    7275    $self->{'Page'} = "TopLevel";
     
    131134
    132135        # add any section level metadata we have for this page (set from within the meta.xml file)
    133 
    134 # currently commented out as we're not using Class1, Class2, and Class3 metadata yet
    135 #       if (defined ($self->{'section_metadata'}->{$filesuf})) {
    136 #       foreach my $key (keys %{$self->{'section_metadata'}->{$filesuf}}) {
    137 #           $doc_obj->add_utf8_metadata ($cursection, $key, $self->{'section_metadata'}->{$filesuf}->{$key});
    138 #       }
    139 #       }
     136        if (defined ($self->{'section_metadata'}->{$filesuf})) {
     137        foreach my $key (keys %{$self->{'section_metadata'}->{$filesuf}}) {
     138            $doc_obj->add_utf8_metadata ($cursection, $key, $self->{'section_metadata'}->{$filesuf}->{$key});
     139        }
     140        }
    140141
    141142        $count ++;
     
    199200}
    200201
     202# This Char function overrides the one in XML::Parser::Stream to overcome a
     203# problem where $expat->{Text} is treated as the return value, slowing
     204# things down significantly in some cases.
     205sub Char {
     206  $_[0]->{'Text'} .= $_[1];
     207  return undef;
     208}
     209
    201210
    2022111;
  • trunk/protemix/rename.pl

    r3192 r3207  
    1111use unicode;
    1212
    13 my %classifications = (
    14                'Pharmacokinetics' => ['Absorption', 'Distribution', 'Metabolism', 'Elimination',
    15                            'Effect of Food', 'Drug Interactions', 'Special Populations'],
    16                'Pharmacodynamics' => ['Trace Metal', 'Excretion', 'Selectivity', 'Copper', 'Zinc',
    17                           'Manganese', 'Iron', 'Distribution', 'Tissue', 'Brain',
    18                           'Heart', 'Plasma', 'Fetal', 'Liver', 'Kidney'],
    19                'Safety/Side Effects/Toxicity' => ['Acute Toxicity', 'Repeated Dose Toxicity',
    20                              'Studies in Rodents', 'Studies in Dogs',
    21                              'Overdosage', 'Reproductive Toxicity',
    22                              'Teratogenicity', 'Mutagenecity', 'Carcinogenicity'],
    23                'Other' => ['Superoxide Dismutase', 'Ferroxidase I', 'Ferroxidase II',
    24                    'Metallothienein', 'Ceruloplasmin'],
    25                'Efficacy' => ['Heart', 'Complications', 'Microvascular', 'Renal', 'Diabetes'],
    26                'Contraindications' => [],
    27                'Precautions' => []
    28                );
    29 
    3013my @meta_files = ();
    3114
    3215&recursive_rename("import");
     16
     17# read in log.Type.txt and log.Category.txt
     18my $classifications = &read_cat_files();
     19
    3320# process meta files
    3421foreach my $mfile (@meta_files) {
     
    149136    $metafile .= "  <Metadata name=\"Title\">$title</Metadata>\n";
    150137
    151     # currently just write some random values for classification metadata
    152     my @c1 = ('Animal', 'Human', 'Other');
    153     my $rand = int(rand 3);
    154     my $classtext = "    <Metadata name=\"Class1\">" . $c1[$rand] . "</Metadata>\n";
    155     my @c2 = ('Pharmacokinetics', 'Pharmacodynamics', 'Safety/Side Effects/Toxicity',
    156           'Other', 'Efficacy', 'Contraindications', 'Precautions');
    157     $rand = int(rand 7);
    158     my $c2val = $c2[$rand];
    159     $classtext .= "    <Metadata name=\"Class2\">$c2val</Metadata>\n";
    160     if (defined $classifications{$c2val}) {
    161     if (scalar(@{$classifications{$c2val}})) {
    162         my $numvals = scalar(@{$classifications{$c2val}});
    163         $rand = int(rand $numvals);
    164         my $c3val = $classifications{$c2val}->[$rand];
    165         $classtext .= "    <Metadata name=\"Class3\">$c3val</Metadata>\n";
    166     }
    167     } else {
    168     print STDERR "ERROR: '$c2val' not in clasifications list\n";
    169     }
    170 
    171138    my $dir = File::Basename::dirname($filename);
     139    my ($subdirs) = $dir =~ /import\/(.*)$/;
    172140
    173141    opendir(DIR, $dir) || die;
    174142    my @files = readdir DIR;
    175143    foreach my $file (@files) {
    176     if ($file =~ s/\.html?$//i) {
    177         $metafile .= "  <Page filename=\"$file\">\n$classtext  </Page>\n";
     144    if ($file =~ /\.html?$/i) {
     145        my $fstub = $file;
     146        $fstub =~ s/\.html?$//i;
     147        $metafile .= "  <Page filename=\"$fstub\">\n";
     148        if (defined ($classifications->{'type'}->{"$subdirs/$file"})) {
     149        $metafile .= "    <Metadata name=\"Class1\">" .
     150            $classifications->{'type'}->{"$subdirs/$file"} . "</Metadata>\n";
     151        } else {
     152        print STDERR "$subdirs/$file has no type metadata\n";
     153        }
     154        if (defined ($classifications->{'category'}->{"$subdirs/$file"})) {
     155        $metafile .= "    <Metadata name=\"Class2\">" .
     156            $classifications->{'category'}->{"$subdirs/$file"} . "</Metadata>\n";
     157        } else {
     158        print STDERR "$subdirs/$file has no category metadata\n";
     159        }
     160        $metafile .= "  </Page>\n";
    178161    }
    179162    }
     
    186169}
    187170
     171sub read_cat_files {
    188172
     173    my $class = {'type' => {}, 'category' => {}};
     174   
     175    open (TYPE, "import/log.Type.txt") || die;
     176    my $line = "";
     177    while (defined ($line = <TYPE>)) {
     178    my ($filename, $cat) = split(/ /, $line);
     179    chomp $cat;
     180    $filename =~ s/^.*?Protemix\(ii\)/OCR2/;
     181    $filename =~ s/^.*?Protemix\(i\)/OCR1/;
     182    $class->{'type'}->{$filename} = $cat;
     183    }
     184    close TYPE;
     185   
     186    open (CAT, "import/log.Category.txt") || die;
     187    $line = "";
     188    while (defined ($line = <CAT>)) {
     189    my ($filename, $cat) = split(/ /, $line);
     190    chomp $cat;
     191    $filename =~ s/^.*?Protemix\(ii\)/OCR2/;
     192    $filename =~ s/^.*?Protemix\(i\)/OCR1/;
     193    $class->{'category'}->{$filename} = $cat;
     194    }
     195    close CAT;
     196
     197    return $class;
     198}
  • trunk/protemix/src/recpt/browsetools.cpp

    r3186 r3207  
    4444
    4545  if (!response.docInfo[0].metadata["pdf"].values[0].empty()) {
    46     textout << outconvert << disp
    47         << "_document:imagepagepdf_"
    48         << "_document:imagearticlepdf_";
    49   }
     46    textout << outconvert << disp << "_document:imagepagepdf_";
     47  }
     48
     49  text_t top;
     50  get_top (args["d"], top);
     51  if (!get_info (top, args["c"], metadata, false, collectproto, response, logout)) return;
     52  if (!response.docInfo[0].metadata["pdf"].values[0].empty()) {
     53    textout << outconvert << disp << "_document:imagearticlepdf_";
     54  }
     55 
    5056  textout << outconvert << disp
    5157      << "_document:imagedetach_";
  • trunk/protemix/src/recpt/ptmxdocaction.cpp

    r3182 r3207  
    8787
    8888    // ------ for ptmx collection
    89 
    90     if (!args["c1"].empty() && args["c1"] != "Any") {
    91       //    formattedstring = "[" + args["c1"] + "]:CL";
    92       formattedstring = args["c1"];
    93     }
    94     if (!args["c2"].empty() && args["c2"] != "Any") {
    95       if (!formattedstring.empty()) formattedstring += " & ";
    96       //    formattedstring += "[" + args["c2"] + "]:CA";
    97       formattedstring += args["c2"];
    98     }
    99     if (!args["c3"].empty() && args["c3"] != "Any") {
    100       if (!formattedstring.empty()) formattedstring += " & ";
    101       //    formattedstring += "[" + args["c3"] + "]:CS";
    102       formattedstring += args["c3"];
    103     }
    104     if (!args["q"].empty()) {
    105       if (!formattedstring.empty()) formattedstring += " & ";
    106       formattedstring += args["q"];
    107     }
    10889
    10990    void insert_equiv_terms(text_t&); // declaration
  • trunk/protemix/src/recpt/ptmxqueryaction.cpp

    r3182 r3207  
    110110
    111111  if (!args["c1"].empty() && args["c1"] != "Any") {
    112     //    formattedstring = "[" + args["c1"] + "]:CL";
    113     formattedstring = args["c1"];
     112    formattedstring += "[" + args["c1"] + "]:CL";
    114113  }
    115114  if (!args["c2"].empty() && args["c2"] != "Any") {
    116115    if (!formattedstring.empty()) formattedstring += " & ";
    117     //    formattedstring += "[" + args["c2"] + "]:CA";
    118     formattedstring += args["c2"];
     116    formattedstring += "[" + args["c2"] + "]:CA";
    119117  }
    120118  if (!args["c3"].empty() && args["c3"] != "Any") {
     
    125123  if (!args["q"].empty()) {
    126124    if (!formattedstring.empty()) formattedstring += " & ";
    127     formattedstring += args["q"];
     125    // do synonym searching stuff
     126    text_t qstring = args["q"];
     127    int insert_equiv_terms(text_t&); // forward declaration
     128    insert_equiv_terms(qstring);
     129    formattedstring += qstring;
    128130  }
    129131
    130   // do synonym searching stuff
    131   int insert_equiv_terms(text_t&); // forward declaration
    132   insert_equiv_terms(formattedstring);
     132  outconvertclass text_t2ascii;
     133  logout << text_t2ascii << "formattedstring: " << formattedstring << "\n";
    133134
    134135  if (!formattedstring.empty()) {
Note: See TracChangeset for help on using the changeset viewer.