Changeset 4792 for trunk/gsdl/perllib/plugins/BibTexPlug.pm
- Timestamp:
- 2003-06-25T09:45:41+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BibTexPlug.pm
r4744 r4792 129 129 'keywords', 'Keywords', 130 130 'abstract', 'Abstract', 131 'copyright', 'Copyright' 131 'copyright', 'Copyright', 132 'note', 'Note', 132 133 ); 133 134 134 135 # Metadata fields 135 136 my %metadata; 136 my ($EntryType, $ EntryID, $Creator, $Keywords, $text);137 my ($EntryType, $Creator, $Keywords, $text); 137 138 138 139 my $verbosity = $self->{'verbosity'}; … … 142 143 # append line to previous if it doesn't start with " <key> = " 143 144 144 my @input_lines=split( '\n', $$textref);145 my @input_lines=split(/\r?\n/, $$textref); 145 146 my @all_lines; 146 147 my $entry_line=shift @input_lines; … … 161 162 push(@all_lines, "}"); 162 163 163 164 165 164 # Read and process each line in the bib file. 166 165 my ($entryname, $name, $value, $line); … … 174 173 $text .= "$line\n"; 175 174 175 176 176 print "Processing line = $line \n" if $verbosity>=4; 177 177 178 178 # The first line is special, it contains the reference type and OID 179 if ($line =~ /\@(\w+)\W*\{\W*([\*\.\w\d:-] +)\W*$/) {179 if ($line =~ /\@(\w+)\W*\{\W*([\*\.\w\d:-]*)\W*$/) { 180 180 $EntryType = $1; 181 $EntryID = $2;181 my $EntryID = (defined $2) ? $2 : "default"; 182 182 print "** $EntryType - \"$EntryID\" \n" 183 183 if ($verbosity >= 4); 184 $self->{'key'} = $EntryID; 184 185 185 next; 186 186 } … … 775 775 776 776 if ( $self->{'key'} eq "default") { 777 $doc_obj->set_OID( );777 $doc_obj->set_OID("$id\_$segment_number"); 778 778 } else { 779 779 $doc_obj->set_OID($self->{'key'}); … … 782 782 783 783 1; 784 785
Note:
See TracChangeset
for help on using the changeset viewer.