Changeset 22456 for main/trunk/greenstone2
- Timestamp:
- 2010-07-21T09:50:35+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/collConfigxml.pm
r21822 r22456 86 86 "searchType" => "searchtype", 87 87 "languageMetadata" => "languagemetadata", 88 "buildType" => "buildtype" 88 "buildType" => "buildtype", 89 "buildOption" => "buildOption" 89 90 }; 90 91 # A hash structure which is returned by sub read_cfg_file. 91 92 my $data = {}; 92 93 93 my $repeatedBlock = q/^(browse|pluginList)$/; 94 my $repeatedBlock = q/^(browse|pluginList)$/; #|buildOptionList)$/; 94 95 95 96 # use those unique attribute values to locate the text within the elements … … 109 110 my $currentIndex = 0; 110 111 my $arrayexp = q/^(index|level|indexSubcollection|indexLanguage)$/; 111 my $arrayarrayexp= q/^(plugin|classifier)$/; 112 my $arrayarrayexp= q/^(plugin|classifier)$/; #|buildOption)$/; 112 113 my $hashexp = q/^(subcollection)$/; # add other element names that should be represented by hash expressions here 113 114 my $hashhashexp = q/^(displayItem)$/; # add other (collectionmeta) element names that should be represented by hashes of hashes here. … … 151 152 } 152 153 153 #&Display;154 &Display; 154 155 return $data; 155 156 } … … 228 229 } 229 230 231 #***************************************** 232 elsif ($element eq "buildOption") { 233 print STDERR "**** BUILD OPTION PAIR $name $value\n"; 234 $data->{$name} = $value; 235 } 236 237 230 238 #@ indexoptions: accentfold/casefold/stem; arrayexp 231 239 elsif ($element eq "indexOption") { … … 288 296 # Push classifier/plugin name (e.g. AZList) into $data as the first string 289 297 push (@{$data->{$key}->[$currentIndex]},$name); 298 if (defined $value and $value =~ /\w/) { 299 push (@{$data->{$key}->[$currentIndex]}, $value); 300 print "$value\n"; 301 } 290 302 #print $currentIndex."indexup\n"; 291 303 } … … 309 321 sub EndTag { 310 322 my ($expat, $element) = @_; 311 my $endTags = q/^(browse|pluginList|displayItemList)$/; 323 my $endTags = q/^(browse|pluginList|displayItemList)$/; #|buildOptionList)$/; 312 324 if ($element =~ /$endTags/) { 313 325 $currentIndex = 0; … … 379 391 } 380 392 381 print $data->{'creator'}."\n" if (defined $data->{'creator'}); 382 print $data->{"maintainer"}."\n" if (defined $data->{"maintainer"}); 383 print $data->{"public"}."\n" if (defined $data->{"public"}); 384 print $data->{"defaultindex"}."\n" if (defined $data->{"defaultindex"}); 385 print $data->{"defaultlevel"}."\n" if (defined $data->{"defaultlevel"}); 386 print $data->{"buildtype"}."\n" if (defined $data->{"buildtype"}); 387 print join(",",@{$data->{"searchtype"}})."\n" if (defined $data->{"searchtype"}); 388 print join(",",@{$data->{'levels'}})."\n" if (defined $data->{'levels'}); 389 print join(",",@{$data->{'indexsubcollections'}})."\n" if (defined $data->{'indexsubcollections'}); 390 print join(",",@{$data->{'indexes'}})."\n" if (defined $data->{'indexes'}); 391 print join(",",@{$data->{'indexoptions'}})."\n" if (defined $data->{'indexoptions'}); 392 print join(",",@{$data->{'languages'}})."\n" if (defined $data->{'languages'}); 393 print join(",",@{$data->{'languagemetadata'}})."\n" if (defined $data->{'languagemetadata'}); 393 print STDERR "*** creator: ".$data->{'creator'}."\n" if (defined $data->{'creator'}); 394 print STDERR "*** maintainer: ".$data->{"maintainer"}."\n" if (defined $data->{"maintainer"}); 395 print STDERR "*** public: ".$data->{"public"}."\n" if (defined $data->{"public"}); 396 print STDERR "*** default index: ".$data->{"defaultindex"}."\n" if (defined $data->{"defaultindex"}); 397 print STDERR "*** default level: ".$data->{"defaultlevel"}."\n" if (defined $data->{"defaultlevel"}); 398 print STDERR "*** build type: ".$data->{"buildtype"}."\n" if (defined $data->{"buildtype"}); 399 print STDERR "*** search types: \n"; 400 print STDERR join(",",@{$data->{"searchtype"}})."\n" if (defined $data->{"searchtype"}); 401 print STDERR "*** levels: \n"; 402 print STDERR join(",",@{$data->{'levels'}})."\n" if (defined $data->{'levels'}); 403 print STDERR "*** index subcollections: \n"; 404 print STDERR join(",",@{$data->{'indexsubcollections'}})."\n" if (defined $data->{'indexsubcollections'}); 405 print STDERR "*** indexes: \n"; 406 print STDERR join(",",@{$data->{'indexes'}})."\n" if (defined $data->{'indexes'}); 407 print STDERR "*** index options: \n"; 408 print STDERR join(",",@{$data->{'indexoptions'}})."\n" if (defined $data->{'indexoptions'}); 409 print STDERR "*** languages: \n"; 410 print STDERR join(",",@{$data->{'languages'}})."\n" if (defined $data->{'languages'}); 411 print STDERR "*** language metadata: \n"; 412 print STDERR join(",",@{$data->{'languagemetadata'}})."\n" if (defined $data->{'languagemetadata'}); 394 413 414 print STDERR "*** Plugins: \n"; 395 415 if (defined $data->{'plugin'}) { 396 416 foreach $a (@{$data->{'plugin'}}) { … … 399 419 } 400 420 } 421 422 #print STDERR "*** Build options: \n"; 423 #if (defined $data->{'store_metadata_coverage'}) { 424 #foreach $a (@{$data->{'store_metadata_coverage'}}) { 425 # print join(",",@$a,@$_); 426 # print "\n"; 427 #} 428 #} 429 401 430 if (defined $data->{'classify'}) { 402 print "Classifiers: \n";431 print STDERR "*** Classifiers: \n"; 403 432 map { print join(",",@$_)."\n"; } @{$data->{'classify'}}; 404 433 }
Note:
See TracChangeset
for help on using the changeset viewer.