[LON-CAPA-cvs] cvs: loncom /metadata_database searchcat.pl

www lon-capa-cvs@mail.lon-capa.org
Wed, 24 Dec 2003 20:41:32 -0000


www		Wed Dec 24 15:41:32 2003 EDT

  Modified files:              
    /loncom/metadata_database	searchcat.pl 
  Log:
  Setup for new table
  
  
Index: loncom/metadata_database/searchcat.pl
diff -u loncom/metadata_database/searchcat.pl:1.45 loncom/metadata_database/searchcat.pl:1.46
--- loncom/metadata_database/searchcat.pl:1.45	Wed Dec 24 14:58:37 2003
+++ loncom/metadata_database/searchcat.pl	Wed Dec 24 15:41:32 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # searchcat.pl "Search Catalog" batch script
 #
-# $Id: searchcat.pl,v 1.45 2003/12/24 19:58:37 www Exp $
+# $Id: searchcat.pl,v 1.46 2003/12/24 20:41:32 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -202,7 +202,7 @@
             $prodir.'/nohist_accesscount.db',&GDBM_READER(),0640)) {
 	my $escurl=&escape($url);
 	if (! exists($evaldata{$escurl})) {
-	    $returnhash{'count'}='Not Available';
+	    $returnhash{'count'}=0;
 	} else {
 	    $returnhash{'count'}=$evaldata{$escurl};
 	}
@@ -249,6 +249,7 @@
 	exit;
     }
 
+# Create table for static metadata, unless exists
     my $make_metadata_table = "CREATE TABLE IF NOT EXISTS metadata (".
         "title TEXT, author TEXT, subject TEXT, url TEXT, keywords TEXT, ".
         "version TEXT, notes TEXT, abstract TEXT, mime TEXT, language TEXT, ".
@@ -262,6 +263,21 @@
         "FULLTEXT idx_copyright (copyright)) TYPE=MYISAM";
     # It would sure be nice to have some logging mechanism.
     $dbh->do($make_metadata_table);
+
+# Create table for dynamic metadata, unless exists
+    my $make_dynmetadata_table = "CREATE TABLE IF NOT EXISTS dynmetadata (".
+        "url TEXT, count INTEGER UNSIGNED, ".
+        "course INTEGER UNSIGNED, course_list TEXT, ".
+        "goto INTEGER UNSIGNED, goto_list TEXT, ".
+        "comefrom INTEGER UNSIGNED, comefrom_list TEXT, ".
+        "usage INTEGER UNSIGNED, usage_list TEXT, ".
+        "stdno INTEGER UNSIGNED, stdno_list TEXT, ".
+	"avetries FLOAT, avetries_list TEXT, ".
+        "difficulty FLOAT, difficulty_list TEXT ".
+        "TYPE=MYISAM";
+    # It would sure be nice to have some logging mechanism.
+####    $dbh->do($make_dynmetadata_table);
+
 }
 
 # ------------------------------------------------------------- get .meta files