- Timestamp:
- 2000-07-13T10:21:53+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_mkcol.pl
r724 r1279 1 #! /usr/local/bin/perl5-w1 #!perl -w 2 2 3 3 ########################################################################### … … 28 28 # This program is a webpage wrapper to the mkcol.pl process 29 29 30 package webpage_mkcol; 31 30 32 use CGI; 31 33 use GSDLHOME; 32 use Fcntl ':flock';34 use gflock; 33 35 34 36 require util; … … 41 43 my %args = (); 42 44 45 open (FILE, '>d:\gsdl\logout.txt') || die; 46 43 47 foreach $p ($cgi->param()) 44 48 { 45 49 $args{$p} = $cgi->param($p); 46 } 47 50 51 print FILE "webpage_mkcol.pl - $p -> $args{$p}\n"; 52 } 53 54 close FILE; 48 55 return \%args; 49 56 } … … 85 92 else 86 93 { 87 # clean up input for heuristic that derives directory name for a new collection 94 # clean up input for heuristic that derives directory name for a 95 # new collection 88 96 $fullname =~ s/\s+/ /g; 89 97 $fullname =~ tr/[A-Z]/[a-z]/; … … 149 157 my $acronyms = $args->{'bc1acronyms'}; 150 158 151 my $cmd = "mkcol.pl"; 159 my $cmd = "perl "; 160 $cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "mkcol.pl"); 152 161 $cmd .= " -title \"$fullname\""; 153 162 $cmd .= " -creator $contact_email"; 154 163 $cmd .= " -about \"$about_desc\""; 155 $cmd .= " -plugins \"GMLPlug ${src_format}Plug ArcPlug RecPlug\""; 164 $cmd .= " -plugin \"GMLPlug\""; 165 $cmd .= " -plugin \"${src_format}Plug\""; 166 $cmd .= " -plugin \"ArcPlug\""; 167 $cmd .= " -plugin \"RecPlug\""; 156 168 ### $cmd .= " -refine \"$refine_plugs\""; 157 169 $cmd .= " $unique_dirname"; 170 158 171 my $status = system($cmd); 159 172 $status /= 256; … … 162 175 { 163 176 # append copydir, file_or_url and input_dir to end of collect.cfg 177 # we'll also append DocumentUseHTML if processing HTML docs 164 178 my $cfg_filename 165 179 = &util::filename_cat($ENV{'GSDLHOME'},"collect",$unique_dirname, … … 167 181 if (open(CFGAPP,">>$cfg_filename")) 168 182 { 169 if (flock(CFGAPP,LOCK_EX)) 170 { 183 if (&gflock::lock (webpage_mkcol::CFGAPP)) { 171 184 print CFGAPP "\n"; 185 186 if ($src_format eq "HTML") { 187 print CFGAPP "format\tDocumentUseHTML\ttrue\n\n"; 188 } 189 172 190 print CFGAPP "building\tfileorurl\t$file_or_url\n"; 173 191 print CFGAPP "building\tinputdir\t$input_dir\n"; 174 192 print CFGAPP "building\tcopydir\t\t$copy_dir\n"; 175 193 print CFGAPP "building\tingsdlarea\t$in_gsdl_area\n"; 176 flock(CFGAPP,LOCK_UN);194 &gflock::unlock (webpage_mkcol::CFGAPP); 177 195 close(CFGAPP); 178 196 } … … 195 213 return; 196 214 } 197 198 199 # append dirname to end of collection config file200 my $collist_filename201 = &util::filename_cat($ENV{'GSDLHOME'},"etc","collections.txt");202 if (open(CLAPP,">>$collist_filename"))203 {204 if (flock(CLAPP,LOCK_EX))205 {206 print CLAPP "$unique_dirname\n";207 flock(CLAPP,LOCK_UN);208 close(CLAPP);209 }210 else211 {212 # problem locking file213 my $mess = "Unable to lock collection list";214 $mess .= " configuration file: $collist_filename";215 &webpageutil::error_location($args,$mess);216 close(CLAPP);217 return;218 }219 }220 else221 {222 # problem223 my $mess = "Unable to append to collection list";224 $mess .= " configuration file: $collist_filename";225 &webpageutil::error_location($args,$mess);226 return;227 }228 229 215 } 230 216 else … … 248 234 249 235 &main(); 250 251 252 253 254
Note:
See TracChangeset
for help on using the changeset viewer.