Changeset 14247


Ignore:
Timestamp:
2007-07-12T11:19:16+12:00 (17 years ago)
Author:
xiao
Message:

modification to make the disable_OAI option hidden in the GLI for Greenstone 2. Plus restore the file back to sjboddie's revision 14111.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/bin/script/buildcol.pl

    r14197 r14247  
    7373
    7474my $arguments =
    75     [ { 'name' => "disable_OAI",
    76     'desc' => "{buildcol.disable_OAI}",
    77     'type' => "flag",
    78     'reqd' => "no",
    79     'modegli' => "2" },
    80       { 'name' => "remove_empty_classifications",
     75    [ { 'name' => "remove_empty_classifications",
    8176    'desc' => "{buildcol.remove_empty_classifications}",
    8277    'type' => "flag",
     
    205200    'type' => "flag",
    206201    'reqd' => "no",
    207     'hiddengli' => "yes" }
     202    'hiddengli' => "yes" },
     203      { 'name' => "disable_OAI",
     204          'desc' => "{buildcol.disable_OAI}",
     205          'type' => "flag",
     206          'reqd' => "no",
     207          'modegli' => "2",
     208      'hiddengli' => "yes" }
    208209
    209210#      { 'name' => "incremental_dlc",
     
    353354    unshift (@INC, "$ENV{'GSDLCOLLECTDIR'}/perllib/plugins");
    354355
    355     # read the configuration file (for gs2)
    356     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg");
     356    # Read in the collection configuration file.
    357357    my ($collectcfg, $buildtype);
    358 
    359     if (-e $configfilename) {
    360       $collectcfg = &colcfg::read_collect_cfg ($configfilename);
    361       $gs_mode = "gs2"; 
    362     }
    363     else {
    364 
    365       # If it is gs3
    366       $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collectionConfig.xml");
    367 
    368       if (!-e $configfilename) {
    369     &gsprintf($out, "{common.cannot_find_cfg_file}\n", $configfilename) && die;
    370       }
    371       else {
     358    ($configfilename, $gs_mode) = &colcfg::get_collect_cfg_name($out);
     359    if ($gs_mode eq "gs2") {
     360        $collectcfg = &colcfg::read_collect_cfg ($configfilename);
     361    } elsif ($gs_mode eq "gs3") {
    372362    $collectcfg = &colcfg::read_collection_cfg_xml ($configfilename);
    373     $gs_mode = "gs3";
    374       }
    375     }
    376    
     363    }
     364
    377365    if ($verbosity !~ /\d+/) {
    378366    if (defined $collectcfg->{'verbosity'} && $collectcfg->{'verbosity'} =~ /\d+/) {
     
    441429        $remove_empty_classifications = 1;
    442430    }
    443     }   
     431    }
     432   
    444433   
    445434    if (defined $collectcfg->{'create_images'} && $collectcfg->{'create_images'} =~ /^true$/i) {
     
    465454    $gli = 0 unless defined $gli;
    466455
     456    # If the disable_OAI flag is not present, the option $disable_OAI with the value of 0 will be passed to basebuilder.pm
    467457    $disable_OAI = 0 unless defined $disable_OAI;
    468 
     458   
    469459    # New argument to track whether build is incremental
    470460    $incremental = 0 unless defined $incremental;
     
    537527    # if a builder class has been created for this collection, use it
    538528    # otherwise, use the mg or mgpp builder
    539     if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}builder.pm") {
     529    if (-e "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib/custombuilder.pm") {
     530    $builderdir = "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib";
     531    $buildertype = "custombuilder";
     532    } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/custombuilder.pm") {
     533    $builderdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
     534    $buildertype = "custombuilder";
     535    } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}builder.pm") {
    540536    $builderdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
    541537    $buildertype = "${collection}builder";
Note: See TracChangeset for help on using the changeset viewer.