Cataly...er::SRU(3pm)

πŸ“¦
version 1.01 Β· 2 versions
  • 1.01 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.01 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Catalyst::Controller::SRU β€” the perl doc girlies' edition πŸ’–

okay bestie, come sit with me, we're doing Catalyst::Controller::SRU from the User Contributed Perl Documentation, section 3pm. It's a Perl module, it's a whole vibe, and it's gonna make your controller dispatch SRU stuff like it's nothing. πŸ¦‹


✨ NAME ✨

Catalyst::Controller::SRU β€” Dispatch SRU methods with Catalyst. That's it, that's the whole name. Short, sweet, iconic. πŸ‘‘


✨ SYNOPSIS ✨

literally just use it as a base controller and write your three little subs, bestie:

package MyApp::Controller::SRU;

# use it as a base controller
use base qw( Catalyst::Controller::SRU );

# explain, scan and searchretrieve methods
sub explain {
    my ( $self, $c,
        $sru_request,  # ISA SRU::Request::Explain
        $sru_response, # ISA SRU::Response::Explain
    ) = @_;
}

sub scan {
    my ( $self, $c,
        $sru_request,  # ISA SRU::Request::Scan
        $sru_response, # ISA SRU::Response::Scan
        $cql,          # ISA CQL::Parser root node
    ) = @_;

}

sub searchRetrieve {
    my ( $self, $c,
        $sru_request,  # ISA SRU::Request::SearchRetrieve
        $sru_response, # ISA SRU::Response::SearchRetrieve
        $cql,          # ISA CQL::Parser root node
    ) = @_;
}

see how the $cql arg only shows up for scan and searchRetrieve? yeah. explain is the low-maintenance one. slay. πŸ’…


✨ DESCRIPTION ✨

So here's the tea: this module lets your controller class dispatch SRU actions β€” that's "explain", "scan", and "searchRetrieve" β€” from its own class. No extra plumbing, no side quests, just your controller doing the thing. periodt. ✨


✨ METHODS ✨

πŸŽ€ index : Private πŸŽ€

okay so this is the private one, the backstage manager, the main character behind the scenes. This method will create an SRU request, response and possibly a CQL object based on the type of SRU request it finds. Then it hands all that data over to your customized method. so basically it does the setup so you can do the fun part. 🫢


✨ SEE ALSO ✨

  • Catalyst 🌈
  • SRU 🌈

go read those too, bestie, it's giving homework but the good kind. πŸ“š


✨ AUTHORS ✨

Brian Cassidy <bricas@cpan.org> β€” yeah, he wrote this. give him his flowers. πŸ’


This software is copyright (c) 2013 by Ed Summers.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go wild, but respectfully. πŸ’–


reminder bestie: private means private. index is doing its little behind-the-scenes work, don't go calling it like it's a public API. πŸ™ˆ

and that's the whole page!! no notes. ate. πŸ’…

mwah πŸ’‹ this was perl v5.34.0, dated 2022-06-17, brought to you by the Cataly...er::SRU(3pm) era of the User Contributed Perl Documentation. stay iconic, bestie. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from