Diff for /loncom/interface/lonmeta.pm between versions 1.14 and 1.21

version 1.14, 2002/02/11 04:19:40 version 1.21, 2002/10/07 13:50:36
Line 44  sub dynamicmeta { Line 44  sub dynamicmeta {
     my $url=&Apache::lonnet::declutter(shift);      my $url=&Apache::lonnet::declutter(shift);
     $url=~s/\.meta$//;      $url=~s/\.meta$//;
     my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//);      my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//);
     my $regexp=&Apache::lonnet::escape($url);      my $regexp=$url;
     $regexp=~s/(\W)/\\$1/g;      $regexp=~s/(\W)/\\$1/g;
     $regexp='___'.$regexp.'___';      $regexp='___'.$regexp.'___';
     my %evaldata=&Apache::lonnet::dump      my %evaldata=&Apache::lonnet::dump('nohist_resevaldata',$adomain,
                                      ('resevaldata',$adomain,$aauthor,$regexp);         $aauthor,$regexp);
     my %sum;      my %sum;
     my %cnt;      my %cnt;
     my %listitems=('count'        => 'add',      my %listitems=('count'        => 'add',
Line 142  sub diffgraph { Line 142  sub diffgraph {
   
 sub handler {  sub handler {
   my $r=shift;    my $r=shift;
   
       my $loaderror=&Apache::lonnet::overloaderror($r);
       if ($loaderror) { return $loaderror; }
   
   
       my $uri=$r->uri;
   
       my ($resdomain,$resuser)=
              (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);
   
       $loaderror=
          &Apache::lonnet::overloaderror($r,
            &Apache::lonnet::homeserver($resuser,$resdomain));
       if ($loaderror) { return $loaderror; }
   
   my %content=();    my %content=();
   
 # ----------------------------------------------------------- Set document type  # ----------------------------------------------------------- Set document type
Line 152  sub handler { Line 167  sub handler {
   return OK if $r->header_only;    return OK if $r->header_only;
   
 # ------------------------------------------------------------------- Read file  # ------------------------------------------------------------------- Read file
   
   my $uri=$r->uri;  
   foreach (split(/\,/,&Apache::lonnet::metadata($uri,'keys'))) {    foreach (split(/\,/,&Apache::lonnet::metadata($uri,'keys'))) {
       $content{$_}=&Apache::lonnet::metadata($uri,$_);        $content{$_}=&Apache::lonnet::metadata($uri,$_);
   }    }
   
 # ------------------------------------------------------------------ Hide stuff  # ------------------------------------------------------------------ Hide stuff
   
   unless ($ENV{'user.adv'}) {    unless ($ENV{'user.adv'}) {
Line 167  sub handler { Line 179  sub handler {
   }    }
   
 # --------------------------------------------------------------- Render Output  # --------------------------------------------------------------- Render Output
     my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta/);
 my $creationdate=localtime($content{'creationdate'});  my $creationdate=localtime($content{'creationdate'});
 my $lastrevisiondate=localtime($content{'lastrevisiondate'});  my $lastrevisiondate=localtime($content{'lastrevisiondate'});
 my $language=&Apache::loncommon::languagedescription($content{'language'});  my $language=&Apache::loncommon::languagedescription($content{'language'});
 my $mime=&Apache::loncommon::filedescription($content{'mime'});   my $mime=&Apache::loncommon::filedescription($content{'mime'}); 
 my $disuri=&Apache::lonnet::declutter($uri);  my $disuri=&Apache::lonnet::declutter($uri);
   $disuri=~s/\.meta$//;    $disuri=~s/\.meta$//;
   my $currentversion=&Apache::lonnet::getversion($disuri);
   my $versiondisplay='';
   if ($thisversion) {
       $versiondisplay='Version: '.$thisversion.
       ' (most recent version: '.$currentversion.')';
   } else {
       $versiondisplay='Version: '.$currentversion;
   }
   my $bodytag=&Apache::loncommon::bodytag
               ('Catalog Information','','','',$resdomain);
   $r->print(<<ENDHEAD);    $r->print(<<ENDHEAD);
 <html><head><title>Catalog Information</title></head>  <html><head><title>Catalog Information</title></head>
 <body bgcolor="#FFFFFF">  $bodytag
 <h1>Catalog Information</h1>  
 <h2>$content{'title'}</h2>  <h2>$content{'title'}</h2>
 <h3><tt>$disuri</tt></h3>  <h3><tt>$disuri</tt></h3>
   $versiondisplay<br />
 <table cellspacing=2 border=0>  <table cellspacing=2 border=0>
 <tr><td bgcolor='#AAAAAA'>Author(s)</td>  <tr><td bgcolor='#AAAAAA'>Author(s)</td>
 <td bgcolor="#CCCCCC">$content{'author'}&nbsp;</td></tr>  <td bgcolor="#CCCCCC">$content{'author'}&nbsp;</td></tr>
Line 219  ENDHEAD Line 241  ENDHEAD
   delete($content{'copyright'});    delete($content{'copyright'});
   if ($ENV{'user.adv'}) {    if ($ENV{'user.adv'}) {
 # ------------------------------------------------------------ Dynamic Metadata  # ------------------------------------------------------------ Dynamic Metadata
    $r->print('<h3>Dynamic Metadata (updated periodically)</h3>');     $r->print(
      '<h3>Dynamic Metadata (updated periodically)</h3>Processing ...<br>');
      $r->rflush();
     my %items=(      my %items=(
  'count'      => 'Network-wide number of accesses (hits)',   'count'      => 'Network-wide number of accesses (hits)',
  'course'     => 'Network-wide number of courses using resource',   'course'     => 'Network-wide number of courses using resource',

Removed from v.1.14  
changed lines
  Added in v.1.21


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>