-# A blinder correctement
- [ map( $_ = [ split(",", $_)], split( "\n",C4::Context->preference("OAI-PMH:Set") ) ) ];
-}
-
-=head2 new
-
-The new method is the constructor for this class. It doesn't have any parameters and
-get required data from koha preferences. Koha I<LibraryName> is used to identify the
-OAI-PMH repository, I<OAI-PMH:MaxCount> is used to set the maximun number of records
-returned at the same time in answers to I<verb=ListRecords> or I<verb=ListIdentifiers>
-queries.
-
-The method return a blessed reference.
-
-=cut
-
-# constructor
-sub new
-{
- my $classname = shift;
- my $self = $classname->SUPER::new ();
-
- # set configuration
- $self->{'repositoryName'} = C4::Context->preference("LibraryName");
- $self->{'MaxCount'} = C4::Context->preference("OAI-PMH:MaxCount");
- $self->{'adminEmail'} = C4::Context->preference("KohaAdminEmailAddress");
-
- bless $self, $classname;
- return $self;
-}
-
-=head2 dispose
-
-The dispose method is used as a destructor. It call just the SUPER::dispose method.
-
-=cut
-
-# destructor
-sub dispose
-{
- my ($self) = @_;
- $self->SUPER::dispose ();
-}
-
-# now date
-sub now {
-my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime( time );
-
- sprintf( "%.4d-%.2d-%.2d", $year+1900, $mon+1,$mday );
-}
-
-# build the resumptionTocken fom ($metadataPrefix,$offset,$from,$until)
-
-=head2 buildResumptionToken and parseResumptionToken
-
-Theses two functions are used to manage resumption tokens. The choosed syntax is simple as
-possible, a token is only the metadata prefix, the offset in the full answer, the from and
-the until date (in the yyyy-mm-dd format) joined by ':' caracter.
-
-I<buildResumptionToken> get the four elements as parameters and return the ':' separated
-string.
-
-I<parseResumptionToken> is used to set the default values to the from and until date, the
-metadata prefix using the resumption tocken if necessary. This function have four parameters
-(from,until,metadata prefix and resumption tocken) which can be undefined and return every
-time this list of values correctly set. The missing values are set with defaults: offset=0,
-from= 1970-01-01 and until is set to current date.
-
-=cut
-
-sub buildResumptionToken {
- join( ':', @_ );
-}
-
-# parse the resumptionTocken
-sub parseResumptionToken {
-my ($from, $until, $metadataPrefix, $resumptionToken) = @_;
-my $offset = 0;
-
- if( $resumptionToken ) {
- ($metadataPrefix,$offset,$from,$until) = split( ':', $resumptionToken );
- }
-
- $from = "1970-01-01" unless( $from );
- $until = &now unless( $until );
- ($metadataPrefix, $offset, $from, $until );
-}
-
-=head2 Archive_ListSets
-
-return the full list Set to the I<verb=ListSets> query. Data are from the 'OAI-PMH:Set' preference.
-
-=cut
-
-# get full list of sets from the archive
-sub Archive_ListSets
-{
- &Set();
-}
-
-=head2 Archive_GetRecord
-
-This method select the record specified as its first parameter from the koha I<biblio>
-table and return a reference to a MARC::Record::KOHADC object.
-
-=cut
-
-# get a single record from the archive
-sub Archive_GetRecord
-{
- my ($self, $identifier, $metadataFormat) = @_;
- my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("SELECT biblionumber,timestamp FROM biblio WHERE biblionumber=?");
- my $prefixID = C4::Context->preference("OAI-PMH:archiveID"); $prefixID=qr{$prefixID:};
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.