--- loncom/publisher/lonpublisher.pm 2003/07/05 10:07:12 1.124
+++ loncom/publisher/lonpublisher.pm 2003/09/25 22:30:06 1.138
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.124 2003/07/05 10:07:12 www Exp $
+# $Id: lonpublisher.pm,v 1.138 2003/09/25 22:30:06 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -82,6 +82,26 @@ invocation by F:
ErrorDocument 500 /adm/errorhandler
+=head1 OVERVIEW
+
+Authors can only write-access the C~authorname/> space. They can
+copy resources into the resource area through the publication step,
+and move them back through a recover step. Authors do not have direct
+write-access to their resource space.
+
+During the publication step, several events will be
+triggered. Metadata is gathered, where a wizard manages default
+entries on a hierarchical per-directory base: The wizard imports the
+metadata (including access privileges and royalty information) from
+the most recent published resource in the current directory, and if
+that is not available, from the next directory above, etc. The Network
+keeps all previous versions of a resource and makes them available by
+an explicit version number, which is inserted between the file name
+and extension, for example C, while the most recent
+version does not carry a version number (C). Servers
+subscribing to a changed resource are notified that a new version is
+available.
+
=head1 DESCRIPTION
B takes the proper steps to add resources to the LON-CAPA
@@ -122,6 +142,7 @@ use DBI;
use Apache::lonnet();
use Apache::loncommon();
use Apache::lonmysql;
+use Apache::lonlocal;
use vars qw(%metadatafields %metadatakeys);
my %addid;
@@ -304,6 +325,7 @@ string which presents the form field (fo
#########################################
sub textfield {
my ($title,$name,$value)=@_;
+ $title=&mt($title);
my $uctitle=uc($title);
return "\n
$uctitle:".
"
".
@@ -317,6 +339,7 @@ sub hiddenfield {
sub selectbox {
my ($title,$name,$value,$functionref,@idlist)=@_;
+ $title=&mt($title);
my $uctitle=uc($title);
$value=(split(/\s*,\s*/,$value))[-1];
my $selout="\n
$uctitle:".
@@ -647,7 +670,10 @@ sub fix_ids_and_indices {
}
}
# probably a image type '.
+ '
');
}
}
@@ -1468,6 +1529,8 @@ sub phasetwo {
sub batchpublish {
my ($r,$srcfile,$targetfile)=@_;
+ #publication pollutes %ENV with form.* values
+ my %oldENV=%ENV;
$srcfile=~s/\/+/\//g;
$targetfile=~s/\/+/\//g;
my $thisdisfn=$srcfile;
@@ -1489,7 +1552,7 @@ sub batchpublish {
my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
- $r->print('
Publishing '.$thisdisfn.'
');
+ $r->print('
'.&mt('Publishing').' '.$thisdisfn.'
');
# phase one takes
# my ($source,$target,$style,$batch)=@_;
@@ -1503,6 +1566,7 @@ sub batchpublish {
&phasetwo($r,$srcfile,$targetfile,$thisembstyle,$thisdistarget,1);
$r->print('');
}
+ %ENV=%oldENV;
return '';
}
@@ -1605,7 +1669,7 @@ sub handler {
my $r=shift;
if ($r->header_only) {
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK;
}
@@ -1698,7 +1762,7 @@ unless ($ENV{'form.phase'} eq 'two') {
# ---------------------------------------------------------- Start page output.
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
$r->print('LON-CAPA Publishing');
@@ -1721,27 +1785,37 @@ unless ($ENV{'form.phase'} eq 'two') {
if ($fn=~/\/$/) {
# -------------------------------------------------------- This is a directory
&publishdirectory($r,$fn,$thisdisfn);
+ $r->print(''.&mt('Done').' '.&mt('Return to Directory').'');
+
} else {
# ---------------------- Evaluate individual file, and then output information.
$thisfn=~/\.(\w+)$/;
my $thistype=$1;
my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
+ $r->print('