Changeset 14197


Ignore:
Timestamp:
2007-06-29T11:39:37+12:00 (17 years ago)
Author:
xiao
Message:

add an argument called disable_OAI (default is 0, i.e., enable the collection for oai metadata harvesting). Pass this argument to basebuilder.pm via the new sub.

File:
1 edited

Legend:

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

    r14111 r14197  
    7373
    7474my $arguments =
    75     [ { 'name' => "remove_empty_classifications",
     75    [ { 'name' => "disable_OAI",
     76    'desc' => "{buildcol.disable_OAI}",
     77    'type' => "flag",
     78    'reqd' => "no",
     79    'modegli' => "2" },
     80      { 'name' => "remove_empty_classifications",
    7681    'desc' => "{buildcol.remove_empty_classifications}",
    7782    'type' => "flag",
     
    268273    $create_images, $collectdir, $build, $type, $textindex,
    269274    $no_strip_html, $no_text, $faillog, $gli, $index, $language,
    270     $sections_index_document_metadata, $maxnumeric, $incremental_dlc);
     275    $sections_index_document_metadata, $maxnumeric, $incremental_dlc,
     276    $disable_OAI);
    271277
    272278    my $xml = 0;
     
    347353    unshift (@INC, "$ENV{'GSDLCOLLECTDIR'}/perllib/plugins");
    348354
    349     # Read in the collection configuration file.
     355    # read the configuration file (for gs2)
     356    $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg");
    350357    my ($collectcfg, $buildtype);
    351     ($configfilename, $gs_mode) = &colcfg::get_collect_cfg_name($out);
    352     if ($gs_mode eq "gs2") {
    353         $collectcfg = &colcfg::read_collect_cfg ($configfilename);
    354     } elsif ($gs_mode eq "gs3") {
     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 {
    355372    $collectcfg = &colcfg::read_collection_cfg_xml ($configfilename);
    356     }
    357 
     373    $gs_mode = "gs3";
     374      }
     375    }
     376   
    358377    if ($verbosity !~ /\d+/) {
    359378    if (defined $collectcfg->{'verbosity'} && $collectcfg->{'verbosity'} =~ /\d+/) {
     
    422441        $remove_empty_classifications = 1;
    423442    }
    424     }
    425    
     443    }   
    426444   
    427445    if (defined $collectcfg->{'create_images'} && $collectcfg->{'create_images'} =~ /^true$/i) {
     
    446464 
    447465    $gli = 0 unless defined $gli;
     466
     467    $disable_OAI = 0 unless defined $disable_OAI;
    448468
    449469    # New argument to track whether build is incremental
     
    517537    # if a builder class has been created for this collection, use it
    518538    # otherwise, use the mg or mgpp builder
    519     if (-e "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib/custombuilder.pm") {
    520     $builderdir = "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib";
    521     $buildertype = "custombuilder";
    522     } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/custombuilder.pm") {
    523     $builderdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
    524     $buildertype = "custombuilder";
    525     } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}builder.pm") {
     539    if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}builder.pm") {
    526540    $builderdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
    527541    $buildertype = "${collection}builder";
     
    545559     "\$maxdocs, \$debug, \$keepold, \$incremental, \$incremental_dlc, " .
    546560     "\$remove_empty_classifications, " .
    547      "\$out, \$no_text, \$faillog, \$gli)");
     561     "\$out, \$no_text, \$faillog, \$gli, \$disable_OAI)");
    548562    die "$@" if $@;
    549563
Note: See TracChangeset for help on using the changeset viewer.