Diff for /loncom/publisher/lonpublisher.pm between versions 1.100 and 1.101

version 1.100, 2002/10/07 21:07:08 version 1.101, 2002/10/08 13:24:36
Line 309  sub sqltime { Line 309  sub sqltime {
 #########################################  #########################################
 #########################################  #########################################
   
   sub coursedependencies {
       my $url=&Apache::lonnet::declutter(shift);
       $url=~s/\.meta$//;
       my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//);
       my $regexp=$url;
       $regexp=~s/(\W)/\\$1/g;
       $regexp='___'.$regexp.'___course';
       my %evaldata=&Apache::lonnet::dump('nohist_resevaldata',$adomain,
          $aauthor,$regexp);
       my %courses=();
       foreach (keys %evaldata) {
    if ($_=~/^([a-zA-Z0-9]+_[a-zA-Z0-9]+)___.+___course$/) {
       $courses{$1}=1;
           }
       }
       return %courses;
   }
   #########################################
   #########################################
   
   
 =pod  =pod
   
 =item Form-field-generating subroutines.  =item Form-field-generating subroutines.
Line 492  sub get_subscribed_hosts { Line 513  sub get_subscribed_hosts {
     } else {      } else {
  &Apache::lonnet::logthis("Unable to open $target.subscription");   &Apache::lonnet::logthis("Unable to open $target.subscription");
     }      }
     &Apache::lonnet::logthis("Got list of ".join(':',@subscribed));  
     return @subscribed;      return @subscribed;
 }  }
   
Line 1396  sub phasetwo { Line 1416  sub phasetwo {
  $r->print('<p>Notifying host '.$subhost.':');$r->rflush;   $r->print('<p>Notifying host '.$subhost.':');$r->rflush;
  print $logfile "\nNotifying host ".$subhost.':';   print $logfile "\nNotifying host ".$subhost.':';
  my $reply=&Apache::lonnet::critical('update:'.$target,$subhost);   my $reply=&Apache::lonnet::critical('update:'.$target,$subhost);
  $r->print($reply);$r->rflush;   $r->print($reply.'<br />');$r->rflush;
  print $logfile $reply;   print $logfile $reply;
     }      }
           
Line 1408  sub phasetwo { Line 1428  sub phasetwo {
  print $logfile "\nNotifying host for metadata only ".$subhost.':';   print $logfile "\nNotifying host for metadata only ".$subhost.':';
  my $reply=&Apache::lonnet::critical('update:'.$target.'.meta',   my $reply=&Apache::lonnet::critical('update:'.$target.'.meta',
     $subhost);      $subhost);
  $r->print($reply);$r->rflush;   $r->print($reply.'<br />');$r->rflush;
  print $logfile $reply;   print $logfile $reply;
     }      }
           
   # --------------------------------------------------- Notify subscribed courses
       my %courses=&coursedependencies($target);
       my $now=time;
       foreach (keys %courses) {
    $r->print('<p>Notifying course '.$_.':');$r->rflush;
    print $logfile "\nNotifying host ".$_.':';
           my ($cdom,$cname)=split(/\_/,$_);
    my $reply=&Apache::lonnet::cput
                     ('versionupdate',{$target => $now},$cdom,$cname);
    $r->print($reply.'<br />');$r->rflush;
    print $logfile $reply;
       }
 # ------------------------------------------------ Provide link to new resource  # ------------------------------------------------ Provide link to new resource
     unless ($batch) {      unless ($batch) {
         my $thisdistarget=$target;          my $thisdistarget=$target;
Line 1665  unless ($ENV{'form.phase'} eq 'two') { Line 1697  unless ($ENV{'form.phase'} eq 'two') {
   
   $r->print('<html><head><title>LON-CAPA Publishing</title></head>');    $r->print('<html><head><title>LON-CAPA Publishing</title></head>');
   $r->print(&Apache::loncommon::bodytag('Resource Publication'));    $r->print(&Apache::loncommon::bodytag('Resource Publication'));
   
   
   my $thisfn=$fn;    my $thisfn=$fn;
   
   my $thistarget=$thisfn;    my $thistarget=$thisfn;

Removed from v.1.100  
changed lines
  Added in v.1.101


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