Changeset 16697 for gsdl/trunk/perllib/plugins/MARCPlugin.pm
- Timestamp:
- 2008-08-11T14:04:23+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/MARCPlugin.pm
r16692 r16697 128 128 my $msg = "MARCPlugin ERROR: Can't locate mapping file \"" . 129 129 $self->{'metadata_mapping_file'} . "\".\n " . 130 " No m arc files can be processed.\n";130 " No metadata will be extracted from MARC files.\n"; 131 131 132 132 print $outhandle $msg; … … 190 190 my ($filename, $encoding, $language, $textref) = @_; 191 191 192 my $outhandle = $self->{'outhandle'}; 193 194 if (! defined($self->{'metadata_mapping'})) 195 { 196 # print a warning 197 print $outhandle "MARCPlugin: no metadata file! Can't extract metadata from $filename\n"; 198 } 199 192 200 $self->{'readfile_encoding'}->{$filename} = $encoding; 193 201 … … 195 203 if (!-r $filename) 196 204 { 197 my $outhandle = $self->{'outhandle'};198 205 print $outhandle "Read permission denied for $filename\n" if $self->{'verbosity'}; 199 206 return; … … 243 250 my $filename = &util::filename_cat($base_dir, $file); 244 251 245 if (! defined($self->{'metadata_mapping'}))246 {247 print $outhandle "MARCPlugin: no metadata file! Can't process $file\n";248 return undef;249 }250 251 252 my $cursection = $doc_obj->get_top_section(); 252 253 … … 259 260 my $encoding = $self->{'readfile_encoding'}->{$filename}; 260 261 261 if ($self->{'type'} ne "ascii" ){ 262 $self->extract_metadata ($marc, $metadata, $encoding, $doc_obj, $cursection); 263 } 264 else{ 265 $self->extract_ascii_metadata ($$textref,$metadata,$doc_obj, $cursection); 262 if (defined ($self->{'metadata_mapping'}) ) { 263 if ($self->{'type'} ne "ascii" ){ 264 $self->extract_metadata ($marc, $metadata, $encoding, $doc_obj, $cursection); 265 } 266 else{ 267 $self->extract_ascii_metadata ($$textref,$metadata,$doc_obj, $cursection); 268 } 266 269 } 267 270
Note:
See TracChangeset
for help on using the changeset viewer.