Ignore:
Timestamp:
2003-02-26T13:05:08+13:00 (21 years ago)
Author:
kjdon
Message:

added support for mg collections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/bin/script/gs2_mkcol.pl

    r3688 r3771  
    5858    print STDOUT "                       different from the creator)\n";
    5959    print STDOUT "   -public true|false  If this collection has anonymous access\n";
     60    print STDOUT "   -buildtype mg|mgpp  Whether to use mg or mgpp to build the collection\n";
     61    print STDOUT "                       Default is mgpp.\n";
    6062    print STDOUT "   -title text         The title for the collection\n";
    6163    print STDOUT "   -about text         The about text for the collection\n";
     
    119121        $line =~ s/\*\*about\*\*/$about/g;
    120122        $line =~ s/\*\*plugins\*\*/$pluginstring/g;
     123        $line =~ s/\*\*buildtype\*\*/$buildtype/g;
     124        $line =~ s/\*\*indexes\*\*/$indexes/g;
     125        $line =~ s/\*\*defaultindex\*\*/$defaultindex/g;
     126        $line =~ s/\*\*indexmeta\*\*/$indexmeta/g;
    121127
    122128        print OUTFILE $line;
     
    139145              'maintainer/\w+\@[\w\.]+/', \$maintainer,
    140146              'public/true|false/true', \$public,
     147              'buildtype/mg|mgpp/mgpp', \$buildtype,
    141148              'title/.+/', \$title,
    142149              'about/.+/', \$about,
     
    219226
    220227    $public = "true" unless defined $public;
    221 
     228    $buildtype = "mgpp" unless defined $buildtype;
     229
     230   
    222231    if (!defined($title) || $title eq "") {
    223232    $title = $collection;
     
    247256    $cdir = &util::filename_cat ($collectdir, $collection);
    248257    } else {
    249     $cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection);
     258    $cdir = &util::filename_cat ($sitehome, "collect", $collection);
    250259    }
    251260
     
    259268    }
    260269
     270    # set up the default indexes - this could be a command line option at some stage
     271    if ($buildtype eq "mg") {
     272    $indexes = "document:text document:Title document:Source";
     273    $defaultindex = "document:text";
     274    $indexmeta = "collectionmeta .document:text    \"text\"\ncollectionmeta .document:Title  \"titles\"\ncollectionmeta .document:Source  \"filenames\"\n";
     275
     276    } elsif ($buildtype eq "mgpp") {
     277    $indexes = "text,metadata";
     278    $defaultindex = "text,metadata";
     279    $indexmeta = "collectionmeta .text,metadata    \"text\"\n";
     280    } else {
     281    print STDOUT "Error: buildtype should be mg or mgpp, but its $buildtype\n";
     282    }
    261283    # start creating the collection
    262284    print STDOUT "\nCreating the collection $collection...\n" unless $quiet;
Note: See TracChangeset for help on using the changeset viewer.