[LON-CAPA-cvs] cvs: nsdl / lonsql

www lon-capa-cvs@mail.lon-capa.org
Tue, 29 Nov 2005 21:02:53 -0000


www		Tue Nov 29 16:02:53 2005 EDT

  Modified files:              
    /nsdl	lonsql 
  Log:
  Include dates for NSDL
  
  
Index: nsdl/lonsql
diff -u nsdl/lonsql:1.9 nsdl/lonsql:1.10
--- nsdl/lonsql:1.9	Tue Nov 29 15:02:23 2005
+++ nsdl/lonsql	Tue Nov 29 16:02:52 2005
@@ -3,7 +3,7 @@
 # The LearningOnline Network
 # lonsql - LON TCP-NSDL Query Handler.
 #
-# $Id: lonsql,v 1.9 2005/11/29 20:02:23 www Exp $
+# $Id: lonsql,v 1.10 2005/11/29 21:02:52 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -832,13 +832,25 @@
                 if ($url) {
                    my ($mime)=($url=~/\.(\w+)$/);
                    $mime=~tr/A-Z/a-z/;
+		   my $createdate=$result{'dc:date'};
+		   if ($createdate) {
+		       unless ($createdate=~/\:\d+$/) {
+			   $createdate.=' 00:00:00';
+		       }
+		   }
+		   unless ($createdate=~/^\d+\-\d+\-\d+\s+\d+\:\d+\:\d+$/) {
+		       $createdate='';
+		   }
+                   $createdate=&escape($createdate);
+
                    $allresults.='&'.
                     &escape($result{'dc:title'}).','.
                     &escape($result{'dc:creator'}).','.
                     &escape($result{'dc:subject'}).','.
                     &escape($url).',,,,'.
                     &escape($result{'dc:description'}).','.
-                    &escape($mime).',seniso,,,,public,nsdl,,,,,,,,,,,,,,,,,,,,,,,,,,,,';
+                    &escape($mime).',seniso,'.$createdate.','.$createdate.','.&escape('public@nsdl').
+		    ',public,nsdl,,,,,,,,,,,,,,,,,,,,,,,,,,,,';
                 }
                 %result=();
 	    } elsif ($token->[1]=~/^dc\:/) {