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

taceyjo1 lon-capa-cvs@mail.lon-capa.org
Thu, 05 Feb 2004 03:42:52 -0000


taceyjo1		Wed Feb  4 22:42:52 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  The bits and pieces to make it use the lond is obsolete process, should be a little faster as it does not depend on ANY meta data so long as you don't have any of the checkboxes checked.  I think, but I don't know how to profile if it's making a call to lonnet or not
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.89 loncom/interface/lonindexer.pm:1.90
--- loncom/interface/lonindexer.pm:1.89	Wed Jan 28 19:45:12 2004
+++ loncom/interface/lonindexer.pm	Wed Feb  4 22:42:52 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.89 2004/01/29 00:45:12 www Exp $
+# $Id: lonindexer.pm,v 1.90 2004/02/05 03:42:52 taceyjo1 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -164,7 +164,7 @@
 	#       selection is made.
 	# $element is the name of the element in $formname which receives
 	#       the URL.
-	# &Apache::lonxml::debug('Checking mode, form, element');
+	&Apache::lonxml::debug('Checking mode, form, element');
 	&setvalues(\%hash,'form.mode'        ,\%ENV,'form.mode'   );
 	&setvalues(\%hash,'form.form'        ,\%ENV,'form.form'   );
 	&setvalues(\%hash,'form.element'     ,\%ENV,'form.element');
@@ -187,8 +187,7 @@
 	    $element      = $ENV{'form.element'};
 	    $titleelement = $ENV{'form.titleelement'};
 	}
-	&Apache::lonxml::debug("mode=$mode form=$form element=$element
-                                titleelement=$titleelement");
+	#&Apache::lonxml::debug("mode=$mode form=$form element=$element titleelement=$titleelement");
 # ------ set catalogmodefunctions to have extra needed javascript functionality
 	my $catalogmodefunctions='';
 	if ($ENV{'form.catalogmode'} eq 'interactive' or
@@ -562,14 +561,15 @@
     my $c = $r->connection();
     my ($compuri,$curdir);
     my $dirptr=16384;
+    my $obs;
     $indent++;
-
     my %dupdirs = %dirs;
     my @list=&get_list($r,$startdir);
     foreach my $line (@list) {
         return if ($c->aborted());
-	my ($strip,$dom,undef,$testdir,undef)=split(/\&/,$line,5); 
-	next if $strip =~ /.*\.meta$/;
+	#This is a kludge, sorry aboot this
+	my ($strip,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs)=split(/\&/,$line,15); 
+	next if($strip =~ /.*\.meta$/ | $obs eq '1');
 	my (@fileparts) = split(/\./,$strip);
 	if ($hash{'display_attrs_9'} != 1) {
 	    if (scalar(@fileparts) >= 3) {
@@ -622,7 +622,8 @@
 	@list = &Apache::lonnet::dirlist($uri);
 	$hash{'dirlist_files_'.$luri} = join("\n",@list);
     }
-    return @list=&match_ext($r,@list);
+    @list=&match_ext($r,@list);
+    return @list;
 }
 
 sub initdebug {
@@ -694,7 +695,6 @@
 
     my $tabtag='</td>';
     my $i=0;
-
     while ($i<=8) {
 	$tabtag=join('',$tabtag,"<td>&nbsp;</td>")
 	    if $hash{'display_attrs_'.$i} == 1;
@@ -782,7 +782,6 @@
 # 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) {
@@ -813,8 +812,8 @@
 	}
         elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
 	    $title=$listname;
-	    $title = &Apache::lonnet::metadata($filelink,'title')
-		if ($metafile == 1);
+	    #$title = &Apache::lonnet::metadata($filelink,'title')
+		#if ($metafile == 1);
 	    $title=$listname unless $title;
 	    my $titleesc=&HTML::Entities::encode($title);
 	    $r->print("<form name='form$fnum'>\n");