Difference between revisions of "Files/Export metadata in BIBTEX-format"
(→citations-en.xml) |
|||
(12 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:EPrints 2 Plugins]] | ||
For using this script you have to make some changes in | For using this script you have to make some changes in | ||
Line 22: | Line 23: | ||
<ep:citation type="eprint_bibtex"> | <ep:citation type="eprint_bibtex"> | ||
Citation-begin <ep:linkhere> | Citation-begin <ep:linkhere> | ||
− | + | <span class="citation"> | |
Aut-begin author = {@authors@} Aut-end | Aut-begin author = {@authors@} Aut-end | ||
<ep:ifset name="year"> Year-begin year = {@year@} Year-end</ep:ifset> | <ep:ifset name="year"> Year-begin year = {@year@} Year-end</ep:ifset> | ||
Line 38: | Line 39: | ||
<ep:ifset name="number"> Number-begin number = {@number@} Number-end</ep:ifset> | <ep:ifset name="number"> Number-begin number = {@number@} Number-end</ep:ifset> | ||
Citation-end | Citation-end | ||
− | + | </span> | |
</ep:linkhere> | </ep:linkhere> | ||
</ep:citation> | </ep:citation> | ||
Line 59: | Line 60: | ||
The BIBTEX-Entry | The BIBTEX-Entry | ||
− | + | my $bibtexid = new EPrints::EPrint( | |
− | + | $eprint->{session}, | |
− | + | $eprint->get_value( "eprintid" ) ); | |
− | + | my $bibtex; | |
− | + | $bibtex = $session->make_element( "a", | |
− | + | href=>$eprint->{session}->get_archive()->get_conf( "" )."/data/".$bibtexid->get_value( "eprintid" ).".bibtex", target=>'_blank'); | |
− | + | $bibtex->appendChild( | |
− | + | $bibtexid->render_citation( "bibtexitem") ); | |
− | + | $table->appendChild( _render_row( | |
− | + | $session, | |
− | + | $session->html_phrase( "page:BibTex" ), | |
− | + | $bibtex ) ); | |
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 17:36, 9 February 2010
For using this script you have to make some changes in
- the citations-en.xml,
- the phrases-en.xml,
- the ArchiveConfig.pm,
- the ArchiveRenderConfig.pm
citations-en.xml
two new entries in the citations-en.xml
<ep:citation type="eprint_bibtexitem"> <ep:linkhere> <ep:ifset name="title">BibTex</ep:ifset> <ep:ifnotset name="title">Untitled @eprintid@</ep:ifnotset> </ep:linkhere> </ep:citation>
I create a special citation type for a better parsing
<ep:citation type="eprint_bibtex">
Citation-begin <ep:linkhere>
<span class="citation">
Aut-begin author = {@authors@} Aut-end
<ep:ifset name="year"> Year-begin year = {@year@} Year-end</ep:ifset>
Title-begin title = {@title@} Title-end
<ep:ifset name="editors"> Editor-begin editor = {@editors@} Editor-end</ep:ifset>
<ep:ifset name="volume"> Volumne-begin volume = {@volume@} Volumne-end</ep:ifset>
<ep:ifset name="pages"> Pages-begin pages = {@pages@} Pages-endType-end</ep:ifset>
<ep:ifset name="confloc">, @confloc@</ep:ifset>
<ep:ifset name="confdates">, @confdates@</ep:ifset>
<ep:ifset name="conference"> Conference-begin booktitle = {@conference@, @confloc@, @confdates@} Conference-end</ep:ifset>
<ep:ifset name="chapter"> Chapter-begin chapter = {@chapter@} Chapter-end</ep:ifset>
<ep:ifset name="publisher"> Publisher-begin publisher = {@publisher@} Publisher-end</ep:ifset>
<ep:ifset name="publication"> Publication-begin journal = {@publication@} Publication-end</ep:ifset>
<ep:ifset name="institution"> Institution-begin institution = {@institution@} Institution-end</ep:ifset>
<ep:ifset name="number"> Number-begin number = {@number@} Number-end</ep:ifset>
Citation-end
</span>
</ep:linkhere>
</ep:citation>
phrases-en.xml
<ep:phrase ref="viewname_eprint_bibtex">Bibtex</ep:phrase>
and
<ep:phrase ref="page:BibTex">Display Formats</ep:phrase>
ArchiveConfig.pm
{ id=>"bibtex", fields=>"year", order=>"title/authors", citation=>"bibtex", nohtml=>1, nolink=>1, include=>1, nocount=>1},
ArchiveRenderConfig.pm
The BIBTEX-Entry
my $bibtexid = new EPrints::EPrint( $eprint->{session}, $eprint->get_value( "eprintid" ) ); my $bibtex; $bibtex = $session->make_element( "a", href=>$eprint->{session}->get_archive()->get_conf( "" )."/data/".$bibtexid->get_value( "eprintid" ).".bibtex", target=>'_blank'); $bibtex->appendChild( $bibtexid->render_citation( "bibtexitem") ); $table->appendChild( _render_row( $session, $session->html_phrase( "page:BibTex" ), $bibtex ) );