Changeset 14101
- Timestamp:
- 2007-05-28T08:58:01+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/cfgread4gs3.pm
r14021 r14101 30 30 no strict 'refs'; 31 31 no strict 'subs'; 32 33 # Wrapper that ensures the right version of XML::Parser is loaded given 34 # the version of Perl being used. Need to distinguish between Perl 5.6 and 35 # Perl 5.8 36 sub BEGIN { 37 my $perl_dir; 38 39 # Note: $] encodes the version number of perl 40 if ($]>5.008) { 41 # perl 5.8.1 or above 42 $perl_dir = "perl-5.8"; 43 } 44 elsif ($]<5.008) { 45 # assume perl 5.6 46 $perl_dir = "perl-5.6"; 47 } 48 else { 49 print STDERR "Warning: Perl 5.8.0 is not a maintained release.\n"; 50 print STDERR " Please upgrade to a newer version of Perl.\n"; 51 $perl_dir = "perl-5.8"; 52 } 53 54 if ($ENV{'GSDLOS'} !~ /^windows$/i) { 55 # Use push to put this on the end, so an existing XML::Parser will be used by default 56 push (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir"); 57 } 58 } 59 32 60 use XML::Parser; 33 61 34 62 # A mapping hash to resolve name descrepency between gs2 and gs3. 35 63 my $nameMap = {"key" => "value", … … 321 349 } 322 350 351 # Create the buildConfig.xml file for a specific collection 323 352 sub write_cfg_file { 324 # information needed from $collectcfg : defaultindex, defaultlevel, classifiers,353 # information needed from $collectcfg include: defaultindex, defaultlevel, classifiers, 325 354 # the rest is from $buildcfg 326 355 my ($buildoutfile, $buildcfg, $collectcfg) = @_; … … 360 389 &write_line('COLCFG', ["<serviceRackList>"]); 361 390 391 # This serviceRack enables the collection to provide the oai metadata retrieve service, which is served by the OAIMetadataRetrieve.java class 392 # For each collection, we write the following serviceRack in the collection's buildConfig.xml file as follows and also specify the metadata format this oai service provides in the rack. But whether this service is going to be put in use depends on its name appearing in the OAIConfig.xml. 393 &write_line('COLCFG', ["<serviceRack name=\"OAIPMH\">"]); 394 395 # What metadata sets to support is collection specific and is specified in each collection's buildConfig.xml file. To support other metadata schema, simply add an OAIMetadataFormat element here. 396 # The support of unqualified Dublin Core metadata set is mendatory in the oai specification. 397 &write_line('COLCFG', ["<OAIMetadataFormat name=\"Dublin Core\">"]); 398 &write_line('COLCFG', ["<metadataPrefix>oai_dc</metadataPrefix>"]); 399 &write_line('COLCFG', ["<metadataNamespace>dc</metadataNamespace>"]); 400 &write_line('COLCFG', ["</OAIMetadataFormat>"]); 401 402 &write_line('COLCFG', ["</serviceRack>"]); 403 362 404 # do the search service 363 405 &write_line('COLCFG', ["<serviceRack name=\"GS2", $service_type, "Search\">"]);
Note:
See TracChangeset
for help on using the changeset viewer.