Re: [Q] Scripting interface.
[email protected] (Peter Schulte-Stracke)
| Newsgroups | gmane.comp.gnome.apps.pybliographer |
|---|---|
| Message-ID | <20040324195806.GA1854@britten> |
Am 24.03.2004 18:05:51 schrieb(en) Daniel Carrera: > Frederic Gobry wrote: > >> I joined IRC 2 minutes after you left... and indeed, so far it's a >> quiet place :-) > > :-) > >> So far (pyblio 1.2), the bibtex parser is in C with a python >> binding. It also proved to be a pain to port (as there were endless >> issues with GNU recode on which it depends). The other importers are >> in pure python. >> >> I'll try hard for 1.3 to not have hard requirements on external >> compiled dependencies. > > I'll have my fingers crossed. > > >> Regard OO.org integration (a feature that is very high on the wish >> list :-)), > > :-) > >> do you know what would be needed to have some tight interaction ? >> (ie, inserting entries from the db itself, displaying the actual >> biblio keys in the document, inserting the final biblio where >> requested,...) > > The OOo object model (called UNO) provides that for you. Now, you > should know that this will only work with the python that comes with > the standard OOo installation. It comes with all the libraries > needed for the UNO binding which are not found in the regual python > install. > > > I had no time to dig in the doc, so if you could provide us with a > rough sketch... > > Yes, I can. See here: > > http://www.math.umd.edu/~dcarrera/biblio_uno.py > > This could be the "framework" for a basic bibliographic filter. > > The program needs a get_entries() function that returns the > bibliographic entries as a dictioary with certain entries. With that > function, this program will then stick those entries into OOo's > bibliographic databse. The import framework has changed in P2 -- what you would have to do is replacing Import.py, I presume. > In order to make a filter that integrates tightly with OOo (e.g. has > a menu entry, no need for the command-line) we have to do some more > work. There are some examples in the PyUNO web page. But it's > easiest to start with just a command-line program such as this one. Well, Daniel, I suppose Frederic had something else in mind: namely support for using Pyblio from OOo. Some kinds of interaction are: -- looking up a resource in the database, say by giving a name and selecting from the result set. -- selecting a resource from a shortlist -- drawing up a list of resources cited in a document -- wrapping part of a database in a document for transport, etc. I add a short paper to enlarge a bit on this point. Regards, Peter
dp013.txt
(text/plain, 3.7 KB)
Interfacing a Personal Reference Manager (PRM) to an Editor/Word Processor
Application (EWP)
A Proposal
Peter Schulte-Stracke
_________________________________________________________________
Table of Contents
[1]Background
[2]Overview
[3]A sample interaction
[4]Requests and Responses
Abstract
It is highly desirable to create a common standard for the interaction
between an Editor or Word processor on the one hand, and a Personal
Reference Manager on the other. This paper summarily decribes possible
interactions and their implementation.
Background
All users of bibliographical data bases share the need of
communicating bibliographical information in the forms of references,
be they terse inline citations, contained in footnotes, or full form
references as usually given at the end of a work.
They want this information to be at their fingertips, available
without great effort at any time during the writing process. They want
even more. Given that the bibliographical information is best kept as
a consolidated database they will want the information be taken, and
any information gained added to the central repository, thus
effectively excluding makeshift solutions requiring setup or involving
a moving back and forth of the data.
Thus we find: given a bibliographical database, it must be
* directly usable, by as many applications a possible
* adapt to the working habits and needs of the user
* accept pertinent information from the client (the word processor
or editor)
Overview
A sample interaction
1. User starts working on a document.
2. He opens a connection to the BRM application / bibliographical
database.
3. He looks up a citation in the database (via simple search) and
insert a citation marker in the text at hand.
4. Next he adds a quotation from a book. The query for the book
fails: it is not yet in the database, so he enters it first. For
that purpose the PRM opens the same dialogue as it would in other
circumstances, and then it immediately proceeds to enter the
quotation. -- Back to the word processor application the quotation
is then (perhaps) slightly edited, and the source information
automatically included with it.
5. When the text is finished, it is registered with the PRM, thus
making it available for searching and citing in the future.
6. The reference list is processed. To that end, the word processor
updates its bibliographical data (it could have been changed) and
sends it to a XSLT backend. At the same time, the PRM updates its
tables reflecting the new citations that have been made, and the
new work the author has completed.
This is the more or less standard use case; but others are equally
important: consider adding references to an e-mail, or the opposite
direction: perusing e-mails for useful information is an often tedious
task that would profit much from a ready-made collaboration between
the e-mail reader and the PRM.
Requests and Responses
Table 1. Possible Interactions
REQ Open Connection Identify a client,
RSP Introduce Server show available database(s)
REQ Open Database Associate client with one DB
REQ Register Document Enter the subject document into the
bibliographical database;
REQ Request Citation Peform a simple search for a database entry,
return its description
REQ Update References Send all references in the subject document to
the server to update its tables
. . . . . . . . .