SRU::Server(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

πŸ’– SRU::Server πŸ’–

okay bestie, gather round, because we're talking about SRU::Server β€” a Perl module from the SRU::Server(3pm) manual page, living in User Contributed Perl Documentation. it does the absolute most in the best way: it lets you respond to SRU requests via CGI::Application, and honestly? iconic. ✨


🌈 SYNOPSIS 🌈

package MySRU;

use base qw( SRU::Server );

sub explain {
    my $self = shift;

    # $self->request isa SRU::Request::Explain
    # $self->response isa SRU::Response::Explain
}

sub scan {
    my $self = shift;

    # $self->request isa SRU::Request::Scan
    # $self->response isa SRU::Response::Scan
    # $self->cql is the root node of a CQL::Parser-parsed query
}

sub searchRetrieve {
    my $self = shift;

    # $self->request isa SRU::Request::SearchRetrieve
    # $self->response isa SRU::Response::SearchRetrieve
    # $self->cql is the root node of a CQL::Parser-parsed query
}

package main;

MySRU->new->run;

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe here is: this module gathers up all of the SRU verbs β€” explain, scan and searchRetrieve β€” and puts them together under one sub-classable object based on CGI::Application. that's it, that's the serve. πŸ’…


πŸŽ€ METHODS πŸŽ€

🌸 explain

this method is what you use to return an explain response. and plot twist: it's also the default method. main character energy fr fr πŸ‘‘

🌸 scan

this method returns a scan response. slay.

🌸 searchRetrieve

this method returns a searchRetrieve response. no cap. 🫢


✨ CGI::APPLICATION METHODS ✨

πŸ’œ setup

sets the run_modes, mode_param and the default runmode (explain). lowkey doing a lot of heavy lifting here.

πŸ’œ cgiapp_prerun

parses the incoming SRU request and, if needed, checks the CQL query. iykyk.

πŸ’œ cgiapp_postrun

sets the content type (text/xml) and serializes the response. periodt. πŸ”₯

πŸ’œ error_mode

stub error runmode. it's giving "placeholder but make it valid". 😭


πŸ‘‘ AUTHORS πŸ‘‘

  • Brian Cassidy <bricas@cpan.org>
  • Ed Summers <ehs@pobox.com>
  • Jakob Voss <voss@gbv.de>

three absolute legends, we stan. 🌟


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 basically: go off, remix it, redistribute it β€” same terms as Perl 5 itself. legal slay. βš–οΈβœ¨

and that's the whole page bestie, no notes πŸ’– this was SRU::Server(3pm), generated by perl v5.34.0, dated 2022-06-17. mwah, love u, go write some SRU responses πŸ§šβ€β™€οΈπŸŒˆ

πŸ“¦ where this page comes from