version 1.1, 2001/09/25 17:30:00
|
version 1.5, 2003/02/03 18:03:52
|
Line 5
|
Line 5
|
# Gets keywords from metadata database. |
# Gets keywords from metadata database. |
# |
# |
# YEAR=2001 |
# YEAR=2001 |
# 9/25 Scott Harrison |
# |
|
# YEAR=2002 |
# |
# |
|
|
############################################################################### |
############################################################################### |
Line 26
|
Line 27
|
# 1=horrible 2=poor 3=fair 4=good 5=excellent |
# 1=horrible 2=poor 3=fair 4=good 5=excellent |
# Organization 5 |
# Organization 5 |
# Functionality 4 |
# Functionality 4 |
# Has it been tested? 3 |
# Has it been tested? 4 |
# |
# |
|
|
# ------------------------------------------ Purpose and description of program |
# ------------------------------------------ Purpose and description of program |
Line 42
|
Line 43
|
# should reflect this information) instead. This is a speedier approach. |
# should reflect this information) instead. This is a speedier approach. |
|
|
# ------------------------------------------------- Modules used by this script |
# ------------------------------------------------- Modules used by this script |
|
|
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA::Configuration; |
|
|
use strict; |
use strict; |
use DBI; |
use DBI; |
|
|
Line 51 print 'Content-type: text/plain'."\n\n";
|
Line 56 print 'Content-type: text/plain'."\n\n";
|
|
|
# --- Make sure that database can be accessed and that this is a library server |
# --- Make sure that database can be accessed and that this is a library server |
# library server test |
# library server test |
my %perlvar; |
|
open (CONFIG,"/etc/httpd/conf/access.conf") || |
# By default, loncapa_apache.conf is also read by the read_conf subroutine. |
(print "Can't read access.conf\n" && exit); |
my $perlvarref=LONCAPA::Configuration::read_conf('loncapa.conf'); |
while (my $configline=<CONFIG>) { |
my %perlvar=%{$perlvarref}; |
if ($configline =~ /PerlSetVar/) { |
undef($perlvarref); |
my ($dummy,$varname,$varvalue)=split(/\s+/,$configline); |
|
chomp($varvalue); |
|
$perlvar{$varname}=$varvalue; |
|
} |
|
} |
|
close(CONFIG); |
|
unless ($perlvar{'lonRole'} eq 'library') { |
unless ($perlvar{'lonRole'} eq 'library') { |
print "This can only be run on a library server!\n"; |
print "This can only be run on a library server!\n"; |
exit; |
exit; |
Line 80 my $dbh;
|
Line 80 my $dbh;
|
} |
} |
%perlvar=(); # undefine it |
%perlvar=(); # undefine it |
|
|
print "testmsg\n"; |
|
# ------------------------ Loop through database records and print out keywords |
# ------------------------ Loop through database records and print out keywords |
my $sth=$dbh->prepare("select * from metadata"); |
my $sth=$dbh->prepare("select * from metadata"); |
$sth->execute(); |
$sth->execute(); |
my @row; |
my @row; |
while (@row=$sth->fetchrow_array) { |
while (@row=$sth->fetchrow_array) { |
print 'ROW:'.$row[4]."\n"; |
print $row[4]."\n"; |
} |
} |
|
|
# --------------------------------------------------- Close database connection |
# --------------------------------------------------- Close database connection |