Annotation of loncom/publisher/lonpublisher.pm, revision 1.76
1.1 www 1: # The LearningOnline Network with CAPA
2: # Publication Handler
1.54 albertel 3: #
1.76 ! albertel 4: # $Id: lonpublisher.pm,v 1.75 2002/03/25 17:09:21 matthew Exp $
1.54 albertel 5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
1.1 www 28: #
29: # (TeX Content Handler
30: #
31: # 05/29/00,05/30,10/11 Gerd Kortemeyer)
32: #
1.15 www 33: # 11/28,11/29,11/30,12/01,12/02,12/04,12/23 Gerd Kortemeyer
1.20 www 34: # 03/23 Guy Albertelli
1.23 www 35: # 03/24,03/29,04/03 Gerd Kortemeyer
1.24 harris41 36: # 04/16/2001 Scott Harrison
1.27 www 37: # 05/03,05/05,05/07 Gerd Kortemeyer
1.30 harris41 38: # 05/28/2001 Scott Harrison
1.51 www 39: # 06/23,08/07,08/11,8/13,8/17,8/18,8/24,9/26,10/16 Gerd Kortemeyer
1.58 www 40: # 12/04,12/05 Guy Albertelli
41: # 12/05 Gerd Kortemeyer
1.62 www 42: # 12/05 Guy Albertelli
1.64 www 43: # 12/06,12/07 Gerd Kortemeyer
1.66 harris41 44: # 12/15,12/16 Scott Harrison
1.67 www 45: # 12/25 Gerd Kortemeyer
1.71 www 46: # YEAR=2002
47: # 1/16,1/17 Scott Harrison
48: # 1/17 Gerd Kortemeyer
1.65 harris41 49: #
50: ###
51:
52: ###############################################################################
53: ## ##
54: ## ORGANIZATION OF THIS PERL MODULE ##
55: ## ##
56: ## 1. Modules used by this module ##
57: ## 2. Various subroutines ##
58: ## 3. Publication Step One ##
59: ## 4. Phase Two ##
60: ## 5. Main Handler ##
61: ## ##
62: ###############################################################################
1.1 www 63:
64: package Apache::lonpublisher;
65:
1.65 harris41 66: # ------------------------------------------------- modules used by this module
1.1 www 67: use strict;
68: use Apache::File;
1.13 www 69: use File::Copy;
1.2 www 70: use Apache::Constants qw(:common :http :methods);
1.76 ! albertel 71: use HTML::LCParser;
1.4 www 72: use Apache::lonxml;
1.17 albertel 73: use Apache::lonhomework;
1.27 www 74: use Apache::loncacc;
1.24 harris41 75: use DBI;
1.65 harris41 76: use Apache::lonnet();
77: use Apache::loncommon();
1.2 www 78:
1.3 www 79: my %addid;
1.5 www 80: my %nokey;
1.10 www 81:
1.7 www 82: my %metadatafields;
83: my %metadatakeys;
84:
1.12 www 85: my $docroot;
86:
1.27 www 87: my $cuname;
88: my $cudom;
89:
1.12 www 90: # ----------------------------------------------- Evaluate string with metadata
1.7 www 91: sub metaeval {
92: my $metastring=shift;
93:
1.76 ! albertel 94: my $parser=HTML::LCParser->new(\$metastring);
1.7 www 95: my $token;
96: while ($token=$parser->get_token) {
97: if ($token->[0] eq 'S') {
98: my $entry=$token->[1];
99: my $unikey=$entry;
1.32 www 100: if (defined($token->[2]->{'package'})) {
101: $unikey.='_package_'.$token->[2]->{'package'};
102: }
1.7 www 103: if (defined($token->[2]->{'part'})) {
104: $unikey.='_'.$token->[2]->{'part'};
105: }
1.32 www 106: if (defined($token->[2]->{'id'})) {
1.49 www 107: $unikey.='_'.$token->[2]->{'id'};
1.32 www 108: }
1.7 www 109: if (defined($token->[2]->{'name'})) {
110: $unikey.='_'.$token->[2]->{'name'};
111: }
1.65 harris41 112: foreach (@{$token->[3]}) {
1.7 www 113: $metadatafields{$unikey.'.'.$_}=$token->[2]->{$_};
114: if ($metadatakeys{$unikey}) {
115: $metadatakeys{$unikey}.=','.$_;
116: } else {
117: $metadatakeys{$unikey}=$_;
118: }
1.65 harris41 119: }
1.7 www 120: if ($metadatafields{$unikey}) {
1.8 www 121: my $newentry=$parser->get_text('/'.$entry);
1.41 www 122: unless (($metadatafields{$unikey}=~/$newentry/) ||
123: ($newentry eq '')) {
1.8 www 124: $metadatafields{$unikey}.=', '.$newentry;
125: }
1.7 www 126: } else {
127: $metadatafields{$unikey}=$parser->get_text('/'.$entry);
128: }
129: }
130: }
131: }
132:
1.12 www 133: # -------------------------------------------------------- Read a metadata file
1.7 www 134: sub metaread {
135: my ($logfile,$fn)=@_;
136: unless (-e $fn) {
137: print $logfile 'No file '.$fn."\n";
138: return '<br><b>No file:</b> <tt>'.$fn.'</tt>';
139: }
140: print $logfile 'Processing '.$fn."\n";
141: my $metastring;
142: {
143: my $metafh=Apache::File->new($fn);
144: $metastring=join('',<$metafh>);
145: }
146: &metaeval($metastring);
147: return '<br><b>Processed file:</b> <tt>'.$fn.'</tt>';
148: }
149:
1.25 harris41 150: # ---------------------------- convert 'time' format into a datetime sql format
151: sub sqltime {
1.70 harris41 152: my $timef=shift @_;
1.25 harris41 153: my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
1.70 harris41 154: localtime($timef);
1.25 harris41 155: $mon++; $year+=1900;
156: return "$year-$mon-$mday $hour:$min:$sec";
157: }
158:
1.12 www 159: # --------------------------------------------------------- Various form fields
160:
1.8 www 161: sub textfield {
1.10 www 162: my ($title,$name,$value)=@_;
1.8 www 163: return "\n<p><b>$title:</b><br>".
1.11 www 164: '<input type=text name="'.$name.'" size=80 value="'.$value.'">';
165: }
166:
167: sub hiddenfield {
168: my ($name,$value)=@_;
169: return "\n".'<input type=hidden name="'.$name.'" value="'.$value.'">';
1.8 www 170: }
171:
1.9 www 172: sub selectbox {
1.65 harris41 173: my ($title,$name,$value,$functionref,@idlist)=@_;
174: my $uctitle=uc($title);
175: my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:".
176: "</b></font><br />".'<select name="'.$name.'">';
177: foreach (@idlist) {
178: $selout.='<option value=\''.$_.'\'';
179: if ($_ eq $value) {
180: $selout.=' selected>'.&{$functionref}($_).'</option>';
181: }
182: else {$selout.='>'.&{$functionref}($_).'</option>';}
183: }
1.10 www 184: return $selout.'</select>';
1.9 www 185: }
186:
1.12 www 187: # -------------------------------------------------------- Publication Step One
188:
1.34 www 189: sub urlfixup {
1.35 www 190: my ($url,$target)=@_;
1.39 www 191: unless ($url) { return ''; }
1.68 albertel 192: #javascript code needs no fixing
193: if ($url =~ /^javascript:/i) { return $url; }
1.69 albertel 194: if ($url =~ /^mailto:/i) { return $url; }
1.68 albertel 195: #internal document links need no fixing
196: if ($url =~ /^\#/) { return $url; }
1.35 www 197: my ($host)=($url=~/(?:http\:\/\/)*([^\/]+)/);
1.65 harris41 198: foreach (values %Apache::lonnet::hostname) {
1.35 www 199: if ($_ eq $host) {
200: $url=~s/^http\:\/\///;
201: $url=~s/^$host//;
202: }
1.65 harris41 203: }
1.40 www 204: if ($url=~/^http\:\/\//) { return $url; }
1.35 www 205: $url=~s/\~$cuname/res\/$cudom\/$cuname/;
1.71 www 206: return $url;
207: }
208:
209:
210: sub absoluteurl {
211: my ($url,$target)=@_;
212: unless ($url) { return ''; }
1.35 www 213: if ($target) {
214: $target=~s/\/[^\/]+$//;
215: $url=&Apache::lonnet::hreflocation($target,$url);
216: }
217: return $url;
1.34 www 218: }
219:
1.2 www 220: sub publish {
1.50 www 221:
1.2 www 222: my ($source,$target,$style)=@_;
223: my $logfile;
1.4 www 224: my $scrout='';
1.23 www 225: my $allmeta='';
226: my $content='';
1.36 www 227: my %allow=();
228: undef %allow;
1.4 www 229:
1.2 www 230: unless ($logfile=Apache::File->new('>>'.$source.'.log')) {
1.7 www 231: return
232: '<font color=red>No write permission to user directory, FAIL</font>';
1.2 www 233: }
234: print $logfile
1.11 www 235: "\n\n================= Publish ".localtime()." Phase One ================\n";
1.2 www 236:
1.3 www 237: if (($style eq 'ssi') || ($style eq 'rat')) {
238: # ------------------------------------------------------- This needs processing
1.4 www 239:
240: # ----------------------------------------------------------------- Backup Copy
1.3 www 241: my $copyfile=$source.'.save';
1.13 www 242: if (copy($source,$copyfile)) {
1.3 www 243: print $logfile "Copied original file to ".$copyfile."\n";
244: } else {
1.13 www 245: print $logfile "Unable to write backup ".$copyfile.':'.$!."\n";
246: return "<font color=red>Failed to write backup copy, $!,FAIL</font>";
1.3 www 247: }
1.4 www 248: # ------------------------------------------------------------- IDs and indices
249:
250: my $maxindex=10;
251: my $maxid=10;
1.23 www 252:
1.4 www 253: my $needsfixup=0;
254:
255: {
256: my $org=Apache::File->new($source);
257: $content=join('',<$org>);
258: }
259: {
1.76 ! albertel 260: my $parser=HTML::LCParser->new(\$content);
1.4 www 261: my $token;
262: while ($token=$parser->get_token) {
263: if ($token->[0] eq 'S') {
264: my $counter;
265: if ($counter=$addid{$token->[1]}) {
266: if ($counter eq 'id') {
267: if (defined($token->[2]->{'id'})) {
268: $maxid=
269: ($token->[2]->{'id'}>$maxid)?$token->[2]->{'id'}:$maxid;
270: } else {
271: $needsfixup=1;
272: }
273: } else {
274: if (defined($token->[2]->{'index'})) {
275: $maxindex=
276: ($token->[2]->{'index'}>$maxindex)?$token->[2]->{'index'}:$maxindex;
277: } else {
278: $needsfixup=1;
279: }
280: }
281: }
282: }
283: }
284: }
285: if ($needsfixup) {
286: print $logfile "Needs ID and/or index fixup\n".
287: "Max ID : $maxid (min 10)\n".
288: "Max Index: $maxindex (min 10)\n";
1.34 www 289: }
1.4 www 290: my $outstring='';
1.76 ! albertel 291: my $parser=HTML::LCParser->new(\$content);
1.53 albertel 292: $parser->xml_mode(1);
1.4 www 293: my $token;
294: while ($token=$parser->get_token) {
295: if ($token->[0] eq 'S') {
1.34 www 296: my $counter;
297: my $tag=$token->[1];
1.56 albertel 298: my $lctag=lc($tag);
1.53 albertel 299: unless ($lctag eq 'allow') {
1.34 www 300: my %parms=%{$token->[2]};
1.53 albertel 301: $counter=$addid{$tag};
302: if (!$counter) { $counter=$addid{$lctag}; }
303: if ($counter) {
1.4 www 304: if ($counter eq 'id') {
1.34 www 305: unless (defined($parms{'id'})) {
1.4 www 306: $maxid++;
1.34 www 307: $parms{'id'}=$maxid;
308: print $logfile 'ID: '.$tag.':'.$maxid."\n";
1.4 www 309: }
1.34 www 310: } elsif ($counter eq 'index') {
311: unless (defined($parms{'index'})) {
1.4 www 312: $maxindex++;
1.34 www 313: $parms{'index'}=$maxindex;
314: print $logfile 'Index: '.$tag.':'.$maxindex."\n";
1.4 www 315: }
316: }
1.72 albertel 317: }
318:
319: foreach my $type ('src','href','background','bgimg') {
320: foreach my $key (keys(%parms)) {
321: if ($key =~ /^$type$/i) {
322: my $oldurl=$parms{$key};
323: my $newurl=&urlfixup($oldurl,$target);
324: if ($newurl ne $oldurl) {
325: $parms{$key}=$newurl;
326: print $logfile 'URL: '.$tag.':'.$oldurl.' - '.
327: $newurl."\n";
328: }
1.74 albertel 329: if (($newurl !~ /^javascript:/i) &&
330: ($newurl !~ /^mailto:/i) &&
331: ($newurl !~ /^http:/i) &&
332: ($newurl !~ /^\#/)) {
333: $allow{&absoluteurl($newurl,$target)}=1;
334: }
1.34 www 335: }
1.72 albertel 336: last;
337: }
1.65 harris41 338: }
1.38 www 339:
1.53 albertel 340: if ($lctag eq 'applet') {
1.38 www 341: my $codebase='';
342: if (defined($parms{'codebase'})) {
343: my $oldcodebase=$parms{'codebase'};
344: unless ($oldcodebase=~/\/$/) {
345: $oldcodebase.='/';
346: }
347: $codebase=&urlfixup($oldcodebase,$target);
348: $codebase=~s/\/$//;
349: if ($codebase ne $oldcodebase) {
350: $parms{'codebase'}=$codebase;
351: print $logfile 'URL codebase: '.$tag.':'.
352: $oldcodebase.' - '.
353: $codebase."\n";
354: }
1.71 www 355: $allow{&absoluteurl($codebase,$target).'/*'}=1;
1.38 www 356: } else {
1.65 harris41 357: foreach ('archive','code','object') {
1.38 www 358: if (defined($parms{$_})) {
359: my $oldurl=$parms{$_};
360: my $newurl=&urlfixup($oldurl,$target);
361: $newurl=~s/\/[^\/]+$/\/\*/;
362: print $logfile 'Allow: applet '.$_.':'.
363: $oldurl.' allows '.
364: $newurl."\n";
1.71 www 365: $allow{&absoluteurl($newurl,$target)}=1;
1.38 www 366: }
1.65 harris41 367: }
1.38 www 368: }
369: }
1.34 www 370:
371: my $newparmstring='';
372: my $endtag='';
1.65 harris41 373: foreach (keys %parms) {
1.34 www 374: if ($_ eq '/') {
375: $endtag=' /';
376: } else {
377: my $quote=($parms{$_}=~/\"/?"'":'"');
378: $newparmstring.=' '.$_.'='.$quote.$parms{$_}.$quote;
379: }
1.65 harris41 380: }
1.57 albertel 381: if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; }
1.34 www 382: $outstring.='<'.$tag.$newparmstring.$endtag.'>';
1.36 www 383: } else {
384: $allow{$token->[2]->{'src'}}=1;
385: }
1.4 www 386: } elsif ($token->[0] eq 'E') {
1.57 albertel 387: if ($token->[2]) {
1.34 www 388: unless ($token->[1] eq 'allow') {
1.41 www 389: $outstring.='</'.$token->[1].'>';
1.34 www 390: }
1.57 albertel 391: }
1.4 www 392: } else {
393: $outstring.=$token->[1];
394: }
395: }
1.36 www 396: # ------------------------------------------------------------ Construct Allows
1.62 www 397:
1.44 www 398: $scrout.='<h3>Dependencies</h3>';
1.62 www 399: my $allowstr='';
1.73 albertel 400: foreach (sort(keys(%allow))) {
1.59 www 401: my $thisdep=$_;
1.73 albertel 402: if ($thisdep !~ /[^\s]/) { next; }
1.62 www 403: unless ($style eq 'rat') {
404: $allowstr.="\n".'<allow src="'.$thisdep.'" />';
405: }
1.44 www 406: $scrout.='<br>';
1.59 www 407: unless ($thisdep=~/\*/) {
408: $scrout.='<a href="'.$thisdep.'">';
1.44 www 409: }
1.59 www 410: $scrout.='<tt>'.$thisdep.'</tt>';
411: unless ($thisdep=~/\*/) {
1.44 www 412: $scrout.='</a>';
1.59 www 413: if (
414: &Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'.
415: $thisdep.'.meta') eq '-1') {
1.58 www 416: $scrout.=
417: ' - <font color=red>Currently not available</font>';
1.59 www 418: } else {
419: my %temphash=(&Apache::lonnet::declutter($target).'___'.
420: &Apache::lonnet::declutter($thisdep).'___usage'
421: => time);
422: $thisdep=~/^\/res\/(\w+)\/(\w+)\//;
423: if ((defined($1)) && (defined($2))) {
424: &Apache::lonnet::put('resevaldata',\%temphash,$1,$2);
425: }
426: }
1.44 www 427: }
1.65 harris41 428: }
1.71 www 429: $allowstr=~s/\n+/\n/g;
1.36 www 430: $outstring=~s/(\<\/[^\>]+\>\s*)$/$allowstr$1/s;
1.62 www 431:
1.76 ! albertel 432: #Encode any High ASCII characters
! 433: $outstring=&HTML::Entities::encode($outstring,"\200-\377");
1.37 www 434: # ------------------------------------------------------------- Write modified
435:
1.4 www 436: {
437: my $org;
438: unless ($org=Apache::File->new('>'.$source)) {
439: print $logfile "No write permit to $source\n";
1.7 www 440: return
441: "<font color=red>No write permission to $source, FAIL</font>";
1.4 www 442: }
443: print $org $outstring;
444: }
445: $content=$outstring;
1.34 www 446:
447: if ($needsfixup) {
1.4 www 448: print $logfile "End of ID and/or index fixup\n".
449: "Max ID : $maxid (min 10)\n".
450: "Max Index: $maxindex (min 10)\n";
451: } else {
452: print $logfile "Does not need ID and/or index fixup\n";
453: }
1.37 www 454: }
1.7 www 455: # --------------------------------------------- Initial step done, now metadata
456:
457: # ---------------------------------------- Storage for metadata keys and fields
458:
1.8 www 459: %metadatafields=();
460: %metadatakeys=();
461:
462: my %oldparmstores=();
1.44 www 463:
464: $scrout.='<h3>Metadata Information</h3>';
1.7 www 465:
466: # ------------------------------------------------ First, check out environment
1.8 www 467: unless (-e $source.'.meta') {
1.7 www 468: $metadatafields{'author'}=$ENV{'environment.firstname'}.' '.
469: $ENV{'environment.middlename'}.' '.
470: $ENV{'environment.lastname'}.' '.
471: $ENV{'environment.generation'};
1.8 www 472: $metadatafields{'author'}=~s/\s+/ /g;
473: $metadatafields{'author'}=~s/\s+$//;
1.27 www 474: $metadatafields{'owner'}=$cuname.'@'.$cudom;
1.7 www 475:
476: # ------------------------------------------------ Check out directory hierachy
477:
478: my $thisdisfn=$source;
1.27 www 479: $thisdisfn=~s/^\/home\/$cuname\///;
1.7 www 480:
481: my @urlparts=split(/\//,$thisdisfn);
482: $#urlparts--;
483:
1.27 www 484: my $currentpath='/home/'.$cuname.'/';
1.7 www 485:
1.65 harris41 486: foreach (@urlparts) {
1.7 www 487: $currentpath.=$_.'/';
488: $scrout.=&metaread($logfile,$currentpath.'default.meta');
1.65 harris41 489: }
1.7 www 490:
491: # ------------------- Clear out parameters and stores (there should not be any)
492:
1.65 harris41 493: foreach (keys %metadatafields) {
1.7 www 494: if (($_=~/^parameter/) || ($_=~/^stores/)) {
495: delete $metadatafields{$_};
496: }
1.65 harris41 497: }
1.7 www 498:
1.8 www 499: } else {
1.7 www 500: # ---------------------- Read previous metafile, remember parameters and stores
501:
502: $scrout.=&metaread($logfile,$source.'.meta');
503:
1.65 harris41 504: foreach (keys %metadatafields) {
1.7 www 505: if (($_=~/^parameter/) || ($_=~/^stores/)) {
506: $oldparmstores{$_}=1;
507: delete $metadatafields{$_};
508: }
1.65 harris41 509: }
1.7 www 510:
1.8 www 511: }
1.7 www 512:
1.4 www 513: # -------------------------------------------------- Parse content for metadata
1.37 www 514: if ($style eq 'ssi') {
1.42 www 515: my $oldenv=$ENV{'request.uri'};
516:
517: $ENV{'request.uri'}=$target;
1.23 www 518: $allmeta=Apache::lonxml::xmlparse('meta',$content);
1.42 www 519: $ENV{'request.uri'}=$oldenv;
1.32 www 520:
1.19 albertel 521: &metaeval($allmeta);
1.37 www 522: }
1.7 www 523: # ---------------- Find and document discrepancies in the parameters and stores
524:
525: my $chparms='';
1.65 harris41 526: foreach (sort keys %metadatafields) {
1.7 www 527: if (($_=~/^parameter/) || ($_=~/^stores/)) {
528: unless ($_=~/\.\w+$/) {
529: unless ($oldparmstores{$_}) {
530: print $logfile 'New: '.$_."\n";
531: $chparms.=$_.' ';
532: }
533: }
534: }
1.65 harris41 535: }
1.7 www 536: if ($chparms) {
537: $scrout.='<p><b>New parameters or stored values:</b> '.
538: $chparms;
539: }
540:
1.70 harris41 541: $chparms='';
1.65 harris41 542: foreach (sort keys %oldparmstores) {
1.7 www 543: if (($_=~/^parameter/) || ($_=~/^stores/)) {
1.33 www 544: unless (($metadatafields{$_.'.name'}) ||
545: ($metadatafields{$_.'.package'}) || ($_=~/\.\w+$/)) {
1.7 www 546: print $logfile 'Obsolete: '.$_."\n";
547: $chparms.=$_.' ';
548: }
549: }
1.65 harris41 550: }
1.7 www 551: if ($chparms) {
552: $scrout.='<p><b>Obsolete parameters or stored values:</b> '.
553: $chparms;
554: }
1.37 www 555:
1.8 www 556: # ------------------------------------------------------- Now have all metadata
1.5 www 557:
1.8 www 558: $scrout.=
559: '<form action="/adm/publish" method="post">'.
1.63 albertel 560: '<p><input type="submit" value="Finalize Publication" /></p>'.
1.11 www 561: &hiddenfield('phase','two').
562: &hiddenfield('filename',$ENV{'form.filename'}).
563: &hiddenfield('allmeta',&Apache::lonnet::escape($allmeta)).
1.58 www 564: &hiddenfield('dependencies',join(',',keys %allow)).
1.10 www 565: &textfield('Title','title',$metadatafields{'title'}).
566: &textfield('Author(s)','author',$metadatafields{'author'}).
567: &textfield('Subject','subject',$metadatafields{'subject'});
1.5 www 568:
569: # --------------------------------------------------- Scan content for keywords
1.7 www 570:
1.8 www 571: my $keywordout='<p><b>Keywords:</b><br><table border=2><tr>';
1.7 www 572: my $colcount=0;
1.67 www 573: my %keywords=();
1.7 www 574:
1.52 albertel 575: if (length($content)<500000) {
1.5 www 576: my $textonly=$content;
577: $textonly=~s/\<script[^\<]+\<\/script\>//g;
578: $textonly=~s/\<m\>[^\<]+\<\/m\>//g;
579: $textonly=~s/\<[^\>]*\>//g;
580: $textonly=~tr/A-Z/a-z/;
581: $textonly=~s/[\$\&][a-z]\w*//g;
582: $textonly=~s/[^a-z\s]//g;
583:
1.65 harris41 584: foreach ($textonly=~m/(\w+)/g) {
1.50 www 585: unless ($nokey{$_}) {
586: $keywords{$_}=1;
587: }
1.65 harris41 588: }
1.67 www 589: }
1.5 www 590:
1.67 www 591:
1.65 harris41 592: foreach (split(/\W+/,$metadatafields{'keywords'})) {
1.12 www 593: $keywords{$_}=1;
1.65 harris41 594: }
1.5 www 595:
1.65 harris41 596: foreach (sort keys %keywords) {
1.12 www 597: $keywordout.='<td><input type=checkbox name="key.'.$_.'"';
1.67 www 598: if ($metadatafields{'keywords'}) {
599: if ($metadatafields{'keywords'}=~/$_/) {
600: $keywordout.=' checked';
601: }
602: } elsif (&Apache::loncommon::keyword($_)) {
1.73 albertel 603: $keywordout.=' checked';
1.67 www 604: }
1.8 www 605: $keywordout.='>'.$_.'</td>';
1.7 www 606: if ($colcount>10) {
607: $keywordout.="</tr><tr>\n";
608: $colcount=0;
609: }
1.50 www 610: $colcount++;
1.65 harris41 611: }
1.50 www 612:
1.51 www 613: $keywordout.='</tr></table>';
614:
615: $scrout.=$keywordout;
1.9 www 616:
1.12 www 617: $scrout.=&textfield('Additional Keywords','addkey','');
618:
1.10 www 619: $scrout.=&textfield('Notes','notes',$metadatafields{'notes'});
1.9 www 620:
621: $scrout.=
622: '<p><b>Abstract:</b><br><textarea cols=80 rows=5 name=abstract>'.
623: $metadatafields{'abstract'}.'</textarea>';
624:
1.11 www 625: $source=~/\.(\w+)$/;
626:
627: $scrout.=&hiddenfield('mime',$1);
628:
1.10 www 629: $scrout.=&selectbox('Language','language',
1.65 harris41 630: $metadatafields{'language'},
1.70 harris41 631: \&Apache::loncommon::languagedescription,
1.65 harris41 632: (&Apache::loncommon::languageids),
633: );
1.11 www 634:
635: unless ($metadatafields{'creationdate'}) {
636: $metadatafields{'creationdate'}=time;
637: }
638: $scrout.=&hiddenfield('creationdate',$metadatafields{'creationdate'});
639:
640: $scrout.=&hiddenfield('lastrevisiondate',time);
641:
1.9 www 642:
1.10 www 643: $scrout.=&textfield('Publisher/Owner','owner',
644: $metadatafields{'owner'});
1.45 www 645: # --------------------------------------------------- Correct copyright for rat
646: if ($style eq 'rat') {
1.65 harris41 647: if ($metadatafields{'copyright'} eq 'public') {
648: delete $metadatafields{'copyright'};
649: }
650: $scrout.=&selectbox('Copyright/Distribution','copyright',
651: $metadatafields{'copyright'},
1.70 harris41 652: \&Apache::loncommon::copyrightdescription,
1.65 harris41 653: (grep !/^public$/,(&Apache::loncommon::copyrightids)));
654: }
655: else {
1.10 www 656: $scrout.=&selectbox('Copyright/Distribution','copyright',
1.65 harris41 657: $metadatafields{'copyright'},
1.70 harris41 658: \&Apache::loncommon::copyrightdescription,
1.65 harris41 659: (&Apache::loncommon::copyrightids));
660: }
1.8 www 661: return $scrout.
1.63 albertel 662: '<p><input type="submit" value="Finalize Publication" /></p></form>';
1.2 www 663: }
1.1 www 664:
1.12 www 665: # -------------------------------------------------------- Publication Step Two
666:
1.11 www 667: sub phasetwo {
668:
1.24 harris41 669: my ($source,$target,$style,$distarget)=@_;
1.11 www 670: my $logfile;
671: my $scrout='';
672:
673: unless ($logfile=Apache::File->new('>>'.$source.'.log')) {
674: return
675: '<font color=red>No write permission to user directory, FAIL</font>';
676: }
677: print $logfile
678: "\n================= Publish ".localtime()." Phase Two ================\n";
679:
680: %metadatafields=();
681: %metadatakeys=();
682:
683: &metaeval(&Apache::lonnet::unescape($ENV{'form.allmeta'}));
684:
685: $metadatafields{'title'}=$ENV{'form.title'};
686: $metadatafields{'author'}=$ENV{'form.author'};
687: $metadatafields{'subject'}=$ENV{'form.subject'};
688: $metadatafields{'notes'}=$ENV{'form.notes'};
689: $metadatafields{'abstract'}=$ENV{'form.abstract'};
690: $metadatafields{'mime'}=$ENV{'form.mime'};
691: $metadatafields{'language'}=$ENV{'form.language'};
692: $metadatafields{'creationdate'}=$ENV{'form.creationdate'};
693: $metadatafields{'lastrevisiondate'}=$ENV{'form.lastrevisiondate'};
694: $metadatafields{'owner'}=$ENV{'form.owner'};
695: $metadatafields{'copyright'}=$ENV{'form.copyright'};
1.60 www 696: $metadatafields{'dependencies'}=$ENV{'form.dependencies'};
1.12 www 697:
698: my $allkeywords=$ENV{'form.addkey'};
1.65 harris41 699: foreach (keys %ENV) {
1.12 www 700: if ($_=~/^form\.key\.(\w+)/) {
701: $allkeywords.=','.$1;
702: }
1.65 harris41 703: }
1.12 www 704: $allkeywords=~s/\W+/\,/;
705: $allkeywords=~s/^\,//;
706: $metadatafields{'keywords'}=$allkeywords;
707:
708: {
709: print $logfile "\nWrite metadata file for ".$source;
710: my $mfh;
711: unless ($mfh=Apache::File->new('>'.$source.'.meta')) {
712: return
713: '<font color=red>Could not write metadata, FAIL</font>';
1.65 harris41 714: }
715: foreach (sort keys %metadatafields) {
1.12 www 716: unless ($_=~/\./) {
717: my $unikey=$_;
718: $unikey=~/^([A-Za-z]+)/;
719: my $tag=$1;
720: $tag=~tr/A-Z/a-z/;
721: print $mfh "\n\<$tag";
1.65 harris41 722: foreach (split(/\,/,$metadatakeys{$unikey})) {
1.12 www 723: my $value=$metadatafields{$unikey.'.'.$_};
724: $value=~s/\"/\'\'/g;
725: print $mfh ' '.$_.'="'.$value.'"';
1.65 harris41 726: }
1.76 ! albertel 727: print $mfh '>'.
! 728: &HTML::Entities::encode($metadatafields{$unikey})
! 729: .'</'.$tag.'>';
1.12 www 730: }
1.65 harris41 731: }
1.12 www 732: $scrout.='<p>Wrote Metadata';
733: print $logfile "\nWrote metadata";
734: }
735:
1.24 harris41 736: # -------------------------------- Synchronize entry with SQL metadata database
1.64 www 737: my $warning;
738:
739: unless ($metadatafields{'copyright'} eq 'priv') {
1.25 harris41 740:
1.24 harris41 741: my $dbh;
742: {
743: unless (
1.64 www 744: $dbh = DBI->connect("DBI:mysql:loncapa","www",
745: $Apache::lonnet::perlvar{'lonSqlAccess'},{ RaiseError =>0,PrintError=>0})
1.24 harris41 746: ) {
1.29 harris41 747: $warning='<font color=red>WARNING: Cannot connect to '.
748: 'database!</font>';
749: }
750: else {
751: my %sqldatafields;
752: $sqldatafields{'url'}=$distarget;
753: my $sth=$dbh->prepare(
754: 'delete from metadata where url like binary'.
755: '"'.$sqldatafields{'url'}.'"');
756: $sth->execute();
1.65 harris41 757: foreach ('title','author','subject','keywords','notes','abstract',
1.29 harris41 758: 'mime','language','creationdate','lastrevisiondate','owner',
1.65 harris41 759: 'copyright') {
760: my $field=$metadatafields{$_}; $field=~s/\"/\'\'/g;
761: $sqldatafields{$_}=$field;
762: }
1.29 harris41 763:
764: $sth=$dbh->prepare('insert into metadata values ('.
765: '"'.delete($sqldatafields{'title'}).'"'.','.
766: '"'.delete($sqldatafields{'author'}).'"'.','.
767: '"'.delete($sqldatafields{'subject'}).'"'.','.
768: '"'.delete($sqldatafields{'url'}).'"'.','.
769: '"'.delete($sqldatafields{'keywords'}).'"'.','.
770: '"'.'current'.'"'.','.
771: '"'.delete($sqldatafields{'notes'}).'"'.','.
772: '"'.delete($sqldatafields{'abstract'}).'"'.','.
773: '"'.delete($sqldatafields{'mime'}).'"'.','.
774: '"'.delete($sqldatafields{'language'}).'"'.','.
775: '"'.
776: sqltime(delete($sqldatafields{'creationdate'}))
777: .'"'.','.
778: '"'.
779: sqltime(delete(
780: $sqldatafields{'lastrevisiondate'})).'"'.','.
781: '"'.delete($sqldatafields{'owner'}).'"'.','.
782: '"'.delete(
783: $sqldatafields{'copyright'}).'"'.')');
784: $sth->execute();
785: $dbh->disconnect;
786: $scrout.='<p>Synchronized SQL metadata database';
787: print $logfile "\nSynchronized SQL metadata database";
1.24 harris41 788: }
789: }
790:
1.64 www 791: } else {
792: $scrout.='<p>Private Publication - did not synchronize database';
1.66 harris41 793: print $logfile "\nPrivate: Did not synchronize data into ".
794: "SQL metadata database";
1.64 www 795: }
1.12 www 796: # ----------------------------------------------------------- Copy old versions
797:
798: if (-e $target) {
799: my $filename;
800: my $maxversion=0;
801: $target=~/(.*)\/([^\/]+)\.(\w+)$/;
802: my $srcf=$2;
803: my $srct=$3;
804: my $srcd=$1;
805: unless ($srcd=~/^\/home\/httpd\/html\/res/) {
806: print $logfile "\nPANIC: Target dir is ".$srcd;
807: return "<font color=red>Invalid target directory, FAIL</font>";
808: }
809: opendir(DIR,$srcd);
810: while ($filename=readdir(DIR)) {
811: if ($filename=~/$srcf\.(\d+)\.$srct$/) {
812: $maxversion=($1>$maxversion)?$1:$maxversion;
813: }
814: }
815: closedir(DIR);
816: $maxversion++;
817: $scrout.='<p>Creating old version '.$maxversion;
818: print $logfile "\nCreating old version ".$maxversion;
819:
820: my $copyfile=$srcd.'/'.$srcf.'.'.$maxversion.'.'.$srct;
821:
1.13 www 822: if (copy($target,$copyfile)) {
1.12 www 823: print $logfile "Copied old target to ".$copyfile."\n";
824: $scrout.='<p>Copied old target file';
825: } else {
1.13 www 826: print $logfile "Unable to write ".$copyfile.':'.$!."\n";
827: return "<font color=red>Failed to copy old target, $!, FAIL</font>";
1.12 www 828: }
829:
830: # --------------------------------------------------------------- Copy Metadata
831:
832: $copyfile=$copyfile.'.meta';
1.13 www 833:
834: if (copy($target.'.meta',$copyfile)) {
1.14 www 835: print $logfile "Copied old target metadata to ".$copyfile."\n";
1.12 www 836: $scrout.='<p>Copied old metadata';
837: } else {
1.13 www 838: print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n";
1.14 www 839: if (-e $target.'.meta') {
840: return
1.13 www 841: "<font color=red>Failed to write old metadata copy, $!, FAIL</font>";
1.14 www 842: }
1.12 www 843: }
1.11 www 844:
845:
1.12 www 846: } else {
847: $scrout.='<p>Initial version';
848: print $logfile "\nInitial version";
849: }
850:
851: # ---------------------------------------------------------------- Write Source
852: my $copyfile=$target;
853:
854: my @parts=split(/\//,$copyfile);
855: my $path="/$parts[1]/$parts[2]/$parts[3]/$parts[4]";
856:
857: my $count;
858: for ($count=5;$count<$#parts;$count++) {
859: $path.="/$parts[$count]";
860: if ((-e $path)!=1) {
861: print $logfile "\nCreating directory ".$path;
862: $scrout.='<p>Created directory '.$parts[$count];
863: mkdir($path,0777);
864: }
865: }
866:
1.13 www 867: if (copy($source,$copyfile)) {
1.12 www 868: print $logfile "Copied original source to ".$copyfile."\n";
869: $scrout.='<p>Copied source file';
870: } else {
1.13 www 871: print $logfile "Unable to write ".$copyfile.':'.$!."\n";
872: return "<font color=red>Failed to copy source, $!, FAIL</font>";
1.12 www 873: }
874:
875: # --------------------------------------------------------------- Copy Metadata
876:
1.13 www 877: $copyfile=$copyfile.'.meta';
878:
879: if (copy($source.'.meta',$copyfile)) {
1.12 www 880: print $logfile "Copied original metadata to ".$copyfile."\n";
881: $scrout.='<p>Copied metadata';
882: } else {
1.13 www 883: print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n";
1.12 www 884: return
1.13 www 885: "<font color=red>Failed to write metadata copy, $!, FAIL</font>";
1.12 www 886: }
887:
888: # --------------------------------------------------- Send update notifications
889:
890: {
891:
892: my $filename;
893:
894: $target=~/(.*)\/([^\/]+)$/;
895: my $srcf=$2;
896: opendir(DIR,$1);
897: while ($filename=readdir(DIR)) {
898: if ($filename=~/$srcf\.(\w+)$/) {
899: my $subhost=$1;
900: if ($subhost ne 'meta') {
901: $scrout.='<p>Notifying host '.$subhost.':';
902: print $logfile "\nNotifying host '.$subhost.':'";
903: my $reply=&Apache::lonnet::critical('update:'.$target,$subhost);
1.20 www 904: $scrout.=$reply;
905: print $logfile $reply;
906: }
907: }
908: }
909: closedir(DIR);
910:
911: }
912:
913: # ---------------------------------------- Send update notifications, meta only
914:
915: {
916:
917: my $filename;
918:
919: $target=~/(.*)\/([^\/]+)$/;
920: my $srcf=$2.'.meta';
921: opendir(DIR,$1);
922: while ($filename=readdir(DIR)) {
923: if ($filename=~/$srcf\.(\w+)$/) {
924: my $subhost=$1;
925: if ($subhost ne 'meta') {
926: $scrout.=
927: '<p>Notifying host for metadata only '.$subhost.':';
928: print $logfile
929: "\nNotifying host for metadata only '.$subhost.':'";
930: my $reply=&Apache::lonnet::critical(
931: 'update:'.$target.'.meta',$subhost);
1.12 www 932: $scrout.=$reply;
933: print $logfile $reply;
934: }
935: }
936: }
937: closedir(DIR);
938:
939: }
940:
941: # ------------------------------------------------ Provide link to new resource
942:
943: my $thisdistarget=$target;
944: $thisdistarget=~s/^$docroot//;
945:
1.22 www 946: my $thissrc=$source;
947: $thissrc=~s/^\/home\/(\w+)\/public_html/\/priv\/$1/;
948:
949: my $thissrcdir=$thissrc;
950: $thissrcdir=~s/\/[^\/]+$/\//;
951:
952:
1.29 harris41 953: return $warning.$scrout.
1.75 matthew 954: '<hr><a href="'.$thisdistarget.'"><font size=+2>View Published Version</font></a>'.
1.22 www 955: '<p><a href="'.$thissrc.'"><font size=+2>Back to Source</font></a>'.
956: '<p><a href="'.$thissrcdir.
957: '"><font size=+2>Back to Source Directory</font></a>';
958:
1.11 www 959: }
960:
1.1 www 961: # ================================================================ Main Handler
962:
963: sub handler {
964: my $r=shift;
1.2 www 965:
966: if ($r->header_only) {
967: $r->content_type('text/html');
968: $r->send_http_header;
969: return OK;
970: }
971:
1.43 www 972: # Get query string for limited number of parameters
973:
1.65 harris41 974: foreach (split(/&/,$ENV{'QUERY_STRING'})) {
1.43 www 975: my ($name, $value) = split(/=/,$_);
976: $value =~ tr/+/ /;
977: $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
978: if ($name eq 'filename') {
979: unless ($ENV{'form.'.$name}) {
980: $ENV{'form.'.$name}=$value;
981: }
982: }
1.65 harris41 983: }
1.43 www 984:
985:
1.2 www 986: # -------------------------------------------------------------- Check filename
987:
988: my $fn=$ENV{'form.filename'};
989:
1.27 www 990:
1.2 www 991: unless ($fn) {
1.27 www 992: $r->log_reason($cuname.' at '.$cudom.
1.2 www 993: ' trying to publish empty filename', $r->filename);
994: return HTTP_NOT_FOUND;
995: }
1.4 www 996:
1.31 www 997: ($cuname,$cudom)=
998: &Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain'));
999: unless (($cuname) && ($cudom)) {
1.27 www 1000: $r->log_reason($cuname.' at '.$cudom.
1.4 www 1001: ' trying to publish file '.$ENV{'form.filename'}.
1.27 www 1002: ' ('.$fn.') - not authorized',
1003: $r->filename);
1004: return HTTP_NOT_ACCEPTABLE;
1005: }
1006:
1007: unless (&Apache::lonnet::homeserver($cuname,$cudom)
1008: eq $r->dir_config('lonHostID')) {
1009: $r->log_reason($cuname.' at '.$cudom.
1010: ' trying to publish file '.$ENV{'form.filename'}.
1011: ' ('.$fn.') - not homeserver ('.
1012: &Apache::lonnet::homeserver($cuname,$cudom).')',
1.4 www 1013: $r->filename);
1014: return HTTP_NOT_ACCEPTABLE;
1015: }
1.2 www 1016:
1.43 www 1017: $fn=~s/^http\:\/\/[^\/]+//;
1018: $fn=~s/^\/\~(\w+)/\/home\/$1\/public_html/;
1.2 www 1019:
1020: my $targetdir='';
1.12 www 1021: $docroot=$r->dir_config('lonDocRoot');
1.27 www 1022: if ($1 ne $cuname) {
1023: $r->log_reason($cuname.' at '.$cudom.
1.2 www 1024: ' trying to publish unowned file '.$ENV{'form.filename'}.
1025: ' ('.$fn.')',
1026: $r->filename);
1027: return HTTP_NOT_ACCEPTABLE;
1028: } else {
1.27 www 1029: $targetdir=$docroot.'/res/'.$cudom;
1.2 www 1030: }
1031:
1032:
1033: unless (-e $fn) {
1.27 www 1034: $r->log_reason($cuname.' at '.$cudom.
1.2 www 1035: ' trying to publish non-existing file '.$ENV{'form.filename'}.
1036: ' ('.$fn.')',
1037: $r->filename);
1038: return HTTP_NOT_FOUND;
1039: }
1040:
1.11 www 1041: unless ($ENV{'form.phase'} eq 'two') {
1042:
1.2 www 1043: # --------------------------------- File is there and owned, init lookup tables
1044:
1.3 www 1045: %addid=();
1046:
1047: {
1048: my $fh=Apache::File->new($r->dir_config('lonTabDir').'/addid.tab');
1049: while (<$fh>=~/(\w+)\s+(\w+)/) {
1050: $addid{$1}=$2;
1051: }
1.5 www 1052: }
1053:
1054: %nokey=();
1055:
1056: {
1057: my $fh=Apache::File->new($r->dir_config('lonIncludes').'/un_keyword.tab');
1.65 harris41 1058: while (<$fh>) {
1.5 www 1059: my $word=$_;
1060: chomp($word);
1061: $nokey{$word}=1;
1.65 harris41 1062: }
1.3 www 1063: }
1.11 www 1064:
1065: }
1066:
1.2 www 1067: # ----------------------------------------------------------- Start page output
1068:
1.1 www 1069: $r->content_type('text/html');
1070: $r->send_http_header;
1071:
1072: $r->print('<html><head><title>LON-CAPA Publishing</title></head>');
1.15 www 1073: $r->print(
1074: '<body bgcolor="#FFFFFF"><img align=right src=/adm/lonIcons/lonlogos.gif>');
1.2 www 1075: my $thisfn=$fn;
1076:
1077: # ------------------------------------------------------------- Individual file
1078: {
1079: $thisfn=~/\.(\w+)$/;
1080: my $thistype=$1;
1.65 harris41 1081: my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
1.2 www 1082:
1083: my $thistarget=$thisfn;
1084:
1085: $thistarget=~s/^\/home/$targetdir/;
1086: $thistarget=~s/\/public\_html//;
1087:
1088: my $thisdistarget=$thistarget;
1089: $thisdistarget=~s/^$docroot//;
1090:
1091: my $thisdisfn=$thisfn;
1.27 www 1092: $thisdisfn=~s/^\/home\/$cuname\/public_html\///;
1.2 www 1093:
1094: $r->print('<h2>Publishing '.
1.66 harris41 1095: &Apache::loncommon::filedescription($thistype).' <tt>'.
1.2 www 1096: $thisdisfn.'</tt></h2><b>Target:</b> <tt>'.$thisdistarget.'</tt><p>');
1.27 www 1097:
1098: if (($cuname ne $ENV{'user.name'}) || ($cudom ne $ENV{'user.domain'})) {
1099: $r->print('<h3><font color=red>Co-Author: '.$cuname.' at '.$cudom.
1100: '</font></h3>');
1101: }
1.26 www 1102:
1.65 harris41 1103: if (&Apache::loncommon::fileembstyle($thistype) eq 'ssi') {
1.28 www 1104: $r->print('<br><a href="/adm/diff?filename=/~'.$cuname.'/'.
1105: $thisdisfn.
1.26 www 1106: '&versionone=priv" target=cat>Diffs with Current Version</a><p>');
1107: }
1.11 www 1108:
1.2 www 1109: # ------------ We are publishing from $thisfn to $thistarget with $thisembstyle
1110:
1.11 www 1111: unless ($ENV{'form.phase'} eq 'two') {
1.27 www 1112: $r->print(
1113: '<hr>'.&publish($thisfn,$thistarget,$thisembstyle));
1.11 www 1114: } else {
1.27 www 1115: $r->print(
1116: '<hr>'.&phasetwo($thisfn,$thistarget,$thisembstyle,$thisdistarget));
1.11 www 1117: }
1.2 www 1118:
1.11 www 1119: }
1.1 www 1120: $r->print('</body></html>');
1.15 www 1121:
1.1 www 1122: return OK;
1123: }
1124:
1125: 1;
1126: __END__
1127:
1.66 harris41 1128: =head1 NAME
1.1 www 1129:
1.66 harris41 1130: Apache::lonpublisher - Publication Handler
1.1 www 1131:
1.66 harris41 1132: =head1 SYNOPSIS
1.1 www 1133:
1.66 harris41 1134: Invoked by /etc/httpd/conf/srm.conf:
1.1 www 1135:
1.66 harris41 1136: <Location /adm/publish>
1137: PerlAccessHandler Apache::lonacc
1138: SetHandler perl-script
1139: PerlHandler Apache::lonpublisher
1140: ErrorDocument 403 /adm/login
1141: ErrorDocument 404 /adm/notfound.html
1142: ErrorDocument 406 /adm/unauthorized.html
1143: ErrorDocument 500 /adm/errorhandler
1144: </Location>
1.1 www 1145:
1.66 harris41 1146: =head1 INTRODUCTION
1.1 www 1147:
1.66 harris41 1148: This module publishes a file. This involves gathering metadata,
1149: versioning the file, copying file from construction space to
1150: publication space, and copying metadata from construction space
1151: to publication space.
1152:
1153: This is part of the LearningOnline Network with CAPA project
1154: described at http://www.lon-capa.org.
1155:
1156: =head1 HANDLER SUBROUTINE
1157:
1158: This routine is called by Apache and mod_perl.
1159:
1160: =over 4
1161:
1162: =item *
1163:
1164: Get query string for limited number of parameters
1165:
1166: =item *
1167:
1168: Check filename
1169:
1170: =item *
1171:
1172: File is there and owned, init lookup tables
1173:
1174: =item *
1175:
1176: Start page output
1177:
1178: =item *
1179:
1180: Individual file
1181:
1182: =item *
1183:
1184: publish from $thisfn to $thistarget with $thisembstyle
1185:
1186: =back
1187:
1188: =head1 OTHER SUBROUTINES
1189:
1190: =over 4
1191:
1192: =item *
1193:
1194: metaeval() : Evaluate string with metadata
1195:
1196: =item *
1197:
1198: metaread() : Read a metadata file
1199:
1200: =item *
1201:
1202: sqltime() : convert 'time' format into a datetime sql format
1203:
1204: =item *
1205:
1206: textfield() : form field
1207:
1208: =item *
1209:
1210: hiddenfield() : form field
1211:
1212: =item *
1213:
1214: selectbox() : form field
1215:
1216: =item *
1217:
1218: urlfixup() : fixup URL (Publication Step One)
1219:
1220: =item *
1221:
1222: publish() : publish (Publication Step One)
1223:
1224: =item *
1225:
1226: phasetwo() : render second interface showing status of publication steps
1227: (Publication Step Two)
1228:
1229: =back
1230:
1231: =cut
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>