Click here to get back home

DISCUSS: CPAN Namespace for AJAX

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DISCUSS: CPAN Namespace for AJAX Lawrence Statton N1GAK/XE2 08-03-2005
Posted by Lawrence Statton N1GAK/XE2 on August 3, 2005, 9:18 am
Please log in for more thread options



I have a module that is ready for release, it just needs a (better)
name. The working title has been "Pail" (Perl/Ajax Implementation
Layer) but that does not fill me with joy, as it is utterly opaque.

I have noticed that there appear to be *no* AJAX related modules in
CPAN (which I find difficult to believe), and the only module I have
found OUTSIDE of CPAN was Sajax.pm which is pretty deficient (not
using the "X" in AJAX being at the top of the list.)

Some ideas that I have had:

1) HTTP::AJAX::Pail

Keeps the "cutesy" name, but puts it into a namespace where it will at
least invite reading.

2) HTTP::AJAX::Class

My module is an object-oriented base-class, and as such deserves a
highly generic name. (Although it has two variants, one that provides
XML marshalling for return values, and one that allows arbitrary text
return).

A little detail about the functionality:

On the server side, you write a class

package My::Class;
use base 'HTTP::AJAX::Pail';

sub get_record {
my ($self, $paramhash) = @_ ;
return undef unless exists $paramhash->;
my $message = do_something($paramhash->);
return ( { record_num => $paramhash-> ,
record_text => $message } );
}

1;

In your javascript you do something roughly like:

<script src="http://server/ajax-port.cgi?method=javascript">

<script>

function Completion_function(r) {
var xml = r.responseXML;
... do something with the XML ...
}

function get_detail(record_num) {
var r = new My_Class;
r.some_method( Completion_function, { 'record_num' : record_num } );
}

</script>

There are some other details I'm glossing over right now, because they
seem to be outside the scope of the "What do I *CALL* this thing?"
discussion.

FYI (because you're dying to know) - the method=javascript is a
'magical' method that walks your derived class's symbol table, and
creates a javascript class, 'My_Class' with stub routines to build the
AJAX request and fire it off.

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
sort them into the correct order.


Similar ThreadsPosted
Marquis:: namespace on CPAN. December 5, 2006, 9:32 pm
Choosing a good namespace for a module to upload to CPAN July 14, 2004, 1:46 pm
CGI::AJAX and header June 16, 2006, 4:06 pm
Modules for AJAX framework April 2, 2007, 11:15 pm
Is there a better way to reset CGI object for AJAX POSTDATA? December 21, 2007, 6:10 pm
Looking for AJAX HTML Table Form Module August 15, 2007, 11:29 am
Upgrading to CPAN.pm v1.76 install Bundle::CPAN fails May 10, 2005, 9:51 pm
Use CPAN or CPAN::Shell for LOCAL ONLY install from tarballs? May 9, 2008, 1:04 pm
SGF namespace August 1, 2005, 5:18 pm
New Namespace? January 27, 2007, 3:00 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap