version 1.95, 2002/09/16 13:05:50
|
version 1.96, 2002/09/17 15:01:36
|
Line 1164 the server's attempts at publication.
|
Line 1164 the server's attempts at publication.
|
######################################### |
######################################### |
sub phasetwo { |
sub phasetwo { |
|
|
my ($source,$target,$style,$distarget)=@_; |
my ($source,$target,$style,$distarget,$batch)=@_; |
my $logfile; |
my $logfile; |
my $scrout=''; |
my $scrout=''; |
unless ($logfile=Apache::File->new('>>'.$source.'.log')) { |
unless ($logfile=Apache::File->new('>>'.$source.'.log')) { |
Line 1368 if (-e $target) {
|
Line 1368 if (-e $target) {
|
} |
} |
|
|
# ------------------------------------------------ Provide link to new resource |
# ------------------------------------------------ Provide link to new resource |
|
unless ($batch) { |
my $thisdistarget=$target; |
my $thisdistarget=$target; |
$thisdistarget=~s/^$docroot//; |
$thisdistarget=~s/^$docroot//; |
|
|
Line 1385 if (-e $target) {
|
Line 1385 if (-e $target) {
|
'<p><a href="'.$thissrc.'"><font size=+2>Back to Source</font></a>'. |
'<p><a href="'.$thissrc.'"><font size=+2>Back to Source</font></a>'. |
'<p><a href="'.$thissrcdir. |
'<p><a href="'.$thissrcdir. |
'"><font size="+2">Back to Source Directory</font></a>'; |
'"><font size="+2">Back to Source Directory</font></a>'; |
|
} |
} |
} |
|
|
######################################### |
######################################### |
Line 1395 sub batchpublish {
|
Line 1395 sub batchpublish {
|
my $thisdisfn=$srcfile; |
my $thisdisfn=$srcfile; |
$thisdisfn=~s/\/home\/korte\/public_html\///; |
$thisdisfn=~s/\/home\/korte\/public_html\///; |
$srcfile=~s/\/+/\//g; |
$srcfile=~s/\/+/\//g; |
|
|
|
|
|
undef %metadatafields; |
|
undef %metadatakeys; |
|
%metadatafields=(); |
|
%metadatakeys=(); |
|
|
$r->print('<h2>Publishing <tt>'.$thisdisfn.'</tt></h2>'); |
$r->print('<h2>Publishing <tt>'.$thisdisfn.'</tt></h2>'); |
|
# phase two takes |
|
# my ($source,$target,$style,$distarget,batch)=@_; |
|
# $ENV{'form.allmeta'} |
|
|
} |
} |
|
|
######################################### |
######################################### |
|
|
sub publishdirectory { |
sub publishdirectory { |
my ($r,$fn,$thisdisfn)=@_; |
my ($r,$fn,$thisdisfn)=@_; |
$r->print('<h1>Directory <tt>'.$thisdisfn.'/</tt></h1>'); |
my $resdir= |
|
$Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname. |
|
$thisdisfn; |
|
$r->print('<h1>Directory <tt>'.$thisdisfn.'/</tt></h1>'. |
|
'Target: <tt>'.$resdir.'</tt><br />'); |
|
|
my $dirptr=16384; # Mask indicating a directory in stat.cmode. |
my $dirptr=16384; # Mask indicating a directory in stat.cmode. |
|
|
Line 1422 sub publishdirectory {
|
Line 1437 sub publishdirectory {
|
} |
} |
} elsif ((&Apache::loncommon::fileembstyle($extension) ne 'hdn') && |
} elsif ((&Apache::loncommon::fileembstyle($extension) ne 'hdn') && |
($filename!~/^[\#\.]/) && ($filename!~/\~$/)) { |
($filename!~/^[\#\.]/) && ($filename!~/\~$/)) { |
&batchpublish($r,$fn.'/'.$filename); |
# find out publication status and/or exiting metadata |
|
my $publishthis=0; |
|
if (-e $resdir.'/'.$filename) { |
|
my ($rdev,$rino,$rmode,$rnlink, |
|
$ruid,$rgid,$rrdev,$rsize, |
|
$ratime,$rmtime,$rctime, |
|
$rblksize,$rblocks)=stat($resdir.'/'.$filename); |
|
if ($rmtime<$cmtime) { |
|
# previously published, modified now |
|
$publishthis=1; |
|
} |
|
} else { |
|
# never published |
|
$publishthis=1; |
|
} |
|
if ($publishthis) { |
|
&batchpublish($r,$fn.'/'.$filename); |
|
} else { |
|
$r->print('<br />Skipping '.$filename.'<br />'); |
|
} |
$r->rflush(); |
$r->rflush(); |
} |
} |
} |
} |