Difference between revisions of "Files/Export metadata in BIBTEX-format"

From EPrints Documentation
Jump to: navigation, search
m
m (Reverted edit of Wh6Uvm, changed back to last version by 152.78.64.64)
Line 22: Line 22:
 
  <ep:citation type="eprint_bibtex">
 
  <ep:citation type="eprint_bibtex">
 
     Citation-begin <ep:linkhere>
 
     Citation-begin <ep:linkhere>
 +
    &lt;span class="citation"&gt;
 +
    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
 +
    &lt;/span&gt;
 +
    </ep:linkhere>
 +
</ep:citation>
 +
</code>
 +
 +
==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 ) );

Revision as of 15:54, 11 April 2007

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 ) );