Changeset 3771 for trunk/gsdl3


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

added support for mg collections

Location:
trunk/gsdl3
Files:
3 edited

Legend:

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

    r3688 r3771  
    106106    $writer->endTag('metadataList');
    107107    }
     108
     109   
     110    #indexes
     111    my $indexmap = {};
     112    if (defined $buildcfg->{'indexmap'}) {
     113    $indexmap_t = $buildcfg->{'indexmap'};
     114    foreach $i (@$indexmap_t) {
     115        my ($k, $v) = $i =~ /^(.*)\-\>(.*)$/;
     116        $indexmap->{$k} = $v;
     117    }
     118    } else {
     119    print STDERR "indexmap not defined";
     120    }
     121    my $defaultindex;
     122    if (defined $collectcfg->{'defaultindex'}) {
     123    $defaultindex = $collectcfg->{'defaultindex'};
     124    } else {
     125    print STDERR "defaultindex not defined";
     126    }
     127    $defaultindex = $indexmap->{$defaultindex};
     128   
     129   
    108130    $writer->startTag('serviceRackList');
    109131   
     
    136158       
    137159    } elsif ($buildtype eq 'mg') {
    138         $writer->emptyTag('serviceRack', 'name'=>'GS2MGRetrieve');
     160        $writer->startTag('serviceRack', 'name'=>'GS2MGRetrieve');
     161        $writer->emptyTag('defaultIndex', 'name'=>$defaultindex);
     162        $writer->endTag('serviceRack');
    139163        $writer->startTag('serviceRack', 'name'=>'GS2MGSearch');
    140164    }
    141    
    142     #indexes
    143     my $indexmap = {};
    144     if (defined $buildcfg->{'indexmap'}) {
    145         $indexmap_t = $buildcfg->{'indexmap'};
    146         foreach $i (@$indexmap_t) {
    147         my ($k, $v) = $i =~ /^(.*)\-\>(.*)$/;
    148         $indexmap->{$k} = $v;
    149         }
    150     } else {
    151         print STDERR "indexmap not defined";
    152     }
    153     my $defaultindex;
    154     if (defined $collectcfg->{'defaultindex'}) {
    155         $defaultindex = $collectcfg->{'defaultindex'};
    156     } else {
    157         print STDERR "defaultindex not defined";
    158     }
    159     $defaultindex = $indexmap->{$defaultindex};
     165
     166
    160167    $writer->emptyTag('defaultIndex', 'name'=>$defaultindex);
    161168    $writer->startTag('indexList');
  • 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;
  • trunk/gsdl3/sites/localsite/collect/gs2model/etc/collect.cfg

    r3691 r3771  
    33public        **public**
    44
    5 buildtype     mgpp
    6 indexes       text,metadata
    7 defaultindex  text,metadata
     5buildtype     **buildtype**
     6indexes       **indexes**
     7defaultindex  **defaultindex**
    88
    99**plugins**
     
    1515collectionmeta iconcollection    ""
    1616collectionmeta collectionextra   "**about**"
    17 collectionmeta .text,metadata    "documents"
     17
     18**indexmeta**
Note: See TracChangeset for help on using the changeset viewer.