Difference between revisions of "BibTeX Extension Example"
Line 1: | Line 1: | ||
This is an example for a rant on the [[How to contribute]] page. | This is an example for a rant on the [[How to contribute]] page. | ||
<pre><nowiki> | <pre><nowiki> | ||
− | |||
package EPrints::Plugin::Export::BibTeXLocal; | package EPrints::Plugin::Export::BibTeXLocal; | ||
Revision as of 15:31, 8 February 2007
This is an example for a rant on the How to contribute page.
package EPrints::Plugin::Export::BibTeXLocal; use EPrints::Plugin::Export::BibTeX; @ISA = ( "EPrints::Plugin::Export::BibTeX" ); use strict; sub new { my( $class, %params ) = @_; my $self = $class->SUPER::new(%params); # just override the name... $self->{name} = "BibTeX (foo group format)"; return $self; } sub convert_dataobj { my( $plugin, $dataobj ) = @_; my $data = $plugin->SUPER::convert_dataobj($dataobj); # add the authorbio field if possible. if( $dataobj->exists_and_set( "authorbio" ) ) # just to be safe { $data->{bibtex}->{authorbio} = $dataobj->get_value( "authorbio" ); } return $data; }