271.xml 0000644 0000765 0000765 00000001100 11131421253 010276 0 ustar rmg3 ice
271Robert GrumbineMMABRobert.Grumbine@noaa.govA Lightweight Institutional RepositoryMMAB Technical Note 271, 6pp.2712008bibliography, cgi, uploadPublished
/mmab/papers/tn271/package.tar
addcount 0000644 0000765 0000765 00000000001 11370343156 011000 0 ustar rmg3 ice 2 addcount2 0000644 0000765 0000765 00000000001 11370343156 011062 0 ustar rmg3 ice 2 additional.pl 0000555 0000765 0000765 00000010500 11366342237 011733 0 ustar rmg3 ice #!/usr/bin/perl -w
#!/usr/bin/perl -wT
use strict;
use CGI;
use CGI::Carp qw ( fatalsToBrowser );
use File::Basename;
#This is a byte count limit on file size:
$CGI::POST_MAX = 1024 * 1024 * 15;
my $safe_filename_characters = "a-zA-Z0-9_.-";
#Note that at this point, we're using absolute path. RG
my $upload_dir = "/data/WWW/tmp/";
my $query = new CGI;
my $filename = $query->param("source");
my $title = $query->param("title");
my $additional = $query->param("additional");
my $authors = $query->param("authors");
my $affiliation = $query->param("affiliation");
my $email = $query->param("email");
my $year = $query->param("year");
my $keywords = $query->param("keywords");
my $status = $query->param("status");
my $abstract = $query->param("abstract");
if ( !$filename ) {
print $query->header ( );
print "There was a problem uploading your paper (try a smaller file).";
exit;
}
my ( $name, $path, $extension ) = fileparse ( $filename, '\..*' );
$filename = $name . $extension;
$filename =~ tr/ /_/;
$filename =~ s/[^$safe_filename_characters]//g;
if ( $filename =~ /^([$safe_filename_characters]+)$/ )
{
$filename = $1;
}
else
{
die "Filename contains invalid characters";
}
my $upload_filehandle = $query->upload("source");
open ( UPLOADFILE, ">$upload_dir/$filename" ) or die "$!";
binmode UPLOADFILE;
while ( <$upload_filehandle> )
{
print UPLOADFILE;
}
close UPLOADFILE;
print $query->header ( );
print <Thanks!
Thanks for uploading
your paper!
END_HTML
# Now make the xml file for use elsewhere:
open(addcount , '<', "/data/WWW/cgi-bin/addcount") or die
"Can't open addcount file";
open(addcount2 , '>', "/data/WWW/cgi-bin/addcount2") or die
"Can't open addcount2 file";
#addcount is the file with the pre-existing count
my $tmp = ;
$tmp += 1;
print addcount2 $tmp;
system "/bin/cp addcount2 addcount";
print "your document number ",$tmp,"\n";
my $tname=$tmp.".xml";
if ( $tname =~ /^([$safe_filename_characters]+)$/ )
{
$tname = $1;
}
else
{
die "Unsafe file name ",$tname,"\n";
}
open alpha, ">$upload_dir/$tname";
print alpha <$tmp$authors$affiliation$email$title$additional$tmp$year$keywords$status$abstract
/mmab/additional_contributions/an$tmp/$filename
END_XML
# Now that file has been uploaded and xml created, move to papers directory
system "mkdir /data/WWW/mmab/additional_contributions/an$tmp";
system "/bin/cp $upload_dir/$tname $upload_dir/$filename /data/WWW/mmab/additional_contributions/an$tmp";
#print "/bin/cp $upload_dir/$tname $upload_dir/$filename /data/WWW/mmab/additional_contributions/an$tmp";
#Finally, run update of summary index:
open beta, ">>$upload_dir/added.notes";
print beta <$tmp$authors$affiliation$email$title$additional$tmp$year$keywords$status$abstract
/mmab/additional_contributions/an$tmp/$tmp.xml
END2_XML
open addedheader, ">$upload_dir/addedheader";
print addedheader "\n";
print addedheader "\n";
print addedheader "\n";
open beta, "<$upload_dir/added.notes";
while (my $line = ) {
print addedheader $line;
}
print addedheader "\n";
#Now ready to translate header in to a new index.html
system "$upload_dir/addupdate.sh $tmp";
addupdate.sh 0000755 0000765 0000765 00000002521 11520563621 011555 0 ustar rmg3 ice #!/bin/sh
set -x
i=$1
export PATH=$PATH:/usr/local/bin/
cd /data/WWW/tmp/
export LD_LIBRARY_PATH=/usr/local/lib/:/home/rmg3/lib/
/usr/local/bin/Xalan -o /data/WWW/tmp/additional.index.html \
/data/WWW/tmp/addedheader ../mmab/papers/summary.xsl
cp ${i}.xml /data/WWW/mmab/additional_contributions/an${i}/paper.xml ; errno=$?
if [ $errno -ne 0 ] ; then
echo failed to copy paper.xml to tn directory
fi
cp /data/WWW/tmp/index.shtml /data/WWW/mmab/additional_contributions/an${i} ; errno=$?
if [ $errno -ne 0 ] ; then
echo error copying index to tn directory
exit 1
fi
if [ ! -f /data/WWW/mmab/additional_contributions/an${i}/paper.xml -o ! -f /data/WWW/mmab/images/paper.xsl ] ; then
echo missing paper.xml or paper.xsl
exit 1
fi
#echo cwd = `pwd`
#Xalan -o /data/WWW/mmab/additional_contributions/an${i}/paper.html ${i}.xml \
/usr/local/bin/Xalan ${i}.xml /data/WWW/mmab/images/paper.xsl > /data/WWW/mmab/additional_contributions/an${i}/paper.html
errno=$?
if [ $errno -eq 0 ] ; then
mv /data/WWW/tmp/additional.index.html /data/WWW/mmab/additional_contributions/additional.index.html
echo "contribution $i added" > alpha
echo mail -s "New paper uploaded" hendrik.tolman@noaa.gov robert.grumbine@noaa.gov < alpha
else
echo error $errno in translating to html , contact robert.grumbine@noaa.gov
fi
doccount 0000644 0000765 0000765 00000000003 11516133014 011007 0 ustar rmg3 ice 287 doccount2 0000644 0000765 0000765 00000000003 11516133014 011071 0 ustar rmg3 ice 287 index.html 0000644 0000765 0000765 00000003522 11101660167 011260 0 ustar rmg3 ice
repository
MMAB Repository Upload
Please list all authors in a comma-separated list:
Authors:
Author:
Affiliation:
Email:
Keywords may be anything you consider reasonable, to a total 200 character limit.
Again, please separate by commas.
Keywords:
Status is one of: draft, in review, published.
Status:
You don't need the word 'abstract' here, it's just a reminder that that's
what we want here