Currently, Koha has three possible frameworks for AJAX: - Biblios, XML-based: Already in use, though only by Biblios. No wrapper, so each of the services has to deal with XML::Simple itself. XML works fairly well, though is slightly more work to deal with than JSON on the browser end. - Tags, JSON-based: This creates JSON objects through interpolation of strings. This works, and avoids the CPAN/JSON dependency, but is error prone, and wouldn't work well for a large number of scripts. - C4::Service (recently sent to patches list, so everything dealing with it is uncertain): I am slightly biased towards this approach because I wrote it, but I think it saves a lot of repetitive work in writing AJAX services. It requires its own script, unlike the approach used for the tags script, which has the disadvantage of requiring some duplicative coding, but this was not too horrible a problem even when writing AJAX circulation. C4::Service was originally part of the AJAX circulation patchset, but this is still in testing, so I decided to send it on its own. It comes with a HTML::Template-ish wrapper around CPAN's JSON module. It might be worth deciding on one or a blend of these approaches, as AJAX will continue to be important. -- Jesse Weaver
Hi, 2009/4/5 Jesse <pianohacker@gmail.com>:
Biblios, XML-based: Already in use, though only by Biblios. No wrapper, so each of the services has to deal with XML::Simple itself. XML works fairly well, though is slightly more work to deal with than JSON on the browser end.
But necessary for dealing with XML-based metadata carriers - can't all be JSON. :)
C4::Service (recently sent to patches list, so everything dealing with it is uncertain): I am slightly biased towards this approach because I wrote it, but I think it saves a lot of repetitive work in writing AJAX services. It requires its own script, unlike the approach used for the tags script, which has the disadvantage of requiring some duplicative coding, but this was not too horrible a problem even when writing AJAX circulation.
C4::Service was originally part of the AJAX circulation patchset, but this is still in testing, so I decided to send it on its own. It comes with a HTML::Template-ish wrapper around CPAN's JSON module.
I've gone ahead and pushed it. It works fine for the tags and reviews features, and there are lots of small web services I can envision that would benefit from this framework. For the bib services in svc/*, I will play around with writing a C4::Service::XML to standardize services that need to emit and consume XML. Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
participants (2)
-
Galen Charlton -
Jesse