January 6th, 2014 |
Some links:
At the very minimum we'd like to:
List all collections in a
View and edit notes in TeXmacs and HTML formats.
Other interesting (?) features:
Create
Manage a “Drafts” category with the user's current work. Maybe allow the selection of individual bibliographic items and create collections/tags (corresponding to TeXmacs documents) automatically for them.
Organize items into collections and organize
collections (useful while writing a paper). (Don't: this is
already done in
There are several levels of integration of TeXmacs with
Read-only access to the local cache
of the standalone client. Select some bibliographic entries as the
bibliography for some document, then
Read-write access to the local cache of the standalone client. Allows for the previous feature, as well as edition of attached notes, etc.
Read-write access to the
As we will next see, it only makes sense to implement item ?. You may now skip to §?.
Item ? would be easy using the recent
Item
?
seems a good starting point, but it cannot be developed starting with
the code for item
?
. Write access to the local database should be left to the standalone
client or
1. Notice that partial and direct write access with
However, the feature subset made available through this system is very
small. Specifically, only those methods required for the so-called
connectors (for
Several discussions at zotero-dev (e.g. this
one) mention the need for an implementation of an analogue of
Because of the limitations of item ? and the work needed
extending the exported API of the standalone client for
item ?, item ? might be the right starting
point.
There are several full implementations of the
At the very least, we need the following to start with:
A way to make HTTPS requests to the server.
Authentication is made using
The easiest solution is a wrapper class around system calls to
2. Or to use
curl -H 'Zotero-API-Version: 2' \ 'https://api.zotero.org/users/<user-id>/items?key=<app-key>'
This wrapper must also implement caching of entries, using the header
If-Modified-Since-Version: <libraryVersion>
as well as a long list of other things.
An XML parser to compose requests to and parse
replies from the server. To this end I've included
A
(tuple (tuple "Col1" "Col2" "Col3") (tuple "value 1" "2" "value 3"))
As of Jan 2014, caching is not implemented.
We have the choice between:
A document-based interface with all its advantages but the problems posed by delayed tree and database accesses and updates together with the “unusual” feeling about it.
A widget-based interface (with flaws like no mathematical output
in list widgets, but …). To this end I recently (Dec. 2013)
implemented a
A balance of both: a tree widget for the browsing and a side pane
with a
…
For the
; Basic configuration variables (define server "https://api.zotero.org") (define userid "insert your user id here") (define apikey "insert your api key here")
A delicate issue is to achieve the right balance between
Conventions:
All
All exported
The first step is creating an object of type
; Connect (no actual online connection) (define cn (tmz-connect server userid apikey))
Requests to the server are implemented as a two-stage process with
objects of type
Every
One request is started asynchronously as an external process (
This setup is done at
Calls to
After a
First we define the callbacks, then connect and proceed to some requests.
; Our storage: (define _privileges #f) (define _item #f) (define _group #f) (define _user-groups #f) (define _collection-list #f) (define _item-list #f) ; Commands to be called when the requests are done: (define (receive-privileges t) (set! _privileges t)) (define (receive-item t) (set! _item t)) (define (receive-group t) (set! _group t)) (define (receive-user-groups t) (set! _user-groups t)) (define (receive-collection-list t) (set! _collection-list t)) (define (receive-item-list t) (set! _item-list t)) (tmz-request-privileges cn receive-privileges) (tmz-request-item cn receive-item "some item identifier") (tmz-request-group cn receive-group "239896") (tmz-request-user-groups cn receive-user-groups userid "atom") (tmz-request-collection-list cn receive-collection-list "collection" "collection id") (tmz-request-item-list cn receive-item-list "collection-top" "collection id")
There is little done yet:
Errors parsing
Network or server errors are handled but fail silently instead of
returning appropriate messages to the