[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 16 Sep 2003 22:00:25 -0000


albertel		Tue Sep 16 18:00:25 2003 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  - now uses ssi to get the metadata,  stops some breakage that was occuring due to not going through the lonhomework.pm handler
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.132 loncom/publisher/lonpublisher.pm:1.133
--- loncom/publisher/lonpublisher.pm:1.132	Tue Sep 16 17:30:28 2003
+++ loncom/publisher/lonpublisher.pm	Tue Sep 16 18:00:25 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.132 2003/09/16 21:30:28 albertel Exp $
+# $Id: lonpublisher.pm,v 1.133 2003/09/16 22:00:25 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -974,11 +974,12 @@
 
 # -------------------------------------------------- Parse content for metadata
     if (($style eq 'ssi') || ($style eq 'prv')) {
-        my $oldenv=$ENV{'request.uri'};
-
-        $ENV{'request.uri'}=$target;
-        $allmeta=Apache::lonxml::xmlparse(undef,'meta',$content);
-        $ENV{'request.uri'}=$oldenv;
+	my $dir=$source;
+	$dir=~s-/[^/]*$--;
+	my $file=$source;
+	$file=(split('/',$file))[-1];
+        $source=&Apache::lonnet::hreflocation($dir,$file);
+	$allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta'));
 
         &metaeval($allmeta);
     }