public xml file available from database, one doc or all docs,

by name or by doc_id
This commit is contained in:
david 2002-01-23 03:48:39 +00:00
parent 13edbf283c
commit e8cd38f361
2 changed files with 58 additions and 0 deletions

15
LDP/lampadas/www/ldp-xml.pl Executable file
View File

@ -0,0 +1,15 @@
#! /usr/bin/perl
use CGI qw(:standard);
use Pg;
$query = new CGI;
# Read parameters
$name = param('name');
print "Content-Type: text/plain; charset=ISO-8859-1\n\n";
$cmd = "/home/david/ldp/cvs/LDP/database/xml.pl -n $name";
system("$cmd");

43
LDP/lampadas/www/name-to-url.pl Executable file
View File

@ -0,0 +1,43 @@
#! /usr/bin/perl
use CGI qw(:standard);
use Pg;
$query = new CGI;
$dbmain = "ldp";
@row;
# Read parameters
$name = param('name');
$name = uc($name);
$conn=Pg::connectdb("dbname=$dbmain");
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;
$result = $conn->exec("SELECT url FROM document WHERE UPPER(filename)='$name' AND pub_status='N'");
die $conn->errorMessage unless PGRES_TUPLES_OK eq $result->resultStatus;
@row = $result->fetchrow;
$url = $row[0];
print "Content-Type: text/plain; charset=ISO-8859-1\n\n";
if ($url eq '') {
print "ERROR: did not find $name";
} else {
print $url;
}
exit;
print header(-expires=>'now');
print "<html><head><title>$title</title>";
print "<body>";
if ($url eq '') {
print "ERROR: did not find $name";
} else {
print $url;
}
print "</body></html>";