SRU::R...etrieve(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::Response::SearchRetrieve πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation set, and it's all about SRU::Response::SearchRetrieve β€” that's the 3pm one. it's a whole class for representing SRU searchRetrieve responses. yes, the real deal. sit down, hydrate, let's go 🫢


✨ NAME ✨

SRU::Response::SearchRetrieve β€” a class for representing SRU searchRetrieve responses. that's it, that's the vibe πŸ’…


🌸 SYNOPSIS 🌸

## create response from the request object
my $response = SRU::Response::SearchRetrieve->new( $request );

## add records to the response
foreach my $record ( @records ) { $response->addRecord( $record ); }

## print out the response as XML
print $response->asXML();

look at that. three little steps and you're iconic ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so SRU::Response::SearchRetrieve hands you a framework for bundling up the response to a searchRetrieve request. that's the whole point of it, no cap.

here's the deal though: you are the one responsible for generating the XML representation of the records. that part is on you, bestie 😭 the rest, though? the rest should be taken care of. handled. done. slay πŸŽ€


πŸ‘‘ METHODS πŸ‘‘

new()

no description given, she's mysterious. main character energy, honestly πŸ™ˆ

numberOfRecords()

returns the number of results associated with the object. literally just the count. that's it, that's the function πŸ“

addRecord()

adds a SRU::Response::Record object to the response.

$response->addRecord( $r );
⚠️ heads up bestie: if you don't pass in the right sort of object you'll get back undef and $SRU::Error will be populated appropriately. so like, don't be messy with your types πŸ’€

records()

gets or sets all the records associated with the object.

πŸ’€ be careful with this one :) you must pass in an array ref, and expect an array ref back. array ref in, array ref out. do not fight this. respect the contract πŸ”₯

resultSetId()

listed, no description. she's there. she exists. πŸ’œ

resultSetIdleTime()

also just vibing on the list, no description attached 🌈

nextRecordPosition()

same story, present and accounted for ⭐

diagnostics()

on the list, no notes 🧚

extraResponseData()

you guessed it β€” on the list πŸ’–

echoedSearchRetrieveRequest()

still on the list, still iconic ✨

asXML()

asXML(encoding=>"ISO-8859-1")

returns the object serialized as XML πŸŽ€

UTF-8 and UTF-16 are the default encodings if you don't pass the encoding parameter. and you can define a different encoding in order to parse your XML document correctly. so like, pick your encoding, be intentional about it πŸ’…


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. periodt 🫢


and that's the whole page bestie!! this was perl v5.34.0, dated 2022-06-17, from the SRU::R...etrieve(3pm) manual πŸ’œ go forth and bundle your responses responsibly, ily, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from