The main thing that we will need to think about in implementing JSON services is exactly what to expose. For the most part, VuFind works by sending record driver objects to the
view and then loading templates that are specifically associated with those objects. This allows displays to adjust to display record-appropriate information and makes VuFind extremely flexible. The problem is that for JSON, you can't just convert a record
driver object to JSON, and different drivers may need to expose different chunks of data.
Perhaps this is not a problem for what you have in mind -- not all of VuFind is so complicated -- but it's the main obstacle in building a generic VuFind API. What serves as a strength for rendering a user interface is a weakness for dumping out raw data.
You either need some complex JSON-specific code or you need to compromise what data is available to accommodate a "least common denominator" model of some sort.
Of course, in practice, this may not be as bad as it sounds in theory -- I've tried hard to make all of the VuFind record drivers as similar to one another as possible, and there is a lot of common ground -- but if we want to keep the extreme flexibility that
we currently have, it doesn't hurt to keep crazy edge cases in mind when designing a JSON model.
Let me know if you'd like me to elaborate on any of this!
From: Joe Atzberger [firstname.lastname@example.org]
Sent: Thursday, August 29, 2013 7:38 PM
To: Demian Katz
Cc: vufind-tech Tech
Subject: Re: [VuFind-Tech] JSON-data delivery