medialab / aime-core

Core engine of the AIME project serving its harmonized database.
http://www.modesofexistence.org/
Other
14 stars 3 forks source link

create biblio reference in Admin with bibtex #104

Closed paulgirard closed 9 years ago

paulgirard commented 9 years ago

~~a working example working for the dev aime is available here for testing : http://aime.medialab.sciences-po.fr/blf_dev/~~

Well let's start with a bibtex textarea before integrating BLF.

To feed new bibtex reference into biblib, the admin has to trigger a POST query to biblib API with thie JSON RPC call as post data :

{
"id":1,
"jsonrpc":"2.0",
"method":"save",
"params":[
      "aime",
       "@article{girard1972interpretation,title={Interpr{\\'e}tation fonctionelle et {\\'e}limination des coupures de l’arithm{\\'e}tique d’ordre sup{\\'e}rieur},author={Girard, Jean-Yves},year={1972},publisher={PhD thesis, Universit{\\'e} Paris VII}}",
       "bibtext"
  ]
}

It's a basic JSON RPC 2.0 call to the "save" method with 3 parameters :

When it works, the call returns the id of the created reference in biblib. Make sure you use a version of biblib greater than commit https://github.com/medialab/reference_manager/commit/4bddc78ec8b359555c9f8d3cbd90e9f87af6f91a

paulgirard commented 9 years ago

ABORT ! one can't retrieve bibtex from biblib... we're screwed !

About BLF integration, an example of blf integration into a web app see @danieleguido work on frontcast here : https://github.com/medialab/frontcast/blob/0c866cc6667cb41eac68e2e9871749ea837abcb8/templates/walt/document_edit.html