Changeset 36839 for main


Ignore:
Timestamp:
2022-10-19T12:29:09+13:00 (19 months ago)
Author:
kjdon
Message:

added serviceRack attribute to <search name='xxx' orthogonal='true'> - if specified, then you can write the serviceRack directly into collectionConfig serviceRackList, instead of it auto generating one (named GS2+<search_name>+Search) into buildConfig

Location:
main/trunk/greenstone2/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/buildConfigxml.pm

    r30858 r36839  
    215215
    216216    if (defined $collectcfg->{"orthogonalbuildtypes"}) {
    217     # Note the use of collectcfg, not bulidcfg
     217    # Note the use of collectcfg, not buildcfg
    218218    $settings->{'orthogonalbuildtypes'} = $collectcfg->{"orthogonalbuildtypes"};
    219219    } else {
    220220    $settings->{'orthogonalbuildtypes '}= [];
     221    }
     222    if (defined $collectcfg->{"orthogonalcustomservicerack"}) {
     223    # Note the use of collectcfg, not buildcfg
     224    $settings->{'orthogonalcustomservicerack'} = $collectcfg->{"orthogonalcustomservicerack"};
     225    } else {
     226    $settings->{'orthogonalcustomservicerack'}= {};
    221227    }
    222228
     
    616622    my $orthogonalbuildtypes = $settings->{'orthogonalbuildtypes'};
    617623
     624    #if a custom service rack has been specified, then we don't output anything here
     625    my $orthogonalcustomservicerack = $settings->{'orthogonalcustomservicerack'};
     626
    618627    foreach my $obt (@$orthogonalbuildtypes) {
    619     $obt =~ s/^(.)/\u$1/; # capitialize initial letter
    620     $obt =~ s/-(.)/\u$1/g; # change any hyphenated words to cap next letter
    621 
    622     &write_line('COLCFG', ["<serviceRack name=\"GS2", $obt, "Search\">"]);
    623 
    624     &write_line('COLCFG',["<databaseType name=\"",$infodbtype,"\" />"]); 
    625     &write_line('COLCFG', ["</serviceRack>"]);
     628        if (!defined $orthogonalcustomservicerack->{$obt}) {
     629            $obt =~ s/^(.)/\u$1/; # capitialize initial letter
     630            $obt =~ s/-(.)/\u$1/g; # change any hyphenated words to cap next letter
     631           
     632            &write_line('COLCFG', ["<serviceRack name=\"GS2", $obt, "Search\">"]);
     633           
     634            &write_line('COLCFG',["<databaseType name=\"",$infodbtype,"\" />"]); 
     635            &write_line('COLCFG', ["</serviceRack>"]);
     636            print STDERR "Outputting orthogonal service rack to buildConfig, derived name = GS2".$obt. "Search\n";
     637        } else {
     638            print STDERR "Orthogonal search specified a serviceRack: ".$orthogonalcustomservicerack->{$obt}.", make sure you have specified that in your collectionConfig.xml serviceRackList\n";
     639        }
     640       
    626641    }
    627642}
  • main/trunk/greenstone2/perllib/collConfigxml.pm

    r36375 r36839  
    113113        return undef;
    114114    }
    115 
    116115    # Removed ProtocolEncoding (see MetadataXMLPlugin for details)
    117116
     
    192191    if ((defined $orthogonal) && ($orthogonal =~ m/^(true|on|1)$/i)) {
    193192        push(@{$data->{'orthogonalbuildtypes'}},$type);
     193            my $service_rack = $_{'serviceRack'};
     194            if ((defined $service_rack) && $service_rack =~ /\w/) {
     195                $data->{'orthogonalcustomservicerack'}->{$type} = $service_rack;;
     196            }
    194197    }
    195198    else {
     
    431434    print STDERR "*** default level: ".$data->{"defaultlevel"}."\n" if (defined $data->{"defaultlevel"});
    432435    print STDERR "*** build type: ".$data->{"buildtype"}."\n" if (defined $data->{"buildtype"});
    433     print STDERR "*** orthogonal build types: ".join(",",$data->{"orthogonalbuildtypes"})."\n" if (defined $data->{"orthogonalbuildtypes"});
     436    print STDERR "*** orthogonal build types: ".join(",",@{$data->{"orthogonalbuildtypes"}})."\n" if (defined $data->{"orthogonalbuildtypes"});
     437    if (defined $data->{"orthogonalcustomservicerack"}) {     
     438        print STDERR "*** orthogonal custom service racks: \n";
     439        foreach my $s (keys %{$data->{"orthogonalcustomservicerack"}}) {
     440            print STDERR "$s -> ". $data->{"orthogonalcustomservicerack"}->{$s}."\n";
     441        }
     442    }
    434443    print STDERR "*** search types: \n";
    435444    print STDERR join(",",@{$data->{"searchtype"}})."\n" if (defined $data->{"searchtype"});
Note: See TracChangeset for help on using the changeset viewer.