Re: [CODE4LIB] ajax
If you're looking at the cvs repository, check out RemoteRequest.js in particular. It's an XMLHTTPRequest wrapper class that manages requests and does some behind the scenes magic. An example: var req = new RemoteRequest(service, method, param1, param2, ...); req.setCompleteCallback( function(request) { var obj = request.getResultObject(); alert("The internet gave me an object => " + obj.blah()); } ); req.send(); This fires off an asynchronous xmlhttp request with a specially crafted url. Apache handles the request and any data returned is run through a JSON parser and turned into a javascript object. The object can then be retrieved from within the anonymous callback. This has worked well for us and basically just requires the XMLHTTPRequest wrapper class, a hand tuned JSON parser (in ILS/OpenSRF/src/javascript), and an Apache module that can turn the request into something meaningful for your framework. -bill -Original Message- From: Code for Libraries on behalf of Peter Murray Sent: Fri 6/10/2005 1:00 PM To: CODE4LIB@listserv.nd.edu Cc: Subject:SPAM: Re: [CODE4LIB] ajax -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike -- It is kinda hard to visualize, although I'd really like to try. Is there a demo available somewhere? Peter On 6/10/05 12:22 PM, Mike Rylander wrote: | | | If anyone feels like digging into an app that's extremely heavy with | XMLHttpRequest stuff you may want to look at Evergreen, a.k.a | Open-ILS. The entire staff client, which is written in XUL, and the | current version of the OPAC are entirely "ajax" driven. We use it to | connect, via an Apache module, to our back end cluster. | | http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/src/javascript/util/ | | - -- Peter Murray http://www.pandc.org/peter/work/ Assistant Director, Multimedia Systems tel:+1-614-728-3600;ext=338 OhioLINK: the Ohio Library and Information Network Columbus, Ohio -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.0 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCqcdF4+t4qSfPIHIRAt6kAKC2jTtS809gCMB6XzQqMmb3/jaJqgCdGuKV lms5p1f8w/5YN6txjjlMKc4= =NyBM -END PGP SIGNATURE-
Re: [CODE4LIB] ajax
> It is kinda hard to visualize, although I'd really like to try. Is > there a demo available somewhere? http://gapines.org/opac/ cheers, not_mike
Re: [CODE4LIB] ajax
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike -- It is kinda hard to visualize, although I'd really like to try. Is there a demo available somewhere? Peter On 6/10/05 12:22 PM, Mike Rylander wrote: | | | If anyone feels like digging into an app that's extremely heavy with | XMLHttpRequest stuff you may want to look at Evergreen, a.k.a | Open-ILS. The entire staff client, which is written in XUL, and the | current version of the OPAC are entirely "ajax" driven. We use it to | connect, via an Apache module, to our back end cluster. | | http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/src/javascript/util/ | | - -- Peter Murray http://www.pandc.org/peter/work/ Assistant Director, Multimedia Systems tel:+1-614-728-3600;ext=338 OhioLINK: the Ohio Library and Information Network Columbus, Ohio -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.0 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCqcdF4+t4qSfPIHIRAt6kAKC2jTtS809gCMB6XzQqMmb3/jaJqgCdGuKV lms5p1f8w/5YN6txjjlMKc4= =NyBM -END PGP SIGNATURE-
Re: [CODE4LIB] ajax
On 6/10/05, Eric Lease Morgan <[EMAIL PROTECTED]> wrote: > Ajax is a thing I'd like to play with more: > >http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html > > By exploiting a Javascript function called XMLHttpRequest it is > possible to create Web pages that seem more like desktop applications. > By not forcing the user to go from page to page to page it is possible > to keep the attention of users longer as well as provide a more > interactive experience. The link above describes this in more detail > and points to a number of Javascript libraries for a number of > languages enabling you to write such applications more easily. > > FYI. > If anyone feels like digging into an app that's extremely heavy with XMLHttpRequest stuff you may want to look at Evergreen, a.k.a Open-ILS. The entire staff client, which is written in XUL, and the current version of the OPAC are entirely "ajax" driven. We use it to connect, via an Apache module, to our back end cluster. http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/src/javascript/util/ Another very nice (though not as groundbreaking) technology we've paired with XMLHttpRequest is JSON. http://www.crockford.com/JSON/index.html Yes, it's YAML, but the speed and ease of use benefits are huge when writing a browser-based app. We've extended JSON a bit to handle user defined classes (on the javascript side) and packages on the perl side. We hide a "hint" in a set of comments surrounding the JSON object which tells our code what class to use so that the JSON string is 100% compatible with any standard JSON parser, and we don't run the risk of using a property that someone wants for himself. // standard JSON "object" representing a person: { 'firstname' : 'Mike', 'lastname' : 'Rylander, 'age' : 26, 'eyes' : 'blue', { 'street1' : '123 main st', 'city' : 'anywhere', 'country' : 'usa', 'zip' : '10101' } } // our extended JSON that will create the correct class // instance in any supporting language /**S person**/ { 'firstname' : 'Mike', 'lastname' : 'Rylander, 'age' : 26, 'eyes' : 'blue', /**S addr**/ { 'street1' : '123 main st', 'city' : 'anywhere', 'country' : 'usa', 'zip' : '10101' } /**E addr**/ } /**E person**/ All of our data is passed around as extended JSON-serialized objects, so javascript can just use 'XMLHttpRequest.responseText' to get the content and then 'eval' the objects into existence. To use our class hint extensions we simply pass the JSON through a regex to replace the comments with the appropriate code for instantiating the correct object, then 'eval' it. Writing a Perl module to handle our extended JSON was super easy and we have a C library to handle it as well. I'm sure any other language would be very easy to support even with our class hinting extension. -- Mike Rylander [EMAIL PROTECTED] GPLS -- PINES Development Database Developer http://open-ils.org
Re: [CODE4LIB] ajax
The fact that the XMLHttpRequest is a de facto standard and not an actual standard worries me though, with out being accepted by the w3c, it seems like a very volatile technology. But if google is using it, i guess we are safe. :) I'd be interested to see some examples if you create any. Andrew Eric Lease Morgan wrote: Ajax is a thing I'd like to play with more: http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html By exploiting a Javascript function called XMLHttpRequest it is possible to create Web pages that seem more like desktop applications. By not forcing the user to go from page to page to page it is possible to keep the attention of users longer as well as provide a more interactive experience. The link above describes this in more detail and points to a number of Javascript libraries for a number of languages enabling you to write such applications more easily. FYI. -- Eric Morgan
Re: [CODE4LIB] browser toolbars
On Jun 10, 2005, at 3:00 AM, Gianluca Drago wrote: On the other hand, Firefox is free, anyone can install it from the web, without the need to throw Internet Explorer away, he can have both browsers coexist together inside his desktop. What if, instead of running inside a Firefox window, the toolbar could run inside its own container, as for instance in the Mozilla Amazon Browser (http://www.infodraft.com/~faser/mab/)? I think the real node is: "Is this kind of technology useful?" If yes people will start using it no matter if they usually surf the web with a different browser. For my work is really valuable this exchange of thoughts, I hope I didn't abuse of your patience. In no way is anybody abusing my patience. Believe it or not, that is one thing I have in great abundance, but that is another story. Whether we like it or not, the most useful technology is not necessarily the one that gets... used. The classic example is Beta versus VHS. I could bring up operating systems, but that would be preaching to the choir. I use Firefox as my primary browser mostly for its XML display features. I liked IE for the Mac for the same reason. I am now playing with Safari because of its cool RSS reader capabilities, but it don't do the XML thing. These sorts of differences are subtle when compared to most people's needs, and most people are going to use the browser that is installed on their (Windows) desktop. For better or worse, I am almost compelled to work with that environment. The best I can hope for are company-independent standards and implementations. No proprietary features or additions. No operating system specific thingees. The Firefox Search Bar extension examples go in the right direction because they require just a text editor to create and work across operating systems. No need for operating system-level libraries and such. -- Eric Morgan University Libraries of Notre Dame
[CODE4LIB] ajax
Ajax is a thing I'd like to play with more: http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html By exploiting a Javascript function called XMLHttpRequest it is possible to create Web pages that seem more like desktop applications. By not forcing the user to go from page to page to page it is possible to keep the attention of users longer as well as provide a more interactive experience. The link above describes this in more detail and points to a number of Javascript libraries for a number of languages enabling you to write such applications more easily. FYI. -- Eric Morgan
Re: [CODE4LIB] browser toolbars
I found the links above *very* helpful, thank you, but now I am torn. On one hand I see extraordinary power and functionality in the creation of these toolbars. All you need is a text editor and knowledge of a few computing technologies. On the other hand, they will only work with Firefox, and too few people use this browser. Chagrin. -- Eric Morgan Eric, first of all I must admit I am not neutral in the choice between Internet Explorer and a community-developed open-source software as Firefox is :-) I developed a Firefox toolbar not only to give our patrons a new tool to play with, but also to promote the "freedom of choice". That said, I understand that the vast majority of people use Internet Explorer and I 'm not here to convince anyone to waste his time in developing a niche tool. On the other hand, Firefox is free, anyone can install it from the web, without the need to throw Internet Explorer away, he can have both browsers coexist together inside his desktop. What if, instead of running inside a Firefox window, the toolbar could run inside its own container, as for instance in the Mozilla Amazon Browser (http://www.infodraft.com/~faser/mab/)? I think the real node is: "Is this kind of technology useful?" If yes people will start using it no matter if they usually surf the web with a different browser. It also depends on how your library services (catalogs, databases, ill/dd service, and so on) are presented in Internet. If you already have a well structured portal maybe a tool like this is redundant, if your services are 'hidden' at the four corners of the web and you must click and re-click, and click again to reach them, maybe a toolbar will make sense. You can think of it as a client library portal, where you don't have a server side library portal, or -- to say it with the words of Lorcan Dempsey (http://orweblog.oclc.org/archives/000505.html) -- as an 'intrastructure', a desktop tool for interaction and integration. Moreover it could be useful in kiosks where you have freedom to choose which browser to install (actually at the University of Padua we have kiosks with Linux and Firefox.) For my work is really valuable this exchange of thoughts, I hope I didn't abuse of your patience. Gianluca --- "Is not patrons that build the library, it's the library that builds patrons". (One of the first things I learned as a librarian)