Ignore:
Timestamp:
2000-07-13T10:21:53+12:00 (24 years ago)
Author:
sjboddie
Message:

merged changes to trunk into New_Config_Format branch

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 -w
     1#!perl -w
    22
    33###########################################################################
     
    2828# This program is a webpage wrapper to the mkcol.pl process
    2929
     30package webpage_mkcol;
     31
    3032use CGI;
    3133use GSDLHOME;
    32 use Fcntl ':flock';
     34use gflock;
    3335
    3436require util;
     
    4143    my %args = ();
    4244   
     45    open (FILE, '>d:\gsdl\logout.txt') || die;
     46
    4347    foreach $p ($cgi->param())
    4448    {
    4549    $args{$p} = $cgi->param($p);
    46     }
    47 
     50
     51    print FILE "webpage_mkcol.pl - $p -> $args{$p}\n";
     52    }
     53
     54    close FILE;
    4855    return \%args;
    4956}
     
    8592    else
    8693    {
    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
    8896    $fullname =~ s/\s+/ /g;
    8997    $fullname =~ tr/[A-Z]/[a-z]/;
     
    149157    my $acronyms      = $args->{'bc1acronyms'};
    150158
    151     my $cmd = "mkcol.pl";
     159    my $cmd = "perl ";
     160    $cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "mkcol.pl");
    152161    $cmd .= " -title   \"$fullname\"";
    153162    $cmd .= " -creator $contact_email";
    154163    $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\"";
    156168### $cmd .= " -refine  \"$refine_plugs\"";
    157169    $cmd .= " $unique_dirname";
     170
    158171    my $status = system($cmd);
    159172    $status /= 256;
     
    162175    {
    163176        # append copydir, file_or_url and input_dir to end of collect.cfg
     177        # we'll also append DocumentUseHTML if processing HTML docs
    164178        my $cfg_filename
    165179        = &util::filename_cat($ENV{'GSDLHOME'},"collect",$unique_dirname,
     
    167181        if (open(CFGAPP,">>$cfg_filename"))
    168182        {
    169         if (flock(CFGAPP,LOCK_EX))
    170         {
     183        if (&gflock::lock (webpage_mkcol::CFGAPP)) {
    171184            print CFGAPP "\n";
     185
     186            if ($src_format eq "HTML") {
     187            print CFGAPP "format\tDocumentUseHTML\ttrue\n\n";
     188            }
     189
    172190            print CFGAPP "building\tfileorurl\t$file_or_url\n";
    173191            print CFGAPP "building\tinputdir\t$input_dir\n";
    174192            print CFGAPP "building\tcopydir\t\t$copy_dir\n";
    175193            print CFGAPP "building\tingsdlarea\t$in_gsdl_area\n";
    176             flock(CFGAPP,LOCK_UN);
     194            &gflock::unlock (webpage_mkcol::CFGAPP);
    177195            close(CFGAPP);
    178196        }
     
    195213        return;
    196214        }
    197 
    198 
    199         # append dirname to end of collection config file
    200         my $collist_filename
    201         = &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         else
    211         {
    212             # problem locking file
    213             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         else
    221         {
    222         # problem
    223         my $mess = "Unable to append to collection list";
    224         $mess .= " configuration file: $collist_filename";
    225         &webpageutil::error_location($args,$mess);
    226         return;
    227         }
    228        
    229215    }
    230216    else
     
    248234
    249235&main();
    250 
    251 
    252 
    253 
    254 
Note: See TracChangeset for help on using the changeset viewer.