Apache2::Autocomplete

Apache2::Autocomplete is a Perl module to autocomplete service backend via mod_perl.
Download

Apache2::Autocomplete Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Randy Kobes
  • Publisher web site:
  • http://search.cpan.org/~rkobes/

Apache2::Autocomplete Tags


Apache2::Autocomplete Description

Apache2::Autocomplete is a Perl module to autocomplete service backend via mod_perl. Apache2::Autocomplete is a Perl module to autocomplete service backend via mod_perl.SYNOPSISGiven some form that using Google's autocomplete that receives suggestions from http://localhost/complete/search: ###################################################### # in httpd.conf PerlModule Apache2::MyAutoComplete < Location /complete/search > SetHandler perl-script PerlResponseHandler Apache2::MyAutoComplete < /Location > ###################################################### ###################################################### # module file Apache2/MyAutoComplete.pm package Apache2::MyAutoComplete; use base qw(Apache2::Autocomplete); # use whatever else my @NAMES = qw(bob carol ted alice); sub expand { my ($self, $query) = @_; my $re = qr/^Q$queryE/i; my @names = grep /$re/, @NAMES; my @values = map {"some description"} @names; (lc $query, @names, @values, ); } sub handler { my $r = shift; my $ac = __PACKAGE__->new($r); $ac->run(); return Apache2::Const::OK; } ######################################################This module is a mod_perl2 interface to JavaScript::Autocomplete::Backend, which is a base class for implementing an autocomplete service for a form using the Google Suggest protocol. See http://www.google.com/webhp?complete=1&hl=en for an illustration of Google Suggest in operation, as well as http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html for a description of how the JavaScript code works.As well as mod_perl2, this package requires JavaScript::Autocomplete::Backend, as well as a CGI.pm-compatible CGI module for supplying the param() and header() methods. If available, CGI::Apache2::Wrapper will be used, which is a minimal module that uses methods of mod_perl2 and Apache2::Request to provide these methods; if this is not available, CGI (version 2.93 or greater) will be used.Operation of this service requires inclusion of the Autocomplete JavaScript code; a copy of this is included in this distribution, the latest version of which is available at http://www.google.com/ac.js. Requirements: · Perl


Apache2::Autocomplete Related Software