- Timestamp:
- 2002-07-03T12:57:49+12:00 (22 years ago)
- Location:
- trunk/protemix
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/protemix/etc/collect.cfg
r3193 r3207 20 20 plugin WordPlug 21 21 plugin ArcPlug 22 plugin RecPlug 22 plugin RecPlug -use_metadata_files 23 23 24 24 classify AZList -metadata Title … … 28 28 29 29 format 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>' 31 31 32 32 format 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>' 34 34 35 35 collectionmeta collectionname "Protemix FDA Submission" … … 37 37 38 38 cgiarg shortname=a argdefault=q 39 cgiarg shortname=t argdefault=039 #cgiarg shortname=t argdefault=0 -
trunk/protemix/macros/base.dm
r3186 r3207 271 271 _iconclosedbook_ {<img src="_httpiconbook_" width=_widthbook_ height=_heightbook_ border=0 alt="_texticonclosedbook_">} 272 272 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} 276 276 277 277 ####################################################################### -
trunk/protemix/macros/query.dm
r3177 r3207 118 118 <option value="Pharmacokinetics" _If_("_cgiargc2_" eq "Pharmacokinetics", selected)>Pharmacokinetics 119 119 <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/Toxicity120 <option value="SafetySideEffectsToxicity" _If_("_cgiargc2_" eq "Safety/Side Effects/Toxicity", selected)>Safety/Side Effects/Toxicity 121 121 <option value="Other" _If_("_cgiargc2_" eq "Other", selected)>Other 122 122 <option value="Efficacy" _If_("_cgiargc2_" eq "Efficacy", selected)>Efficacy -
trunk/protemix/macros/subdocs.dm
r3186 r3207 9 9 </p> 10 10 11 <p><a href="_httpcollection_/docs/IB/HTML/IB%20HTML.htm">Investigators Broc ure</a>12 <br><a href="_httpcollection_/docs/IB/DOC/IB_vs3.9_31May02.doc">Investigators Broc ure (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> 13 13 14 14 <p><a href="_httpcollection_/docs/Protocol/HTML/Protocol%20HTML.htm">Protocol</a> -
trunk/protemix/perllib/plugins/ProtemixPlug.pm
r3194 r3207 32 32 sub BEGIN { 33 33 @ISA = ('HTMLPlug'); 34 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 34 35 } 35 36 … … 68 69 69 70 # 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 ); 71 74 $self->{'section_metadata'} = {}; 72 75 $self->{'Page'} = "TopLevel"; … … 131 134 132 135 # 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 } 140 141 141 142 $count ++; … … 199 200 } 200 201 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. 205 sub Char { 206 $_[0]->{'Text'} .= $_[1]; 207 return undef; 208 } 209 201 210 202 211 1; -
trunk/protemix/rename.pl
r3192 r3207 11 11 use unicode; 12 12 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 30 13 my @meta_files = (); 31 14 32 15 &recursive_rename("import"); 16 17 # read in log.Type.txt and log.Category.txt 18 my $classifications = &read_cat_files(); 19 33 20 # process meta files 34 21 foreach my $mfile (@meta_files) { … … 149 136 $metafile .= " <Metadata name=\"Title\">$title</Metadata>\n"; 150 137 151 # currently just write some random values for classification metadata152 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 171 138 my $dir = File::Basename::dirname($filename); 139 my ($subdirs) = $dir =~ /import\/(.*)$/; 172 140 173 141 opendir(DIR, $dir) || die; 174 142 my @files = readdir DIR; 175 143 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"; 178 161 } 179 162 } … … 186 169 } 187 170 171 sub read_cat_files { 188 172 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 44 44 45 45 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 50 56 textout << outconvert << disp 51 57 << "_document:imagedetach_"; -
trunk/protemix/src/recpt/ptmxdocaction.cpp
r3182 r3207 87 87 88 88 // ------ 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 }108 89 109 90 void insert_equiv_terms(text_t&); // declaration -
trunk/protemix/src/recpt/ptmxqueryaction.cpp
r3182 r3207 110 110 111 111 if (!args["c1"].empty() && args["c1"] != "Any") { 112 // formattedstring = "[" + args["c1"] + "]:CL"; 113 formattedstring = args["c1"]; 112 formattedstring += "[" + args["c1"] + "]:CL"; 114 113 } 115 114 if (!args["c2"].empty() && args["c2"] != "Any") { 116 115 if (!formattedstring.empty()) formattedstring += " & "; 117 // formattedstring += "[" + args["c2"] + "]:CA"; 118 formattedstring += args["c2"]; 116 formattedstring += "[" + args["c2"] + "]:CA"; 119 117 } 120 118 if (!args["c3"].empty() && args["c3"] != "Any") { … … 125 123 if (!args["q"].empty()) { 126 124 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; 128 130 } 129 131 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"; 133 134 134 135 if (!formattedstring.empty()) {
Note:
See TracChangeset
for help on using the changeset viewer.