Changeset 16697
- Timestamp:
- 2008-08-11T14:04:23+12:00 (16 years ago)
- Location:
- gsdl/trunk/perllib/plugins
- Files:
-
- 2 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 -
gsdl/trunk/perllib/plugins/MARCXMLPlugin.pm
r16695 r16697 111 111 my $msg = "MARCXMLPlugin ERROR: Can't locate mapping file \"" . 112 112 $self->{'metadata_mapping_file'} . "\".\n " . 113 " No m arc files can be processed.\n";113 " No metadata will be extracted from MARCXML files.\n"; 114 114 115 115 print $outhandle $msg; … … 206 206 207 207 my $outhandle = $self->{'outhandle'}; 208 print $outhandle "Record $self->{'record_count'} - MARCXMLPlugin: processing $self->{'file'}\n" if $self->{'verbosity'} > 1;208 print $outhandle "Record $self->{'record_count'}\n" if $self->{'verbosity'} > 1; 209 209 210 210 $self->{'record_count'}++; … … 322 322 323 323 ## map the xmlmarc to gsdl metadata 324 if ($element eq "datafield" and defined $self->{'doc_obj'} and defined $self->{'marc_mapping'} ){324 if ($element eq "datafield" and defined $self->{'doc_obj'} and defined $self->{'marc_mapping'} and defined $self->{'metadata_mapping'}){ 325 325 my $metadata_mapping = $self->{'metadata_mapping'}; 326 326 my $marc_mapping = $self->{'marc_mapping'};
Note:
See TracChangeset
for help on using the changeset viewer.