View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Brian Duggan > Clustericious-0.9909 > Clustericious::RouteBuilder::Search



Annotate this POD

View/Report Bugs
Source   Latest Release: Clustericious-1.29


Clustericious::RouteBuilder::Search -- build routes for searching for objects


    use My::Object::Class;
    use Clustericious::RouteBuilder;
    use Clustericious::RouteBuilder::Search
            defaults => { manager_finder => "Manager::Finder::Class" },


    post => "/:plural/search" => [ plural => [ plurals() ] ] => \&do_create;


This automates the creation of routes for searching for objects.

Manager::Finder::Class must provide the following methods :

 - lookup_class : given the plural of a table, look up the name of the class

The route that is created turns a JSON structure which is POSTed into parameters for Rose::DB::Object::Manager::get_objects.

Additionally a "mode" parameters is suported, which just calls a search_$mode method within the manager class, and returns that resultset to the client.

syntax highlighting: