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

www lon-capa-cvs@mail.lon-capa.org
Fri, 26 Sep 2003 00:23:09 -0000


This is a MIME encoded message

--www1064535789
Content-Type: text/plain

www		Thu Sep 25 20:23:09 2003 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
    /loncom/metadata_database	searchcat.pl 
  Log:
  Start to respect "obsolete"
  
  
--www1064535789
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20030925202309.txt"

Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.76 loncom/interface/lonindexer.pm:1.77
--- loncom/interface/lonindexer.pm:1.76	Mon Sep 22 20:26:10 2003
+++ loncom/interface/lonindexer.pm	Thu Sep 25 20:23:09 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.76 2003/09/23 00:26:10 www Exp $
+# $Id: lonindexer.pm,v 1.77 2003/09/26 00:23:09 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -64,6 +64,7 @@
 use Apache::Constants qw(:common);
 use Apache::lonmeta;
 use Apache::File;
+use Apache::lonlocal;
 use GDBM_File;
 
 # ---------------------------------------- variables used throughout the module
@@ -149,8 +150,9 @@
 		'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.
 		' border="0" /></td>';
 	    $colspan=" colspan='2' ";
+            my $cl=&mt('Close');
             $closebutton=<<END;
-<input type="button" name="close" value='CLOSE' onClick="self.close()">
+<input type="button" name="close" value='$cl' onClick="self.close()">
 END
         }
 	elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
@@ -158,11 +160,13 @@
 		'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.
 		' border="0" /></td>';
 	    $colspan=" colspan='2' ";
+	    my $cl=&mt('Close');
+            my $gi=&mt('Group Import');
             $closebutton=<<END;
-<input type="button" name="close" value='CLOSE' onClick="self.close()">
+<input type="button" name="close" value='$cl' onClick="self.close()">
 END
             $groupimportbutton=<<END;
-<input type="button" name="groupimport" value='GROUP IMPORT'
+<input type="button" name="groupimport" value='$gi'
 onClick="javascript:select_group()">
 END
         }
@@ -399,26 +403,40 @@
 # ------------------------------- output state of file attributes to be showing
 #                                 All versions has to the last item
 #                                 since it does not take an extra col
+	my %lt=&Apache::lonlocal::texthash(
+					   'ti' => 'Title',
+					   'si' => 'Size',
+					   'la' => 'Last access',
+					   'lm' => 'Last modified',
+					   'st' => 'Statistics',
+					   'au' => 'Author',
+					   'kw' => 'Keywords',
+					   'la' => 'Language',
+					   'sr' => 'Show resource',
+					   'av' => 'All versions',
+					   'ud' => 'Update Display'
+					   );
 	$r->print(<<END);
 <form method="post" name="fileattr" action="$uri"
  enctype="application/x-www-form-urlencoded">
 <b><font color="#666666">Display file attributes</font></b><br />
 <table border=0><tr>
-<td><input type="checkbox" name="attr0" value="1" $attrchk[0] /> Title</td>
-<td><input type="checkbox" name="attr1" value="1" $attrchk[1] /> Size</td>
-<td><input type="checkbox" name="attr2" value="1" $attrchk[2] /> Last access</td>
-<td><input type="checkbox" name="attr3" value="1" $attrchk[3] /> Last modified</td>
-<td><input type="checkbox" name="attr8" value="1" $attrchk[8] /> Statistics</td></tr><tr>
-<td><input type="checkbox" name="attr4" value="1" $attrchk[4] /> Author</td>
-<td><input type="checkbox" name="attr5" value="1" $attrchk[5] /> Keywords</td>
-<td><input type="checkbox" name="attr6" value="1" $attrchk[6] /> Language</td>
-<td><input type="checkbox" name="attr7" value="1" $attrchk[7] /> Show Resource</td>
-<td><input type="checkbox" name="attr9" value="1" $attrchk[9] /> All versions</td>
+<td><input type="checkbox" name="attr0" value="1" $attrchk[0] /> $lt{'ti'}</td>
+<td><input type="checkbox" name="attr1" value="1" $attrchk[1] /> $lt{'si'}</td>
+<td><input type="checkbox" name="attr2" value="1" $attrchk[2] /> $lt{'la'}</td>
+<td><input type="checkbox" name="attr3" value="1" $attrchk[3] /> $lt{'lm'}</td>
+<td><input type="checkbox" name="attr8" value="1" $attrchk[8] /> $lt{'st'}</td>
+</tr><tr>
+<td><input type="checkbox" name="attr4" value="1" $attrchk[4] /> $lt{'au'}</td>
+<td><input type="checkbox" name="attr5" value="1" $attrchk[5] /> $lt{'kw'}</td>
+<td><input type="checkbox" name="attr6" value="1" $attrchk[6] /> $lt{'la'}</td>
+<td><input type="checkbox" name="attr7" value="1" $attrchk[7] /> $lt{'sr'}</td>
+<td><input type="checkbox" name="attr9" value="1" $attrchk[9] /> $lt{'av'}</td>
 <td>&nbsp;</td>
 </tr></table>
 <input type="hidden" name="dirPointer" value="on" />
 <input type="hidden" name="acts" value="" />
-<input type="submit" name="attrs" value="Update Display" />
+<input type="submit" name="attrs" value="$lt{'ud'}" />
 $closebutton
 $groupimportbutton
 </form>
@@ -431,24 +449,25 @@
 #        $r->print(&writedebug("Only:@Only")) if (@Only);
         $r->print("<table width='100\%' border=0><tr><td bgcolor=#777777>\n");
 	$r->print("<table width='100\%' border=0><tr bgcolor=$titleclr>\n");
-	$r->print("<td $colspan><b>Name</b></td>\n");
-	$r->print("<td><b>Title</b></td>\n") 
+	$r->print("<td $colspan><b>".&mt('Name')."</b></td>\n");
+	$r->print("<td><b>".&mt('Title')."</b></td>\n") 
 	    if ($hash{'display_attrs_0'} == 1);
-	$r->print("<td align=right><b>Size (bytes) ".
+	$r->print("<td align=right><b>".&mt("Size")." (".&mt("bytes").") ".
 		  "</b></td>\n") if ($hash{'display_attrs_1'} == 1);
-	$r->print("<td><b>Last accessed</b></td>\n") 
+	$r->print("<td><b>".&mt("Last accessed")."</b></td>\n") 
 	    if ($hash{'display_attrs_2'} == 1);
-	$r->print("<td><b>Last modified</b></td>\n")
+	$r->print("<td><b>".&mt("Last modified")."</b></td>\n")
 	    if ($hash{'display_attrs_3'} == 1);
-	$r->print("<td><b>Author(s)</b></td>\n")
+	$r->print("<td><b>".&mt("Author(s)")."</b></td>\n")
 	    if ($hash{'display_attrs_4'} == 1);
-	$r->print("<td><b>Keywords</b></td>\n")
+	$r->print("<td><b>".&mt("Keywords")."</b></td>\n")
 	    if ($hash{'display_attrs_5'} == 1);
-	$r->print("<td><b>Language</b></td>\n")
+	$r->print("<td><b>".&mt("Language")."</b></td>\n")
 	    if ($hash{'display_attrs_6'} == 1);
-	$r->print("<td><b>Resource</b></td>\n")
+	$r->print("<td><b>".&mt("Resource")."</b></td>\n")
 	    if ($hash{'display_attrs_7'} == 1);
-	$r->print("<td><b>Usage Statistics <br />(Courses/Network Hits)</b></td>\n")
+	$r->print("<td><b>".&mt("Usage Statistics")." <br />(".
+		  &mt("Courses/Network Hits").")</b></td>\n")
 	    if ($hash{'display_attrs_8'} == 1);
 	$r->print('</tr>');
 
@@ -586,7 +605,7 @@
     my @list;
     (my $luri = $uri) =~ s/\//_/g;
 
-    if ($ENV{'form.attrs'} eq 'Update Display') {
+    if ($ENV{'form.attrs'} eq &mt('Update Display')) {
 	foreach (keys %hash) {
 	    delete $hash{$_} if ($_ =~ /^dirlist_files_/);
 	    }
@@ -665,8 +684,8 @@
     my @pathcom = split (/\//,$filecom[0]);
     my $listname = $pathcom[scalar(@pathcom)-1];
     my $fnptr = $filecom[3]&$dirptr;
-    my $msg = 'View '.$filecom[0].' resources';
-    $msg = 'Close '.$filecom[0].' directory' if $diropen eq 'opened';
+    my $msg = &mt('View').' '.$filecom[0].' '.&mt('resources');
+    $msg = &mt('Close').' '.$filecom[0].' '.&mt('directory') if $diropen eq 'opened';
 
     my $tabtag='</td>';
     my $i=0;
@@ -695,7 +714,7 @@
 	$r->print ('<input src="'.$iconpath.'arrow_up.gif"');
 	$r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
 		   "\n");
-	$r->print("Up $tabtag</tr></form>\n");
+	$r->print(&mt("Up")." $tabtag</tr></form>\n");
 	return OK;
     }
 # Do we have permission to look at this?
@@ -720,7 +739,7 @@
 	$r->print ('<a href="javascript:gothere(\''.$filecom[0].
 		   '\')"><img src="'.$iconpath.'server.gif"');
 	$r->print (' border="0" /></a>'."\n");
-	$r->print ("Domain - $listname ");
+	$r->print (&mt("Domain")." - $listname ");
 	if ($Apache::lonnet::domaindescription{$listname}) {
 	    $r->print("(".$Apache::lonnet::domaindescription{$listname}.
 		      ")");
@@ -758,6 +777,7 @@
 # display file
     if ($fnptr == 0 and $filecom[3] ne '') {
 	my $filelink = $startdir.$filecom[0];
+	next if &Apache::lonnet::metadata($filelink,'obsolete');
 	my @file_ext = split (/\./,$listname);
 	my $curfext = $file_ext[-1];
         if (@Omit) {
Index: loncom/metadata_database/searchcat.pl
diff -u loncom/metadata_database/searchcat.pl:1.39 loncom/metadata_database/searchcat.pl:1.40
--- loncom/metadata_database/searchcat.pl:1.39	Wed Aug 20 21:48:22 2003
+++ loncom/metadata_database/searchcat.pl	Thu Sep 25 20:23:09 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # searchcat.pl "Search Catalog" batch script
 #
-# $Id: searchcat.pl,v 1.39 2003/08/21 01:48:22 www Exp $
+# $Id: searchcat.pl,v 1.40 2003/09/26 00:23:09 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -307,6 +307,8 @@
     foreach my $m (@metalist) {
         print LOG "- ".$m."\n";
         my $ref=&metadata($m);
+ 	if ($ref->{'obsolete'}) { print LOG "obsolete\n"; next; }
+	if ($ref->{'copyright'} eq 'private') { print LOG "private\n"; next; }
         my $m2='/res/'.&declutter($m);
         $m2=~s/\.meta$//;
 #        &dynamicmeta($m2);

--www1064535789--