Ignore:
Timestamp:
2008-02-27T17:07:17+13:00 (16 years ago)
Author:
davidb
Message:

Marc mapping upgraded to support richer set of operations, including subfields, multiple fields in one line (separated by comma), and the removal of rules, e.g. -245 at the start of a line. A Marc to Qualified Dublin Core crosswalk from the Library of congress has been added as "etc/marc2qdc.txt". A collection can then choose to, for example, top up the mapping with its own version of the file stored in its local "etc" folder, specifying only the rules that are different. This is where a rule like "-245" might be used to override a more general rule from the main file that has all subfields in 245 mapping to one metadata item (Title). If the user specifies a different different filename -- through a plugin option -- then they are free to divise a mapping from scratch and store it in the collections local "etc" folder.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/util.pm

    r15003 r15018  
    797797
    798798
     799sub locate_config_file
     800{
     801    my ($file) = @_;
     802
     803    my $locations = locate_config_files($file);
     804
     805    return shift @$locations; # returns undef if 'locations' is empty
     806}
     807
     808
     809sub locate_config_files
     810{
     811    my ($file) = @_;
     812
     813    my @locations = ();
     814
     815    if (-e $file) {
     816    # Clearly specified (most likely full filename)
     817    # No need to hunt in 'etc' directories, return value unchanged
     818    push(@locations,$file);
     819    }
     820    else {
     821    # Check for collection specific one before looking in global GSDL 'etc'
     822
     823    my $test_collect_etc_filename
     824        = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"etc", $file);
     825
     826    if (-e $test_collect_etc_filename) {
     827        push(@locations,$test_collect_etc_filename);
     828    }
     829
     830    my $test_main_etc_filename
     831        = &util::filename_cat($ENV{'GSDLHOME'},"etc", $file);
     832    if (-e $test_main_etc_filename) {
     833        push(@locations,$test_main_etc_filename);
     834    }
     835    }
     836
     837    return \@locations;
     838}
     839
     840
    799841sub hyperlink_text
    800842{
Note: See TracChangeset for help on using the changeset viewer.