Changeset 15018 for gsdl/trunk/perllib/plugins/MARCPlug.pm
- Timestamp:
- 2008-02-27T17:07:17+13:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/MARCPlug.pm
r14964 r15018 45 45 'type' => "string", 46 46 'deft' => "marctodc.txt", 47 'hiddengli' = "yes", # deprecated in favour or 'metadata_mapping_file' 48 'reqd' => "no" }, 49 { 'name' => "metadata_mapping_file", 50 'desc' => "{MARCXMLPlug.metadata_mapping_file}", 51 'type' => "string", 52 'deft' => "", 47 53 'reqd' => "no" }, 48 54 { 'name' => "process_exp", … … 80 86 my $self = new SplitPlug($pluginlist, $inputargs, $hashArgOptLists); 81 87 88 # 'metadata_mapping' was used in two ways in the plugin: as a plugin 89 # option (filename) and as a datastructure to represent the mapping. 90 # In MARXXMLPlug (written later) the two are separated: filename is 91 # represented through 'metadata_mapping_file' and the data-structure 92 # mapping left as 'metadata_mapping' 93 # 'metadata_mapping' still present (but hidden in GLI) for 94 # backwards compatibility, but 'metadata_mapping_file' is used by 95 # preference 96 97 if ($self->{'metadata_mapping_file'} eq "") { 98 # If nothing set in the new version, use the old version 99 # that defaults to 'marctodc.txt' 100 $self->{'metadata_mapping_file'} = $self->{'metadata_mapping'}; 101 } 102 82 103 $self->{'type'} = ""; 83 104 … … 92 113 93 114 # read in the metadata mapping file 94 my $mm_file = 95 &util::filename_cat( $ENV{'GSDLHOME'}, "etc", $self->{'metadata_mapping'} ); 96 97 if (! -e$mm_file)115 116 my $mm_file = &util::locate_config_file($self->{'metadata_mapping_file'}); 117 118 if (!defined $mm_file) 98 119 { 99 120 100 121 my $msg = "MARCPlug ERROR: Can't locate mapping file \"" . 101 $self->{'metadata_mapping '} . "\".\n This file should be at $mm_file\n" .122 $self->{'metadata_mapping_file'} . "\".\n" . 102 123 " No marc files can be processed.\n"; 103 124 … … 131 152 } 132 153 close(MMIN); 154 155 $self->{'metadata_mapping'} = \@metadata_mapping; 133 156 } 134 157 else … … 137 160 } 138 161 139 $self->{'metadata_mapping'} = \@metadata_mapping; 162 140 163 141 164 $self->SUPER::init(@_);
Note:
See TracChangeset
for help on using the changeset viewer.