.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTTP::OAI::Repository 3pm" .TH HTTP::OAI::Repository 3pm "2016-07-15" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTTP::OAI::Repository \- Documentation for building an OAI compliant repository using OAI\-PERL .SH "DESCRIPTION" .IX Header "DESCRIPTION" Using the OAI-PERL library in a repository context requires the user to build the \s-1OAI\s0 responses to be sent to \s-1OAI\s0 harvesters. .SH "SYNOPSIS 1" .IX Header "SYNOPSIS 1" .Vb 4 \& use HTTP::OAI::Harvester; \& use HTTP::OAI::Metadata::OAI_DC; \& use XML::SAX::Writer; \& use XML::LibXML; \& \& # (all of these options _must_ be supplied to comply with the OAI protocol) \& # (protocolVersion and responseDate both have sensible defaults) \& my $r = new HTTP::OAI::Identify( \& baseURL=>\*(Aqhttp://yourhost/cgi/oai\*(Aq, \& adminEmail=>\*(Aqyouremail@yourhost\*(Aq, \& repositoryName=>\*(Aqagoodname\*(Aq, \& requestURL=>self_url() \& ); \& \& # Include a description (an XML::LibXML Dom object) \& $r\->description(new HTTP::OAI::Metadata(dom=>$dom)); \& \& my $r = HTTP::OAI::Record\->new( \& header=>HTTP::OAI::Header\->new( \& identifier=>\*(Aqoai:myrepo:10\*(Aq, \& datestamp=>\*(Aq2004\-10\-01\*(Aq \& ), \& metadata=>HTTP::OAI::Metadata::OAI_DC\->new( \& dc=>{title=>[\*(AqHello, World!\*(Aq],description=>[\*(AqMy Record\*(Aq]} \& ) \& ); \& $r\->about(HTTP::OAI::Metadata\->new(dom=>$dom)); \& \& my $writer = XML::SAX::Writer\->new(); \& $r\->set_handler($writer); \& $r\->generate; .Ve .SH "Building an OAI compliant repository" .IX Header "Building an OAI compliant repository" The validation scripts included in this module provide the repository admin with a number of tools for helping with being \s-1OAI\s0 compliant, however they can not be exhaustive in themselves. .SH "METHODS" .IX Header "METHODS" .ie n .IP "$r = HTTP::OAI::Repository::validate_request(%paramlist)" 4 .el .IP "\f(CW$r\fR = HTTP::OAI::Repository::validate_request(%paramlist)" 4 .IX Item "$r = HTTP::OAI::Repository::validate_request(%paramlist)" .PD 0 .ie n .IP "$r = HTTP::OAI::Repository::validate_request_2_0(%paramlist)" 4 .el .IP "\f(CW$r\fR = HTTP::OAI::Repository::validate_request_2_0(%paramlist)" 4 .IX Item "$r = HTTP::OAI::Repository::validate_request_2_0(%paramlist)" .PD These functions, exported by the Repository module, validate an \s-1OAI\s0 request against the protocol requirements. Returns an HTTP::Response object, with the code set to 200 if the request is well-formed, or an error code and the message set. .Sp e.g: .Sp .Vb 1 \& my $r = validate_request(%paramlist); \& \& print header(\-status=>$r\->code.\*(Aq \*(Aq.$r\->message), \& $r\->error_as_HTML; .Ve .Sp Note that validate_request attempts to be as strict to the Protocol as possible. .ie n .IP "$b = HTTP::OAI::Repository::validate_date($date)" 4 .el .IP "\f(CW$b\fR = HTTP::OAI::Repository::validate_date($date)" 4 .IX Item "$b = HTTP::OAI::Repository::validate_date($date)" .PD 0 .ie n .IP "$b = HTTP::OAI::Repository::validate_metadataPrefix($mdp)" 4 .el .IP "\f(CW$b\fR = HTTP::OAI::Repository::validate_metadataPrefix($mdp)" 4 .IX Item "$b = HTTP::OAI::Repository::validate_metadataPrefix($mdp)" .ie n .IP "$b = HTTP::OAI::Repository::validate_responseDate($date)" 4 .el .IP "\f(CW$b\fR = HTTP::OAI::Repository::validate_responseDate($date)" 4 .IX Item "$b = HTTP::OAI::Repository::validate_responseDate($date)" .ie n .IP "$b = HTTP::OAI::Repository::validate_setSpec($set)" 4 .el .IP "\f(CW$b\fR = HTTP::OAI::Repository::validate_setSpec($set)" 4 .IX Item "$b = HTTP::OAI::Repository::validate_setSpec($set)" .PD These functions, exported by the Repository module, validate the given type of \s-1OAI\s0 data. Returns true if the given value is sane, false otherwise. .SH "EXAMPLE" .IX Header "EXAMPLE" See the bin/gateway.pl for an example implementation (it's actually for creating a static repository gateway, but you get the idea!).