Changeset 2484 for trunk/gsdl/perllib/plugins/BibTexPlug.pm
- Timestamp:
- 2001-05-29T23:52:32+12:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BibTexPlug.pm
r1711 r2484 57 57 } 58 58 59 60 59 # The process function reads a single bibliographic record and stores 61 60 # it as a new document. … … 65 64 my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj) = @_; 66 65 my $outhandle = $self->{'outhandle'}; 66 67 $self->{'key'} = "default"; 67 68 68 69 # Check that we're dealing with a valid BibTex record … … 125 126 $text .= "$line\n"; 126 127 128 127 129 # The first line is special, it contains the reference type and OID 128 if ($line =~ /\@(\w+)\ {([\w\d]*),/) {130 if ($line =~ /\@(\w+)\W*\{\W*([\*\.\w\d:-]+)\W*$/) { 129 131 $EntryType = $1; 130 132 $EntryID = $2; 131 print "** $EntryType - $EntryID \n"; 133 print "** $EntryType - \"$EntryID\" \n" 134 if ($verbosity >= 4); 135 $self->{'key'} = $EntryID; 132 136 next; 137 } 138 if ($line =~ /\@/) { 139 print "bibtexplug: suspect line in bibtex file: $line\n" 140 if ($verbosity >= 2); 141 print "bibtexplug: if that's the start of a new bibtex record ammend regexp in bibtexplug::process()\n" 142 if ($verbosity >= 2); 133 143 } 134 144 … … 227 237 } 228 238 229 1;230 231 239 232 240 # Convert a text string into HTML. … … 269 277 } 270 278 271 279 sub set_OID { 280 my $self = shift (@_); 281 my ($doc_obj, $id, $segment_number) = @_; 282 283 if ( $self->{'key'} eq "default") { 284 $doc_obj->set_OID(); 285 } else { 286 $doc_obj->set_OID($self->{'key'}); 287 } 288 } 289 290 1;
Note:
See TracChangeset
for help on using the changeset viewer.