[15600] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
[20096] | 3 | # buildConfigxml.pm --
|
---|
[15600] | 4 | # A component of the Greenstone digital library software
|
---|
| 5 | # from the New Zealand Digital Library Project at the
|
---|
| 6 | # University of Waikato, New Zealand.
|
---|
| 7 | #
|
---|
| 8 | # Copyright (C) 1999 New Zealand Digital Library Project
|
---|
| 9 | #
|
---|
| 10 | # This program is free software; you can redistribute it and/or modify
|
---|
| 11 | # it under the terms of the GNU General Public License as published by
|
---|
| 12 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 13 | # (at your option) any later version.
|
---|
| 14 | #
|
---|
| 15 | # This program is distributed in the hope that it will be useful,
|
---|
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 18 | # GNU General Public License for more details.
|
---|
| 19 | #
|
---|
| 20 | # You should have received a copy of the GNU General Public License
|
---|
| 21 | # along with this program; if not, write to the Free Software
|
---|
| 22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 23 | #
|
---|
| 24 | ###########################################################################
|
---|
[14741] | 25 |
|
---|
[20105] | 26 | # reads in buildConfig.xml
|
---|
| 27 | # Note, only implemented the bits that are currently used, eg by incremental
|
---|
| 28 | # build code.
|
---|
| 29 | # The resulting data is not a full representation on buildConfig.xml.
|
---|
[15600] | 30 |
|
---|
[20096] | 31 | package buildConfigxml;
|
---|
[20105] | 32 |
|
---|
[15600] | 33 | use strict;
|
---|
| 34 | no strict 'refs';
|
---|
| 35 | no strict 'subs';
|
---|
| 36 |
|
---|
[23895] | 37 | use XMLParser;
|
---|
[15600] | 38 |
|
---|
| 39 |
|
---|
[17895] | 40 | # A mapping hash to resolve name discrepancy between gs2 and gs3.
|
---|
[20105] | 41 | my $nameMap = {"numDocs" => "numdocs",
|
---|
[24464] | 42 | "buildType" => "buildtype",
|
---|
| 43 | "orthogonalBuildTypes" => "orthogonalbuildtypes"
|
---|
[15600] | 44 | };
|
---|
[20105] | 45 |
|
---|
| 46 |
|
---|
[15600] | 47 | # A hash structure which is returned by sub read_cfg_file.
|
---|
| 48 | my $data = {};
|
---|
| 49 |
|
---|
| 50 | # use those unique attribute values to locate the text within the elements
|
---|
| 51 | my $currentLocation = "";
|
---|
[20105] | 52 | my $stringexp = q/^(buildType|numDocs)$/;
|
---|
[24464] | 53 | my $arrayexp = q/^(orthogonalBuildTypes)$/;
|
---|
| 54 |
|
---|
[20105] | 55 | my $indexmap_name = "";
|
---|
| 56 | my $haveindexfields = 0;
|
---|
[15600] | 57 |
|
---|
[20105] | 58 | # Reads in the model collection configuration file, collectionConfig.xml,
|
---|
| 59 | # into a structure which complies with the one used by gs2 (i.e. one read
|
---|
| 60 | # in by &cfgread::read_cfg_file).
|
---|
| 61 | sub read_cfg_file {
|
---|
| 62 | my ($filename) = @_;
|
---|
| 63 | $data = {};
|
---|
| 64 | if ($filename !~ /buildConfig\.xml$/ || !-f $filename) {
|
---|
| 65 | return undef;
|
---|
| 66 | }
|
---|
[15600] | 67 |
|
---|
[23895] | 68 | # Removed ProtocolEncoding (see MetadataXMLPlugin for details)
|
---|
| 69 |
|
---|
[20105] | 70 | # create XML::Parser object for parsing metadata.xml files
|
---|
[23895] | 71 | my $parser = new XML::Parser('Style' => 'Stream',
|
---|
| 72 | 'Pkg' => 'buildConfigxml',
|
---|
| 73 | 'Handlers' => {'Char' => \&Char,
|
---|
[20105] | 74 | 'Doctype' => \&Doctype
|
---|
| 75 | });
|
---|
[15600] | 76 |
|
---|
[20105] | 77 | if (!open (COLCFG, $filename)) {
|
---|
| 78 | print STDERR "buildConfigxml::read_cfg_file couldn't read the cfg file $filename\n";
|
---|
| 79 | } else {
|
---|
[15600] | 80 |
|
---|
[20105] | 81 | $parser->parsefile ($filename);# (COLCFG);
|
---|
| 82 | close (COLCFG);
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 | #&Display;
|
---|
| 86 | return $data;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
[15600] | 89 | sub StartTag {
|
---|
| 90 | # Those marked with #@ will not be executed at the same time when this sub is being called
|
---|
| 91 | # so that if/elsif is used to avoid unnecessary tests
|
---|
| 92 | my ($expat, $element) = @_;
|
---|
[15619] | 93 |
|
---|
[15600] | 94 | my $name = $_{'name'};
|
---|
[20105] | 95 | my $shortname = $_{'shortname'};
|
---|
[15600] | 96 |
|
---|
[20105] | 97 |
|
---|
[15600] | 98 | #@ handling block metadataList
|
---|
[24464] | 99 | if (defined $name && (($name =~ m/$stringexp/) || ($name =~ m/$arrayexp/))) {
|
---|
[15600] | 100 | $currentLocation = $name;
|
---|
[20105] | 101 | # the value will be retrieved later in Text sub
|
---|
[15600] | 102 | }
|
---|
| 103 |
|
---|
[25758] | 104 | #@ handle indexes - store indexmap (mg) or indexfields and indexfieldmap (mgpp/lucene/solr)
|
---|
[20105] | 105 | elsif ($element =~ /^indexList$/) {
|
---|
| 106 | # set up the data arrays
|
---|
| 107 | # this assumes that the build type has been read already, which is
|
---|
| 108 | # currently the order we save the file in.
|
---|
| 109 | if ($data->{'buildtype'} eq "mg") {
|
---|
| 110 | $indexmap_name = "indexmap";
|
---|
| 111 | if (!defined $data->{"indexmap"}) {
|
---|
| 112 | $data->{"indexmap"} = [];
|
---|
| 113 | }
|
---|
[15619] | 114 | }
|
---|
[20105] | 115 | else {
|
---|
[25758] | 116 | # mgpp, lucene or solr
|
---|
[20105] | 117 | $indexmap_name = "indexfieldmap";
|
---|
| 118 | $haveindexfields = 1;
|
---|
| 119 | if (!defined $data->{"indexfieldmap"}) {
|
---|
| 120 | $data->{"indexfieldmap"} = [];
|
---|
| 121 | }
|
---|
| 122 | if (!defined $data->{"indexfields"}) {
|
---|
| 123 | $data->{"indexfields"} = [];
|
---|
| 124 | }
|
---|
[17895] | 125 |
|
---|
[20105] | 126 | }
|
---|
| 127 |
|
---|
[17895] | 128 | }
|
---|
[15619] | 129 |
|
---|
[20105] | 130 | elsif ($element =~ /index/) {
|
---|
| 131 | # store each index in the map
|
---|
| 132 | if (defined $name && defined $shortname) {
|
---|
| 133 | push @{$data->{$indexmap_name}}, "$name->$shortname";
|
---|
| 134 | if ($haveindexfields) {
|
---|
| 135 | push @{$data->{'indexfields'}}, $name;
|
---|
| 136 | }
|
---|
[15600] | 137 | }
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 |
|
---|
| 141 | }
|
---|
| 142 |
|
---|
| 143 | sub EndTag {
|
---|
| 144 | my ($expat, $element) = @_;
|
---|
| 145 | }
|
---|
| 146 |
|
---|
| 147 | sub Text {
|
---|
[15619] | 148 | if (defined $currentLocation) {
|
---|
[20105] | 149 | #@ Handling block metadataList(numDocs, buildType)
|
---|
[24464] | 150 | if ($currentLocation =~ /$stringexp/) {
|
---|
[15619] | 151 | #print $currentLocation;
|
---|
| 152 | my $key = $nameMap->{$currentLocation};
|
---|
| 153 | $data->{$key} = $_;
|
---|
| 154 | undef $currentLocation;
|
---|
[20105] | 155 | }
|
---|
[24464] | 156 | elsif ($currentLocation =~ /$arrayexp/) {
|
---|
| 157 | #print $currentLocation;
|
---|
| 158 | my $key = $nameMap->{$currentLocation};
|
---|
| 159 | push(@{$data->{$key}},$_);
|
---|
| 160 | undef $currentLocation;
|
---|
| 161 | }
|
---|
| 162 |
|
---|
[15619] | 163 | }
|
---|
[15600] | 164 | }
|
---|
[15619] | 165 |
|
---|
[15600] | 166 | # This sub is for debugging purposes
|
---|
| 167 | sub Display {
|
---|
[20105] | 168 |
|
---|
| 169 | print "NumDocs = ".$data->{'numdocs'}."\n" if (defined $data->{'numdocs'});
|
---|
| 170 | print "BuildType = ".$data->{'buildtype'}."\n" if (defined $data->{'buildtype'});
|
---|
[24464] | 171 | print "OrthogonalBuildTypes = ".join(",",@{$data->{'orthogonalbuildtypes'}})."\n" if (defined $data->{'orthogonalbuildtypes'});
|
---|
[20105] | 172 | print "IndexMap = ". join(" ",@{$data->{'indexmap'}})."\n" if (defined $data->{'indexmap'});
|
---|
| 173 | print "IndexFieldMap = ". join(" ",@{$data->{'indexfieldmap'}})."\n" if (defined $data->{'indexfieldmap'});
|
---|
| 174 | print "IndexFields = ". join(" ",@{$data->{'indexfields'}})."\n" if (defined $data->{'indexfields'});
|
---|
| 175 |
|
---|
[15600] | 176 | }
|
---|
[20105] | 177 |
|
---|
| 178 | # is this actually used??
|
---|
[15600] | 179 | sub Doctype {
|
---|
| 180 | my ($expat, $name, $sysid, $pubid, $internal) = @_;
|
---|
| 181 |
|
---|
[20105] | 182 | die if ($name !~ /^buildConfig$/);
|
---|
[15600] | 183 | }
|
---|
| 184 |
|
---|
| 185 | # This Char function overrides the one in XML::Parser::Stream to overcome a
|
---|
| 186 | # problem where $expat->{Text} is treated as the return value, slowing
|
---|
| 187 | # things down significantly in some cases.
|
---|
| 188 | sub Char {
|
---|
| 189 | if ($]<5.008) {
|
---|
| 190 | use bytes; # Necessary to prevent encoding issues with XML::Parser 2.31+ and Perl 5.6
|
---|
| 191 | }
|
---|
| 192 | $_[0]->{'Text'} .= $_[1];
|
---|
| 193 | return undef;
|
---|
| 194 | }
|
---|
[15619] | 195 |
|
---|
[15600] | 196 |
|
---|
| 197 |
|
---|
| 198 | sub write_line {
|
---|
| 199 | my ($filehandle, $line) = @_;
|
---|
| 200 | print $filehandle join ("", @$line), "\n";
|
---|
| 201 | }
|
---|
| 202 |
|
---|
[24464] | 203 | sub search_and_retrieve_settings
|
---|
| 204 | {
|
---|
| 205 | my ($buildcfg,$collectcfg) = @_;
|
---|
[15600] | 206 |
|
---|
[24464] | 207 | my $settings = {};
|
---|
[15600] | 208 |
|
---|
| 209 | if (defined $buildcfg->{"buildtype"}) {
|
---|
[24464] | 210 | $settings->{'buildtype'} = $buildcfg->{"buildtype"};
|
---|
[15600] | 211 | } else {
|
---|
[24464] | 212 | $settings->{'buildtype'} = "mgpp";
|
---|
[15600] | 213 | }
|
---|
[24464] | 214 | my $buildtype = $settings->{'buildtype'};
|
---|
| 215 |
|
---|
| 216 | if (defined $collectcfg->{"orthogonalbuildtypes"}) {
|
---|
| 217 | # Note the use of collectcfg, not bulidcfg
|
---|
| 218 | $settings->{'orthogonalbuildtypes'} = $collectcfg->{"orthogonalbuildtypes"};
|
---|
| 219 | } else {
|
---|
| 220 | $settings->{'orthogonalbuildtypes '}= [];
|
---|
| 221 | }
|
---|
| 222 |
|
---|
[15600] | 223 | if (defined $buildcfg->{"numdocs"}) {
|
---|
[24464] | 224 | $settings->{'numdocs'} = $buildcfg->{"numdocs"};
|
---|
[15600] | 225 | }
|
---|
[24464] | 226 | else {
|
---|
| 227 | $settings->{'numdocs'} = 0;
|
---|
[21783] | 228 | }
|
---|
[23939] | 229 |
|
---|
[15600] | 230 | my $service_type = "MGPP";
|
---|
| 231 | if ($buildtype eq "mg") {
|
---|
| 232 | $service_type = "MG";
|
---|
| 233 | } elsif ($buildtype eq "lucene") {
|
---|
| 234 | $service_type = "Lucene";
|
---|
[25758] | 235 | } elsif ($buildtype eq "solr") {
|
---|
| 236 | $service_type = "Solr";
|
---|
[15600] | 237 | }
|
---|
[24464] | 238 | $settings->{'service_type'} = $service_type;
|
---|
[15600] | 239 |
|
---|
| 240 |
|
---|
[24464] | 241 | if (defined $buildcfg->{"infodbtype"}) {
|
---|
| 242 | $settings->{'infodbtype'} = $buildcfg->{'infodbtype'};
|
---|
[15600] | 243 | }
|
---|
[24464] | 244 | else {
|
---|
| 245 | $settings->{'infodbtype'} = "gdbm";
|
---|
[21439] | 246 | }
|
---|
[15600] | 247 |
|
---|
[24464] | 248 |
|
---|
| 249 | #--
|
---|
| 250 | # indexes
|
---|
| 251 | #--
|
---|
[15600] | 252 |
|
---|
[24464] | 253 | my $indexmap = {}; # maps index name to shortname
|
---|
| 254 | my $indexlist = []; # keeps the order for indexes
|
---|
[15600] | 255 | my $defaultindex = "";
|
---|
[24464] | 256 | my $maptype = ($buildtype eq "mg") ? "indexmap" : "indexfieldmap";
|
---|
[15600] | 257 |
|
---|
| 258 | if (defined $buildcfg->{$maptype}) {
|
---|
[24464] | 259 | my $first = 1;
|
---|
[15600] | 260 | my $indexmap_t = $buildcfg->{$maptype};
|
---|
[24464] | 261 | foreach my $i (@$indexmap_t) {
|
---|
| 262 | my ($k, $v) = $i =~ /^(.*)\-\>(.*)$/;
|
---|
[15600] | 263 | $indexmap->{$k} = $v;
|
---|
[24464] | 264 | push @$indexlist, $k;
|
---|
[15600] | 265 | if ($first) {
|
---|
| 266 | $defaultindex = $v;
|
---|
| 267 | $first = 0;
|
---|
[24464] | 268 | }
|
---|
[15600] | 269 | }
|
---|
[24464] | 270 | # now if the user has assigned a default index, we use it
|
---|
[15600] | 271 | if (defined $collectcfg->{"defaultindex"}) {
|
---|
[24464] | 272 | $defaultindex = $indexmap->{$collectcfg->{"defaultindex"}};
|
---|
[15600] | 273 | }
|
---|
| 274 | } else {
|
---|
[26094] | 275 | print STDERR "$maptype not defined\n";
|
---|
[24464] | 276 | }
|
---|
[15600] | 277 |
|
---|
[26094] | 278 | $settings->{'num_indexes'} = $buildcfg->{'num_indexes'};
|
---|
[24464] | 279 | $settings->{'defaultindex'} = $defaultindex;
|
---|
| 280 | $settings->{'indexmap'} = $indexmap;
|
---|
| 281 | $settings->{'indexlist'} = $indexlist;
|
---|
| 282 |
|
---|
| 283 | #--
|
---|
| 284 | # default lang
|
---|
| 285 | #--
|
---|
| 286 | $settings->{'default_lang'} = "";
|
---|
| 287 | $settings->{'default_lang_short'} = "";
|
---|
| 288 |
|
---|
| 289 | if (defined $buildcfg->{"languagemap"}) {
|
---|
| 290 | my $langmap_t = $buildcfg->{"languagemap"};
|
---|
| 291 | if ((defined $langmap_t) && (scalar(@$langmap_t)>=1)) {
|
---|
| 292 | my $l = $langmap_t->[0];
|
---|
| 293 | my ($k, $v) = $l =~ m/^(.*)\-\>(.*)$/;
|
---|
| 294 | $settings->{'default_lang'} = $k; #name
|
---|
| 295 | $settings->{'default_lang_short'} = $v; #short name
|
---|
| 296 | }
|
---|
| 297 |
|
---|
| 298 | # now if the user has assigned a default language (as "en", "ru" etc.)
|
---|
| 299 | if (defined $collectcfg->{"defaultlanguage"}) {
|
---|
| 300 | $settings->{'default_lang'} = $collectcfg->{"defaultlanguage"};
|
---|
| 301 | # what about default_lang_short ?? ####
|
---|
| 302 | }
|
---|
[22485] | 303 | }
|
---|
[15600] | 304 |
|
---|
[24464] | 305 | # default subcol
|
---|
| 306 | $settings->{'default_subcol'} = "";
|
---|
| 307 | if (defined $buildcfg->{'subcollectionmap'}) {
|
---|
| 308 | my $subcolmap_t = $buildcfg->{'subcollectionmap'};
|
---|
| 309 | if ((defined $subcolmap_t) && (scalar(@$subcolmap_t)>=1)) {
|
---|
| 310 | my $l = $subcolmap_t->[0];
|
---|
| 311 | my ($k, $v) = $l =~ m/^(.*)\-\>(.*)$/;
|
---|
[20065] | 312 |
|
---|
[24464] | 313 | $settings->{'default_subcol'} = $v;
|
---|
[15600] | 314 | }
|
---|
| 315 | }
|
---|
| 316 |
|
---|
[24464] | 317 |
|
---|
| 318 | #--
|
---|
| 319 | # indexstem
|
---|
| 320 | #--
|
---|
| 321 | if (defined $buildcfg->{'indexstem'}) {
|
---|
| 322 | $settings->{'indexstem'} = $buildcfg->{'indexstem'};
|
---|
| 323 | }
|
---|
| 324 |
|
---|
| 325 | #--
|
---|
| 326 | # levelList
|
---|
| 327 | #--
|
---|
| 328 |
|
---|
[15600] | 329 | my $levelmap = {};
|
---|
[24464] | 330 | my $levellist = [];
|
---|
[15600] | 331 | my $default_search_level = "Doc";
|
---|
| 332 | my $default_retrieve_level = "Doc";
|
---|
[15685] | 333 | my $default_db_level = "Doc";
|
---|
[24464] | 334 |
|
---|
[25758] | 335 | if ($buildtype eq "mgpp" || $buildtype eq "lucene" || $buildtype eq "solr") {
|
---|
[15600] | 336 | if (defined $buildcfg->{'levelmap'}) {
|
---|
[24464] | 337 | my $first = 1;
|
---|
| 338 |
|
---|
[15600] | 339 | my $levelmap_t = $buildcfg->{'levelmap'};
|
---|
| 340 | foreach my $l (@$levelmap_t) {
|
---|
| 341 | my ($key, $val) = $l =~ /^(.*)\-\>(.*)$/;
|
---|
| 342 | $levelmap->{$key} = $val;
|
---|
[24464] | 343 | push @$levellist, $key;
|
---|
[15600] | 344 | if ($first) {
|
---|
| 345 | # let default search level follow the first level in the level list
|
---|
| 346 | $default_search_level = $val;
|
---|
[15685] | 347 | # retrieve/database levels may get modified later if text level is defined
|
---|
[15600] | 348 | $default_retrieve_level = $val;
|
---|
[15685] | 349 | $default_db_level = $val;
|
---|
[15600] | 350 | $first = 0;
|
---|
| 351 | }
|
---|
| 352 | }
|
---|
| 353 | }
|
---|
| 354 | # the default level assigned by the user is no longer ignored [Shaoqun], but the retrievel level stays the same.
|
---|
[26094] | 355 | if (defined $collectcfg->{"defaultlevel"}) {
|
---|
| 356 | $default_search_level = $levelmap->{$collectcfg->{"defaultlevel"}};
|
---|
[15600] | 357 | # $default_retrieve_level = $default_search_level;
|
---|
[26094] | 358 | }
|
---|
[15600] | 359 |
|
---|
| 360 | if (defined $buildcfg->{'textlevel'}) {
|
---|
[15685] | 361 | # let the retrieve/database levels always follow the textlevel
|
---|
[15600] | 362 | $default_retrieve_level = $buildcfg->{'textlevel'};
|
---|
[15685] | 363 | $default_db_level = $buildcfg->{'textlevel'};
|
---|
[15600] | 364 |
|
---|
| 365 | }
|
---|
| 366 | }
|
---|
[24464] | 367 | $settings->{'levelmap'} = $levelmap;
|
---|
| 368 | $settings->{'levellist'} = $levellist;
|
---|
[26094] | 369 | $settings->{'default_search_level'} = $default_search_level if $default_search_level;
|
---|
[24464] | 370 | $settings->{'default_retrieve_level'} = $default_retrieve_level;
|
---|
| 371 | $settings->{'default_db_level'} = $default_db_level;
|
---|
| 372 |
|
---|
[27803] | 373 | # sort field list
|
---|
| 374 | ######
|
---|
| 375 |
|
---|
| 376 | my $sortmap = {}; # maps index name to shortname
|
---|
| 377 | my $sortlist = []; # keeps the order for indexes
|
---|
[29422] | 378 | my $defaultsort = "";
|
---|
[27803] | 379 |
|
---|
| 380 | if (defined ($buildcfg->{"indexsortfieldmap"})) {
|
---|
[29422] | 381 | my $first = 1;
|
---|
| 382 |
|
---|
[27803] | 383 | my $sortmap_t = $buildcfg->{"indexsortfieldmap"};
|
---|
| 384 | foreach my $s (@$sortmap_t) {
|
---|
| 385 | my ($k, $v) = $s =~ /^(.*)\-\>(.*)$/;
|
---|
[29422] | 386 | $sortmap->{$k} = $v;
|
---|
[27803] | 387 | $sortmap->{$v} = $k;
|
---|
[29422] | 388 | if ($first) {
|
---|
| 389 | $defaultsort = $v;
|
---|
| 390 | $first = 0;
|
---|
| 391 | }
|
---|
[27803] | 392 | }
|
---|
| 393 | }
|
---|
| 394 | if (defined ($buildcfg->{"indexsortfields"})) {
|
---|
| 395 | $sortlist = $buildcfg->{"indexsortfields"};
|
---|
| 396 | }
|
---|
| 397 |
|
---|
[29422] | 398 | if (defined $collectcfg->{"defaultsort"}) {
|
---|
| 399 | $defaultsort = $sortmap->{$collectcfg->{"defaultsort"}};
|
---|
| 400 | }
|
---|
[27803] | 401 | $settings->{'sortlist'} = $sortlist;
|
---|
| 402 | $settings->{'sortmap'} = $sortmap;
|
---|
[29422] | 403 | $settings->{'defaultsort'} = $defaultsort;
|
---|
[27803] | 404 |
|
---|
[27818] | 405 | # facet field list
|
---|
| 406 | ######
|
---|
[27803] | 407 |
|
---|
[27818] | 408 | my $facetmap = {}; # maps index name to shortname
|
---|
| 409 | my $facetlist = []; # keeps the order for indexes
|
---|
[27803] | 410 |
|
---|
[27818] | 411 | if (defined ($buildcfg->{"indexfacetfieldmap"})) {
|
---|
| 412 | my $facetmap_t = $buildcfg->{"indexfacetfieldmap"};
|
---|
| 413 | foreach my $s (@$facetmap_t) {
|
---|
| 414 | my ($k, $v) = $s =~ /^(.*)\-\>(.*)$/;
|
---|
| 415 | $facetmap->{$v} = $k;
|
---|
| 416 | }
|
---|
| 417 | }
|
---|
| 418 | if (defined ($buildcfg->{"indexfacetfields"})) {
|
---|
| 419 | $facetlist = $buildcfg->{"indexfacetfields"};
|
---|
| 420 | }
|
---|
| 421 |
|
---|
| 422 | $settings->{'facetlist'} = $facetlist;
|
---|
| 423 | $settings->{'facetmap'} = $facetmap;
|
---|
| 424 |
|
---|
| 425 |
|
---|
[24464] | 426 | return $settings;
|
---|
| 427 | }
|
---|
| 428 |
|
---|
| 429 |
|
---|
| 430 | sub write_search_servicerack
|
---|
| 431 | {
|
---|
| 432 | my ($buildcfg,$settings) = @_;
|
---|
| 433 |
|
---|
| 434 | my $buildtype = $settings->{'buildtype'};
|
---|
| 435 | my $infodbtype = $settings->{'infodbtype'};
|
---|
| 436 | my $service_type = $settings->{'service_type'};
|
---|
| 437 |
|
---|
[26094] | 438 | # there's no searching and therefore no search services if there are no indexes
|
---|
| 439 | return if($settings->{'num_indexes'} <= 0);
|
---|
| 440 |
|
---|
[24464] | 441 | # do the search service
|
---|
| 442 | &write_line('COLCFG', ["<serviceRack name=\"GS2", $service_type, "Search\">"]);
|
---|
| 443 | if (defined $buildcfg->{'indexstem'}) {
|
---|
| 444 | my $indexstem = $buildcfg->{'indexstem'};
|
---|
| 445 | &write_line('COLCFG', ["<indexStem name=\"", $indexstem, "\" />"]);
|
---|
| 446 | }
|
---|
| 447 | if (defined $buildcfg->{'infodbtype'}) {
|
---|
| 448 | &write_line('COLCFG', ["<databaseType name=\"", $infodbtype, "\" />"]);
|
---|
| 449 | }
|
---|
| 450 |
|
---|
| 451 | #indexes
|
---|
| 452 | my $indexmap = $settings->{'indexmap'};
|
---|
| 453 | my $indexlist = $settings->{'indexlist'};
|
---|
| 454 | my $defaultindex = $settings->{'defaultindex'};
|
---|
| 455 |
|
---|
| 456 | #for each index in indexList, write them out
|
---|
| 457 | &write_line('COLCFG', ["<indexList>"]);
|
---|
| 458 | foreach my $i (@$indexlist) {
|
---|
| 459 | my $index = $indexmap->{$i};
|
---|
| 460 | &write_line('COLCFG', ["<index name=\"", $i, "\" ", "shortname=\"", $index, "\" />"]);
|
---|
| 461 | }
|
---|
| 462 | &write_line('COLCFG', ["</indexList>"]);
|
---|
| 463 |
|
---|
| 464 |
|
---|
| 465 | #$defaultindex = "ZZ" if (!$defaultindex); # index allfields by default
|
---|
| 466 | if ($defaultindex) {
|
---|
| 467 | &write_line('COLCFG', ["<defaultIndex shortname=\"", $defaultindex, "\" />"]);
|
---|
| 468 | }
|
---|
| 469 |
|
---|
| 470 |
|
---|
| 471 | # do indexOptionList
|
---|
| 472 | if ($buildtype eq "mg" || $buildtype eq "mgpp") {
|
---|
| 473 | &write_line('COLCFG', ["<indexOptionList>"]);
|
---|
| 474 | my $stemindexes = 3; # default is stem and casefold
|
---|
| 475 | if (defined $buildcfg->{'stemindexes'} && $buildcfg->{'stemindexes'} =~ /^\d+$/ ) {
|
---|
| 476 | $stemindexes = $buildcfg->{'stemindexes'};
|
---|
| 477 | }
|
---|
| 478 | &write_line('COLCFG', ["<indexOption name=\"stemIndexes\" value=\"", $stemindexes, "\" />"]);
|
---|
| 479 |
|
---|
| 480 | my $maxnumeric = 4; # default
|
---|
| 481 | if (defined $buildcfg->{'maxnumeric'} && $buildcfg->{'maxnumeric'} =~ /^\d+$/) {
|
---|
| 482 | $maxnumeric = $buildcfg->{'maxnumeric'};
|
---|
| 483 | }
|
---|
| 484 | &write_line('COLCFG', ["<indexOption name=\"maxnumeric\" value=\"", $maxnumeric, "\" />"]);
|
---|
| 485 | &write_line('COLCFG', ["</indexOptionList>"]);
|
---|
| 486 | }
|
---|
| 487 |
|
---|
| 488 | #--
|
---|
| 489 | # levelList
|
---|
| 490 | #--
|
---|
| 491 | my $levelmap = $settings->{'levelmap'};
|
---|
| 492 | my $levellist = $settings->{'levellist'};
|
---|
| 493 | my $default_search_level = $settings->{'default_search_level'};
|
---|
| 494 | my $default_retrieve_level = $settings->{'default_retrieve_level'};
|
---|
| 495 | my $default_db_level = $settings->{'default_db_level'};
|
---|
| 496 |
|
---|
[15600] | 497 | #for each level in levelList, write them out
|
---|
[21783] | 498 | if ($buildtype ne "mg") {
|
---|
[24464] | 499 | &write_line('COLCFG', ["<levelList>"]);
|
---|
| 500 | foreach my $lv (@$levellist) {
|
---|
| 501 | my $level = $levelmap->{$lv};
|
---|
| 502 | &write_line('COLCFG', ["<level name=\"", $lv, "\" shortname=\"", $level, "\" />"]);
|
---|
| 503 | }
|
---|
| 504 | &write_line('COLCFG', ["</levelList>"]);
|
---|
[15600] | 505 | }
|
---|
| 506 | # add in defaultLevel as the same level as indexLevelList, making the reading job easier
|
---|
[25758] | 507 | if ($buildtype eq "lucene" || $buildtype eq "mgpp" || $buildtype eq "solr") {
|
---|
[15600] | 508 | &write_line('COLCFG', ["<defaultLevel shortname=\"", $default_search_level, "\" />"]);
|
---|
| 509 | }
|
---|
[25758] | 510 | if ($buildtype eq "lucene" || $buildtype eq "mgpp" || $buildtype eq "solr") {
|
---|
[15685] | 511 | &write_line('COLCFG', ["<defaultDBLevel shortname=\"", $default_db_level, "\" />"]);
|
---|
[15600] | 512 | }
|
---|
[27803] | 513 |
|
---|
| 514 | # do sort list
|
---|
| 515 | if ($buildtype eq "lucene" || $buildtype eq "solr") {
|
---|
| 516 | my $sortlist = $settings->{'sortlist'};
|
---|
| 517 | my $sortmap = $settings->{'sortmap'};
|
---|
| 518 | &write_line('COLCFG', ["<sortList>"]);
|
---|
| 519 | foreach my $sf (@$sortlist) {
|
---|
[28033] | 520 | my $sortf;
|
---|
| 521 | if ($sf eq "rank" || $sf eq "none") {
|
---|
| 522 | $sortf = $sf;
|
---|
| 523 | } else {
|
---|
| 524 | $sortf = $sortmap->{$sf};
|
---|
| 525 | }
|
---|
[29540] | 526 | &write_line('COLCFG', ["<sort name=\"", $sortf, "\" shortname=\"", $sf, "\" />"]);
|
---|
[28033] | 527 |
|
---|
[27803] | 528 | }
|
---|
| 529 | &write_line('COLCFG', ["</sortList>"]);
|
---|
[29422] | 530 | &write_line('COLCFG', ["<defaultSort shortname=\"", $settings->{'defaultsort'}, "\" />"]);
|
---|
[27803] | 531 | }
|
---|
| 532 |
|
---|
| 533 | # do facet list
|
---|
| 534 | if ($buildtype eq "solr") {
|
---|
| 535 | &write_line('COLCFG', ["<facetList>"]);
|
---|
| 536 | my $facetlist = $settings->{'facetlist'};
|
---|
| 537 | my $facetmap = $settings->{'facetmap'};
|
---|
| 538 | foreach my $ff (@$facetlist) {
|
---|
| 539 | my $facetf = $facetmap->{$ff};
|
---|
[27818] | 540 | &write_line('COLCFG', ["<facet name=\"", $facetf, "\" shortname=\"", $ff, "\" />"]);
|
---|
[27803] | 541 | }
|
---|
| 542 | &write_line('COLCFG', ["</facetList>"]);
|
---|
| 543 | }
|
---|
[15600] | 544 | # do searchTypeList
|
---|
[25758] | 545 | if ($buildtype eq "mgpp" || $buildtype eq "lucene" || $buildtype eq "solr") {
|
---|
[15600] | 546 | &write_line('COLCFG', ["<searchTypeList>"]);
|
---|
| 547 |
|
---|
| 548 | if (defined $buildcfg->{"searchtype"}) {
|
---|
| 549 | my $searchtype_t = $buildcfg->{"searchtype"};
|
---|
| 550 | foreach my $s (@$searchtype_t) {
|
---|
| 551 | &write_line('COLCFG', ["<searchType name=\"", $s, "\" />"]);
|
---|
| 552 | }
|
---|
| 553 | } else {
|
---|
| 554 | &write_line('COLCFG', ["<searchType name=\"plain\" />"]);
|
---|
| 555 | &write_line('COLCFG', ["<searchType name=\"form\" />"]);
|
---|
| 556 | }
|
---|
| 557 | &write_line('COLCFG', ["</searchTypeList>"]);
|
---|
| 558 | }
|
---|
| 559 |
|
---|
| 560 | # do indexLanguageList [in collect.cfg: languages; in build.cfg: languagemap]
|
---|
[24464] | 561 | my $default_lang = $settings->{'default_lang'};
|
---|
| 562 | my $default_lang_short = $settings->{'default_lang_short'};
|
---|
[15600] | 563 | if (defined $buildcfg->{"languagemap"}) {
|
---|
| 564 | &write_line('COLCFG', ["<indexLanguageList>"]);
|
---|
| 565 |
|
---|
| 566 | my $langmap_t = $buildcfg->{"languagemap"};
|
---|
| 567 | foreach my $l (@$langmap_t) {
|
---|
| 568 | my ($k, $v) = $l =~ /^(.*)\-\>(.*)$/;
|
---|
| 569 |
|
---|
| 570 | &write_line('COLCFG', ["<indexLanguage name=\"", $k, "\" shortname=\"", $v, "\" />"]);
|
---|
| 571 | }
|
---|
| 572 |
|
---|
| 573 | &write_line('COLCFG', ["</indexLanguageList>"]);
|
---|
[24464] | 574 |
|
---|
[15600] | 575 | &write_line('COLCFG', ["<defaultIndexLanguage name=\"", $default_lang, "\" shortname=\"", $default_lang_short, "\" />"]);
|
---|
| 576 | }
|
---|
| 577 |
|
---|
[24464] | 578 | # do indexSubcollectionList
|
---|
| 579 | my $default_subcol = $settings->{'default_subcol'};
|
---|
[15600] | 580 |
|
---|
| 581 | if (defined $buildcfg->{'subcollectionmap'}) {
|
---|
| 582 | &write_line('COLCFG', ["<indexSubcollectionList>"]);
|
---|
| 583 | my $subcolmap = {};
|
---|
| 584 | my @subcollist = ();
|
---|
[24464] | 585 |
|
---|
[15600] | 586 | my $subcolmap_t = $buildcfg->{'subcollectionmap'};
|
---|
| 587 | foreach my $l (@$subcolmap_t) {
|
---|
| 588 | my ($k, $v) = $l =~ /^(.*)\-\>(.*)$/;
|
---|
| 589 | $subcolmap->{$k} = $v;
|
---|
| 590 | push @subcollist, $k;
|
---|
| 591 | }
|
---|
[24464] | 592 |
|
---|
[15600] | 593 | foreach my $sl (@subcollist) {
|
---|
| 594 | my $subcol = $subcolmap->{$sl};
|
---|
| 595 | &write_line('COLCFG', ["<indexSubcollection name=\"", $sl, "\" shortname=\"", $subcol, "\" />"]);
|
---|
| 596 | }
|
---|
| 597 |
|
---|
| 598 | &write_line('COLCFG', ["</indexSubcollectionList>"]);
|
---|
| 599 | &write_line('COLCFG', ["<defaultIndexSubcollection shortname=\"", $default_subcol, "\" />"]);
|
---|
| 600 | }
|
---|
| 601 |
|
---|
| 602 | # close off search service
|
---|
| 603 | &write_line('COLCFG', ["</serviceRack>"]);
|
---|
| 604 |
|
---|
[24464] | 605 | }
|
---|
| 606 |
|
---|
| 607 |
|
---|
| 608 | sub write_orthogonalsearch_serviceracks
|
---|
| 609 | {
|
---|
| 610 | my ($buildcfg,$settings) = @_;
|
---|
| 611 |
|
---|
[26094] | 612 | #return if($settings->{'num_indexes'} <= 0); # no search if no indexes
|
---|
| 613 |
|
---|
[24464] | 614 | my $infodbtype = $settings->{'infodbtype'};
|
---|
| 615 |
|
---|
| 616 | my $orthogonalbuildtypes = $settings->{'orthogonalbuildtypes'};
|
---|
| 617 |
|
---|
| 618 | 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>"]);
|
---|
| 626 | }
|
---|
| 627 | }
|
---|
| 628 |
|
---|
| 629 |
|
---|
| 630 |
|
---|
| 631 | sub write_retrieve_servicerack
|
---|
| 632 | {
|
---|
| 633 | my ($buildcfg,$settings) = @_;
|
---|
| 634 |
|
---|
| 635 | my $buildtype = $settings->{'buildtype'};
|
---|
| 636 | my $infodbtype = $settings->{'infodbtype'};
|
---|
| 637 |
|
---|
| 638 | my $service_type = $settings->{'service_type'};
|
---|
| 639 |
|
---|
[15600] | 640 | # do the retrieve service
|
---|
| 641 | &write_line('COLCFG', ["<serviceRack name=\"GS2", $service_type, "Retrieve\">"]);
|
---|
| 642 |
|
---|
| 643 | # do default index
|
---|
| 644 | if (defined $buildcfg->{"languagemap"}) {
|
---|
[24464] | 645 | my $default_lang = $settings->{'default_lang'};
|
---|
[15600] | 646 | &write_line('COLCFG', ["<defaultIndexLanguage shortname=\"", $default_lang, "\" />"]);
|
---|
| 647 | }
|
---|
| 648 | if (defined $buildcfg->{'subcollectionmap'}) {
|
---|
[24464] | 649 | my $default_subcol = $settings->{'default_subcol'};
|
---|
[15600] | 650 | &write_line('COLCFG', ["<defaultIndexSubcollection shortname=\"", $default_subcol, "\" />"]);
|
---|
| 651 | }
|
---|
| 652 | if ($buildtype eq "mg") {
|
---|
[24464] | 653 | my $defaultindex = $settings->{'defaultindex'};
|
---|
[15600] | 654 | &write_line('COLCFG', ["<defaultIndex shortname=\"", $defaultindex, "\" />"]);
|
---|
| 655 | }
|
---|
| 656 |
|
---|
| 657 | if (defined $buildcfg->{'indexstem'}) {
|
---|
| 658 | my $indexstem = $buildcfg->{'indexstem'};
|
---|
| 659 | &write_line('COLCFG', ["<indexStem name=\"", $indexstem, "\" />"]);
|
---|
| 660 | }
|
---|
[25758] | 661 | if ($buildtype eq "mgpp" || $buildtype eq "lucene" || $buildtype eq "solr") {
|
---|
[24464] | 662 | my $default_retrieve_level = $settings->{'default_retrieve_level'};
|
---|
[15600] | 663 | &write_line('COLCFG', ["<defaultLevel shortname=\"", $default_retrieve_level, "\" />"]);
|
---|
| 664 | }
|
---|
[21439] | 665 | if (defined $buildcfg->{'infodbtype'}) {
|
---|
| 666 | &write_line('COLCFG', ["<databaseType name=\"", $infodbtype, "\" />"]);
|
---|
| 667 | }
|
---|
| 668 |
|
---|
[15600] | 669 | &write_line('COLCFG', ["</serviceRack>"]);
|
---|
| 670 |
|
---|
[24464] | 671 | }
|
---|
| 672 |
|
---|
| 673 |
|
---|
| 674 | # Create the buildConfig.xml file for a specific collection
|
---|
| 675 | sub write_cfg_file {
|
---|
| 676 | # this sub is called in make_auxiliary_files() in basebuilder.pm
|
---|
| 677 | # the received args: $buildoutfile - destination file: buildConfig.xml
|
---|
| 678 | # $buildcfg - all build options,
|
---|
| 679 | # $collectcfg - contents of collectionConfig.xml read in by read_cfg_file sub in buildConfigxml.pm.
|
---|
| 680 | my ($buildoutfile, $buildcfg, $collectcfg) = @_;
|
---|
| 681 | my $line = [];
|
---|
| 682 |
|
---|
| 683 | if (!open (COLCFG, ">$buildoutfile")) {
|
---|
| 684 | print STDERR "buildConfigxml::write_cfg_file couldn't write the build config file $buildoutfile\n";
|
---|
| 685 | die;
|
---|
| 686 | }
|
---|
| 687 |
|
---|
| 688 | my $settings = search_and_retrieve_settings($buildcfg,$collectcfg);
|
---|
| 689 |
|
---|
| 690 | my $buildtype = $settings->{'buildtype'};
|
---|
| 691 | my $orthogonalbuildtypes = $settings->{'orthogonalbuildtypes'};
|
---|
| 692 | my $numdocs = $settings->{'numdocs'};
|
---|
| 693 |
|
---|
| 694 | &write_line('COLCFG', ["<buildConfig xmlns:gsf=\"http://www.greenstone.org/greenstone3/schema/ConfigFormat\">"]);
|
---|
| 695 |
|
---|
| 696 | # output building metadata to build config file
|
---|
| 697 | &write_line('COLCFG', ["<metadataList>"]);
|
---|
| 698 | &write_line('COLCFG', ["<metadata name=\"numDocs\">", $numdocs, "</metadata>"]);
|
---|
| 699 | &write_line('COLCFG', ["<metadata name=\"buildType\">", $buildtype, "</metadata>"]);
|
---|
| 700 | foreach my $obt (@$orthogonalbuildtypes) {
|
---|
| 701 | &write_line('COLCFG', ["<metadata name=\"orthogonalBuildTypes\">", $obt, "</metadata>"]);
|
---|
| 702 | }
|
---|
| 703 |
|
---|
| 704 | if (defined $buildcfg->{'indexstem'}) {
|
---|
| 705 | &write_line('COLCFG', ["<metadata name=\"indexStem\">", $buildcfg->{"indexstem"}, "</metadata>"]);
|
---|
| 706 | }
|
---|
| 707 | if (defined $buildcfg->{'infodbtype'}) {
|
---|
| 708 | &write_line('COLCFG', ["<metadata name=\"infodbType\">", $buildcfg->{"infodbtype"}, "</metadata>"]);
|
---|
| 709 | }
|
---|
[30858] | 710 | if (defined $buildcfg->{'builddate'}) {
|
---|
| 711 | &write_line('COLCFG', ["<metadata name=\"buildDate\">", $buildcfg->{"builddate"}, "</metadata>"]);
|
---|
| 712 | }
|
---|
[24464] | 713 | if (defined $buildcfg->{'earliestdatestamp'}) {
|
---|
[28876] | 714 | &write_line('COLCFG', ["<metadata name=\"earliestDatestamp\">", $buildcfg->{"earliestdatestamp"}, "</metadata>"]);
|
---|
[24464] | 715 | }
|
---|
| 716 |
|
---|
| 717 | &write_line('COLCFG', ["</metadataList>"]);
|
---|
| 718 |
|
---|
| 719 | # output serviceRackList
|
---|
| 720 | &write_line('COLCFG', ["<serviceRackList>"]);
|
---|
| 721 |
|
---|
| 722 | write_search_servicerack($buildcfg,$settings);
|
---|
| 723 |
|
---|
| 724 | # add in orthogonalbuildtypes
|
---|
| 725 | write_orthogonalsearch_serviceracks($buildcfg,$settings);
|
---|
| 726 |
|
---|
| 727 | write_retrieve_servicerack($buildcfg,$settings);
|
---|
| 728 |
|
---|
[15600] | 729 | # do the browse service
|
---|
| 730 | my $count = 1;
|
---|
| 731 | my $phind = 0;
|
---|
| 732 | my $started_classifiers = 0;
|
---|
| 733 |
|
---|
| 734 | my $classifiers = $collectcfg->{"classify"};
|
---|
| 735 | foreach my $cl (@$classifiers) {
|
---|
| 736 | my $name = "CL$count";
|
---|
| 737 | $count++;
|
---|
| 738 | my ($classname) = @$cl[0];
|
---|
| 739 | if ($classname =~ /^phind$/i) {
|
---|
| 740 | $phind=1;
|
---|
| 741 | #should add it into coll config classifiers
|
---|
| 742 | next;
|
---|
| 743 | }
|
---|
| 744 |
|
---|
| 745 | if (not $started_classifiers) {
|
---|
| 746 | &write_line('COLCFG', ["<serviceRack name=\"GS2Browse\">"]);
|
---|
| 747 | if (defined $buildcfg->{'indexstem'}) {
|
---|
| 748 | my $indexstem = $buildcfg->{'indexstem'};
|
---|
| 749 | &write_line('COLCFG', ["<indexStem name=\"", $indexstem, "\" />"]);
|
---|
| 750 | }
|
---|
[21439] | 751 | if (defined $buildcfg->{'infodbtype'}) {
|
---|
| 752 | my $infodbtype = $buildcfg->{'infodbtype'};
|
---|
| 753 | &write_line('COLCFG', ["<databaseType name=\"", $infodbtype, "\" />"]);
|
---|
| 754 | }
|
---|
[15600] | 755 | &write_line('COLCFG', ["<classifierList>"]);
|
---|
| 756 | $started_classifiers = 1;
|
---|
| 757 | }
|
---|
| 758 | my $content = ''; #use buttonname first, then metadata
|
---|
[30380] | 759 | my $hfilename = '';
|
---|
| 760 | my $metadataname = '';
|
---|
[15600] | 761 | if ($classname eq "DateList") {
|
---|
| 762 | $content = "Date";
|
---|
| 763 | } else {
|
---|
| 764 | for (my $j=0; $j<scalar(@$cl); $j++) {
|
---|
| 765 | my $arg = @$cl[$j];
|
---|
[30380] | 766 | if ($classname eq "Hierarchy")
|
---|
| 767 | {
|
---|
| 768 | if ($arg eq "-hfile")
|
---|
| 769 | {
|
---|
| 770 | $hfilename = @$cl[$j+1];
|
---|
| 771 | }
|
---|
| 772 | elsif ($arg eq "-metadata")
|
---|
| 773 | {
|
---|
| 774 | $metadataname = @$cl[$j+1];
|
---|
| 775 | }
|
---|
| 776 | }
|
---|
[15600] | 777 | if ($arg eq "-buttonname"){
|
---|
| 778 | $content = @$cl[$j+1];
|
---|
| 779 | last;
|
---|
| 780 | } elsif ($arg eq "-metadata") {
|
---|
| 781 | $content = @$cl[$j+1];
|
---|
| 782 | }
|
---|
| 783 |
|
---|
| 784 | }
|
---|
| 785 | }
|
---|
[30380] | 786 | if ($classname eq "Hierarchy")
|
---|
| 787 | {
|
---|
| 788 | &write_line('COLCFG', ["<classifier name=\"", $name, "\" content=\"", $content, "\" metadata=\"", $metadataname, "\" hfile=\"", $hfilename, "\" />"]);
|
---|
| 789 | } else
|
---|
| 790 | {
|
---|
| 791 | &write_line('COLCFG', ["<classifier name=\"", $name, "\" content=\"", $content, "\" />"]);
|
---|
| 792 | }
|
---|
| 793 | }
|
---|
[15600] | 794 | if ($started_classifiers) {
|
---|
| 795 | # end the classifiers
|
---|
| 796 | &write_line('COLCFG', ["</classifierList>"]);
|
---|
| 797 | # close off the Browse service
|
---|
| 798 | &write_line('COLCFG', ["</serviceRack>"]);
|
---|
| 799 | }
|
---|
| 800 |
|
---|
| 801 | # the phind classifier is a separate service
|
---|
| 802 | if ($phind) {
|
---|
| 803 | # if phind classifier
|
---|
| 804 | &write_line('COLCFG', ["<serviceRack name=\"PhindPhraseBrowse\" />"]);
|
---|
| 805 | }
|
---|
| 806 |
|
---|
| 807 |
|
---|
| 808 | &write_line('COLCFG', ["</serviceRackList>"]);
|
---|
| 809 | &write_line('COLCFG', ["</buildConfig>"]);
|
---|
| 810 |
|
---|
| 811 | close (COLCFG);
|
---|
| 812 | }
|
---|
| 813 |
|
---|
| 814 |
|
---|
| 815 | #########################################################
|
---|
| 816 |
|
---|
| 817 | 1;
|
---|