Ignore:
Timestamp:
2007-05-30T17:55:36+12:00 (17 years ago)
Author:
sjboddie
Message:

More modifications to support additional collection-level customisations
to be put in gsdl/collect/COLLECTION/custom/COLLECTION. basebuilder.pm,
classify.pm, colcfg.pm, and plugin.pm were modified to allow
collection-specific plugins, classifiers, builders, and buildprocs to
be located in the new locations. These changes should not have any effect
on existing collections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/basebuilder.pm

    r14022 r14112  
    2626package basebuilder;
    2727
     28use strict;
     29no strict 'refs'; # allow filehandles to be variables and viceversa
     30
    2831use classify;
    2932use cfgread;
     
    5659    $outhandle, $no_text, $failhandle, $gli) = @_;
    5760
    58     $outhandle = STDERR unless defined $outhandle;
     61    $outhandle = *STDERR unless defined $outhandle;
    5962    $no_text = 0 unless defined $no_text;
    60     $failhandle = STDERR unless defined $failhandle;
     63    $failhandle = *STDERR unless defined $failhandle;
    6164
    6265    # create a builder object
     
    8083    $self->{'gli'} = 0 unless defined $self->{'gli'};
    8184
    82     # read in the collection configuration file
    83     my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collect.cfg";
    84     if (-e $colcfgname) {
    85       $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname);
    86       $gs_mode = "gs2";
    87     }
    88     else {
    89       my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collectionConfig.xml";
    90       if (!-e $colcfgname) {
    91     die "mgbuilder::new - couldn't find collect.cfg for collection $collection\n";
    92       }
    93       else {
     85    # Read in the collection configuration file.
     86    my ($colcfgname);
     87    ($colcfgname, $gs_mode) = &colcfg::get_collect_cfg_name($outhandle);
     88    if ($gs_mode eq "gs2") {
     89        $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname);
     90    } elsif ($gs_mode eq "gs3") {
    9491    $self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname);
    95     $gs_mode = "gs3";
    96       }
    9792    }
    9893   
     
    192187    my ($buildprocdir, $buildproctype);
    193188    my $collection = $self->{'collection'};
    194     if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") {
     189    if (-e "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib/custombuildproc.pm") {
     190    $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib";
     191    $buildproctype = "custombuildproc";
     192    } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/custombuildproc.pm") {
     193    $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
     194    $buildproctype = "custombuildproc";
     195    } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") {
    195196    $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
    196197    $buildproctype = "${collection}buildproc";
     
    338339    my ($handle);
    339340    if ($self->{'debug'}) {
    340     $handle = STDOUT;
     341    $handle = *STDOUT;
    341342    } else {
    342343    if (!-e "$txt2db_exe" || !open (PIPEOUT, "| txt2db$exe \"$fulldbname\"")) {
     
    344345        die "builder::make_infodatabase - couldn't run $txt2db_exe\n";
    345346    }
    346     $handle = basebuilder::PIPEOUT;
     347    $handle = *PIPEOUT;
    347348    }
    348349   
Note: See TracChangeset for help on using the changeset viewer.