Nicolas Franck
and 2 contributors

NAME

Catmandu::Store::AlephX - A Catmandu AlephX service implemented as Catmandu::Store

SYNOPSIS

 use Catmandu::Store::AlephX;

 my $store = Catmandu::Store::AlephX->new(url => 'http://aleph.ugent.be/X' , username => 'XXX' , password => 'XXX');

 $store->bag('usm01')->each(sub {
 });

METHODS

get($id)

Retrieves a record from the Aleph database. Requires a record identifier. Returns a Catmandu MARC record when found and undef on failure.

add($catmandu_marc)

Adds or updates a record to the Aleph database. Requires a Catmandu type MARC record and a _id field containing the Aleph record number. This method with throw an error when an add cant be executed.

example

  #add new record. WARNING: Aleph will ignore the 001 field, 
  my $new_record = eval {
    $bag->add({
    record =>  [
      [
        'FMT',
        '',
        '',
        '_',
        'SE'
      ],
      [
        'LDR',
        '',
        '',
        '_',
        '00000cas^^2200385^a^4500'
      ],
      [
        '001',
        '',
        '',
        '_',
        '000000444'
      ],
      [
        '005',
        '',
        '',
        '_',
        '20140212095615.0'
      ] 
      ..
    ]    
  });

  };
  if ($@) {
    die "add failed $@";
  }

  say "new record:".$record->{_id};

delete($id)

Deletes a record from the Aleph database. Requires a record identifier. Returns a true value when the record is deleted.

each(callback)

Loops over all records in the Aleph database executing callback for every record.

search(query => $query, start => 0 , limit => 20);

searcher()

Not implemented

delete_all()

Not implemented

delete_by_query()

Not implemented

SEE ALSO

Catmandu::Store