my( $self, $circid ) = @_;
my $circ; my $evt;
- $logger->debug("Fetching circ $circid from storage");
+ $logger->debug("Fetching circ $circid from cstore");
$circ = $self->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.action.circulation.retrieve", $circid );
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.action.circulation.retrieve", $circid );
if(!$circ) {
$evt = OpenILS::Event->new('ACTION_CIRCULATION_NOT_FOUND', circid => $circid );
my( $self, $copyid ) = @_;
my( $record, $evt );
- $logger->debug("Fetching record by copy $copyid from storage");
+ $logger->debug("Fetching record by copy $copyid from cstore");
$record = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.fleshed.biblio.record_entry.retrieve_by_copy', $copyid );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.asset.copy.retrieve', $copyid,
+ { flesh => 3,
+ flesh_fields => { bre => [ 'fixed_fields' ],
+ acn => [ 'record' ],
+ acp => [ 'call_number' ],
+ }
+ }
+ );
if(!$record) {
$evt = OpenILS::Event->new('BIBLIO_RECORD_ENTRY_NOT_FOUND');
+ } else {
+ $record = $record->call_number->record;
}
return ($record, $evt);
my( $self, $holdid ) = @_;
my( $hold, $evt );
- $logger->debug("Fetching hold $holdid from storage");
+ $logger->debug("Fetching hold $holdid from cstore");
$hold = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.action.hold_request.retrieve', $holdid);
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.action.hold_request.retrieve', $holdid);
$evt = OpenILS::Event->new('ACTION_HOLD_REQUEST_NOT_FOUND', holdid => $holdid) unless $hold;
my( $self, $holdid ) = @_;
my( $transit, $evt );
- $logger->debug("Fetching transit by hold $holdid from storage");
+ $logger->debug("Fetching transit by hold $holdid from cstore");
$transit = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.action.hold_transit_copy.search.hold', $holdid );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.action.hold_transit_copy.search.hold', $holdid );
$evt = OpenILS::Event->new('ACTION_HOLD_TRANSIT_COPY_NOT_FOUND', holdid => $holdid) unless $transit;
$logger->debug("Searching for active hold for copy $copyid");
my( $hold, $evt );
- $hold = $self->storagereq(
- 'open-ils.storage.direct.action.hold_request.search_where',
+ $hold = $self->cstorereq(
+ 'open-ils.cstore.direct.action.hold_request.search',
{
current_copy => $copyid ,
capture_time => { "!=" => undef },
my( $self, $transid ) = @_;
my( $htransit, $evt );
$logger->debug("Fetching hold transit with hold id $transid");
- $htransit = $self->storagereq(
- 'open-ils.storage.direct.action.hold_transit_copy.retrieve', $transid );
+ $htransit = $self->cstorereq(
+ 'open-ils.cstore.direct.action.hold_transit_copy.retrieve', $transid );
$evt = OpenILS::Event->new('ACTION_HOLD_TRANSIT_COPY_NOT_FOUND', id => $transid) unless $htransit;
return ($htransit, $evt);
}
my( $self, $barcode ) = @_;
my( $copy, $evt );
- $logger->debug("Fetching copy by barcode $barcode from storage");
+ $logger->debug("Fetching copy by barcode $barcode from cstore");
- $copy = $self->simplereq( 'open-ils.storage',
- 'open-ils.storage.direct.asset.copy.search_where', { barcode => $barcode, deleted => 'f'} );
+ $copy = $self->simplereq( 'open-ils.cstore',
+ 'open-ils.cstore.direct.asset.copy.search', { barcode => $barcode, deleted => 'f'} );
#'open-ils.storage.direct.asset.copy.search.barcode', $barcode );
$evt = OpenILS::Event->new('ASSET_COPY_NOT_FOUND', barcode => $barcode) unless $copy;
my( $self, $transid ) = @_;
my( $transaction, $evt );
- $logger->debug("Fetching open billable transaction $transid from storage");
+ $logger->debug("Fetching open billable transaction $transid from cstore");
$transaction = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.money.open_billable_transaction_summary.retrieve', $transid);
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.money.open_billable_transaction_summary.retrieve', $transid);
$evt = OpenILS::Event->new(
'MONEY_OPEN_BILLABLE_TRANSACTION_SUMMARY_NOT_FOUND', transid => $transid ) unless $transaction;
my $meth = $buckets{$type};
$bucket = $self->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.container.$meth.retrieve", $id );
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.container.$meth.retrieve", $id );
$evt = OpenILS::Event->new(
$e, container => $id, container_type => $type ) unless $bucket;
my $meth = $buckets{$type} . "_item";
$bucket = $self->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.container.$meth.retrieve", $id );
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.container.$meth.retrieve", $id );
my $e = 'CONTAINER_CALL_NUMBER_BUCKET_ITEM_NOT_FOUND';
my $self = shift;
$logger->debug("Fetching patron standings");
return $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.config.standing.retrieve.all.atomic');
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.config.standing.search.atomic', { id => { '!=' => undef } });
}
my( $self ) = @_;
$logger->debug("Fetching copy statuses");
return $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.config.copy_status.retrieve.all.atomic' );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.config.copy_status.search.atomic', { id => { '!=' => undef } });
}
sub fetch_copy_location {
my( $self, $id ) = @_;
my $evt;
- my $cl = $self->storagereq(
- 'open-ils.storage.direct.asset.copy_location.retrieve', $id );
+ my $cl = $self->cstorereq(
+ 'open-ils.cstore.direct.asset.copy_location.retrieve', $id );
$evt = OpenILS::Event->new('ASSET_COPY_LOCATION_NOT_FOUND') unless $cl;
return ($cl, $evt);
}
sub fetch_copy_locations {
my $self = shift;
return $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.asset.copy_location.retrieve.all.atomic');
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.asset.copy_location.search.atomic', { id => { '!=' => undef } });
}
sub fetch_copy_location_by_name {
my( $self, $name, $org ) = @_;
my $evt;
- my $cl = $self->storagereq(
- 'open-ils.storage.direct.asset.copy_location.search_where',
+ my $cl = $self->cstorereq(
+ 'open-ils.cstore.direct.asset.copy_location.search',
{ name => $name, owning_lib => $org } );
$evt = OpenILS::Event->new('ASSET_COPY_LOCATION_NOT_FOUND') unless $cl;
return ($cl, $evt);
$logger->debug("Fetching callnumber $id");
my $cn = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.asset.call_number.retrieve', $id );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.asset.call_number.retrieve', $id );
$evt = OpenILS::Event->new( 'ASSET_CALL_NUMBER_NOT_FOUND', id => $id ) unless $cn;
return ( $cn, $evt );
my $evt = undef;
my $org = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.actor.org_unit.retrieve', $id );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.actor.org_unit.retrieve', $id );
$evt = OpenILS::Event->new( 'ACTOR_ORG_UNIT_NOT_FOUND', id => $id ) unless $org;
$ORG_CACHE{$id} = $org;
my( $cat, $evt );
$logger->debug("Fetching $type stat cat: $id");
$cat = $self->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.$type.stat_cat.retrieve", $id );
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.$type.stat_cat.retrieve", $id );
my $e = 'ASSET_STAT_CAT_NOT_FOUND';
$e = 'ACTOR_STAT_CAT_NOT_FOUND' if $type eq 'actor';
my( $entry, $evt );
$logger->debug("Fetching $type stat cat entry: $id");
$entry = $self->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.$type.stat_cat_entry.retrieve", $id );
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.$type.stat_cat_entry.retrieve", $id );
my $e = 'ASSET_STAT_CAT_ENTRY_NOT_FOUND';
$e = 'ACTOR_STAT_CAT_ENTRY_NOT_FOUND' if $type eq 'actor';
my( $self, $name, $orgId ) = @_;
$logger->debug("Fetching non cat type $name at org $orgId");
my $types = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.config.non_cataloged_type.search_where.atomic',
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.config.non_cataloged_type.search.atomic',
{ name => $name, owning_lib => $orgId } );
return ($types->[0], undef) if($types and @$types);
return (undef, OpenILS::Event->new('CONFIG_NON_CATALOGED_TYPE_NOT_FOUND') );
$logger->debug("Fetching non cat type $id");
my( $type, $evt );
$type = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.config.non_cataloged_type.retrieve', $id );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.config.non_cataloged_type.retrieve', $id );
$evt = OpenILS::Event->new('CONFIG_NON_CATALOGED_TYPE_NOT_FOUND') unless $type;
return ($type, $evt);
}
my( $self, $name ) = @_;
my( $dur, $evt );
$dur = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.config.rules.circ_duration.search.name.atomic', $name );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.config.rules.circ_duration.search.atomic', { name => $name } );
$dur = $dur->[0];
$evt = OpenILS::Event->new('CONFIG_RULES_CIRC_DURATION_NOT_FOUND') unless $dur;
return ($dur, $evt);
my( $self, $name ) = @_;
my( $obj, $evt );
$obj = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.config.rules.recuring_fine.search.name.atomic', $name );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.config.rules.recuring_fine.search.atomic', { name => $name | );
$obj = $obj->[0];
$evt = OpenILS::Event->new('CONFIG_RULES_RECURING_FINE_NOT_FOUND') unless $obj;
return ($obj, $evt);
my( $self, $name ) = @_;
my( $obj, $evt );
$obj = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.config.rules.max_fine.search.name.atomic', $name );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.config.rules.max_fine.search.atomic', { name => $name } );
$obj = $obj->[0];
$evt = OpenILS::Event->new('CONFIG_RULES_MAX_FINE_NOT_FOUND') unless $obj;
return ($obj, $evt);
'open-ils.storage', $method, @params );
}
+sub cstorereq {
+ my( $self, $method, @params ) = @_;
+ return $self->simplereq(
+ 'open-ils.cstore', $method, @params );
+}
+
sub event_equals {
my( $self, $e, $name ) = @_;
if( $e and ref($e) eq 'HASH' and
my( $self, $cid ) = @_;
my $evt;
$self->logmark;
- my $circ = $self->storagereq(
- 'open-ils.storage.direct.action.open_circulation.search_where',
+ my $circ = $self->cstorereq(
+ 'open-ils.cstore.direct.action.open_circulation.search',
{ target_copy => $cid, xact_finish => undef } );
$evt = OpenILS::Event->new('ACTION_CIRCULATION_NOT_FOUND') unless $circ;
return ($circ, $evt);
sub fetch_open_transit_by_copy {
my( $self, $copyid ) = @_;
my($transit, $evt);
- $transit = $self->storagereq(
- 'open-ils.storage.direct.action.transit_copy.search_where',
+ $transit = $self->cstorereq(
+ 'open-ils.cstore.direct.action.transit_copy.search_where',
{ target_copy => $copyid, dest_recv_time => undef });
$evt = OpenILS::Event->new('ACTION_TRANSIT_COPY_NOT_FOUND') unless $transit;
return ($transit, $evt);
my( $self, $id ) = @_;
my($xact, $evt);
$logger->debug("Fetching billable transaction %id");
- $xact = $self->storagereq(
- 'open-ils.storage.direct.money.billable_transaction.retrieve', $id );
+ $xact = $self->cstorereq(
+ 'open-ils.cstore.direct.money.billable_transaction.retrieve', $id );
$evt = OpenILS::Event->new('MONEY_BILLABLE_TRANSACTION_NOT_FOUND') unless $xact;
return ($xact, $evt);
}
my( $self, $id ) = @_;
my( $copy, $evt );
$logger->info("Fetching fleshed copy $id");
- $copy = $self->storagereq(
- "open-ils.storage.fleshed.asset.copy.retrieve", $id );
+ $copy = $self->cstorereq(
+ "open-ils.cstore.fleshed.asset.copy.retrieve", $id );
$evt = OpenILS::Event->new('ASSET_COPY_NOT_FOUND', id => $id) unless $copy;
return ($copy, $evt);
}
my( $self, $id ) = @_;
my( $note, $evt );
$logger->debug("Fetching copy note $id");
- $note = $self->storagereq(
- 'open-ils.storage.direct.asset.copy_note.retrieve', $id );
+ $note = $self->cstorereq(
+ 'open-ils.cstore.direct.asset.copy_note.retrieve', $id );
$evt = OpenILS::Event->new('ASSET_COPY_NOTE_NOT_FOUND', id => $id ) unless $note;
return ($note, $evt);
}
sub fetch_call_numbers_by_title {
my( $self, $titleid ) = @_;
$logger->info("Fetching call numbers by title $titleid");
- return $self->storagereq(
- 'open-ils.storage.direct.asset.call_number.search_where.atomic',
+ return $self->cstorereq(
+ 'open-ils.cstore.direct.asset.call_number.search.atomic',
{ record => $titleid, deleted => 'f' });
#'open-ils.storage.direct.asset.call_number.search.record.atomic', $titleid);
}
sub fetch_copies_by_call_number {
my( $self, $cnid ) = @_;
$logger->info("Fetching copies by call number $cnid");
- return $self->storagereq(
- 'open-ils.storage.direct.asset.copy.search_where.atomic', { call_number => $cnid, deleted => 'f' } );
+ return $self->cstorereq(
+ 'open-ils.cstore.direct.asset.copy.search.atomic', { call_number => $cnid, deleted => 'f' } );
#'open-ils.storage.direct.asset.copy.search.call_number.atomic', $cnid );
}
sub fetch_user_by_barcode {
my( $self, $bc ) = @_;
- my $cardid = $self->storagereq(
- 'open-ils.storage.id_list.actor.card.search.barcode', $bc );
+ my $cardid = $self->cstorereq(
+ 'open-ils.cstore.id_list.actor.card.search', { barcode => $bc } );
return (undef, OpenILS::Event->new('ACTOR_CARD_NOT_FOUND', barcode => $bc)) unless $cardid;
- my $user = $self->storagereq(
- 'open-ils.storage.direct.actor.user.search.card', $cardid );
+ my $user = $self->cstorereq(
+ 'open-ils.cstore.direct.actor.user.search', { card => $cardid } );
return (undef, OpenILS::Event->new('ACTOR_USER_NOT_FOUND', card => $cardid)) unless $user;
return ($user);
sub fetch_bill {
my( $self, $billid ) = @_;
$logger->debug("Fetching billing $billid");
- my $bill = $self->storagereq(
- 'open-ils.storage.direct.money.billing.retrieve', $billid );
+ my $bill = $self->cstorereq(
+ 'open-ils.cstore.direct.money.billing.retrieve', $billid );
my $evt = OpenILS::Event->new('MONEY_BILLING_NOT_FOUND') unless $bill;
return($bill, $evt);
}
my @results;
my @marcxml_objs;
- my $session = OpenSRF::AppSession->create("open-ils.storage");
+ my $session = OpenSRF::AppSession->create("open-ils.cstore");
my $request = $session->request(
- "open-ils.storage.direct.biblio.record_entry.batch.retrieve", @ids );
+ "open-ils.cstore.direct.biblio.record_entry.search", { id => \@ids } );
while( my $resp = $request->recv ) {
my $content = $resp->content;
sub biblio_id_to_copy {
my( $self, $client, $ids ) = @_;
$logger->info("Fetching copies @$ids");
- return $U->storagereq(
- "open-ils.storage.direct.asset.copy.batch.retrieve.atomic", @$ids );
+ return $U->cstorereq(
+ "open-ils.cstore.direct.asset.copy.search.atomic", { id => $ids } );
}
sub fleshed_copy_retrieve_batch {
my( $self, $client, $ids ) = @_;
$logger->info("Fetching fleshed copies @$ids");
- return $U->storagereq(
- "open-ils.storage.fleshed.asset.copy.batch.retrieve.atomic", @$ids );
+ return $U->cstorereq(
+ "open-ils.cstore.direct.asset.copy.search.atomic",
+ { id => $ids },
+ { flesh => 1,
+ flesh_fields => { acp => [ qw/ circ_lib location status stat_cat_entries / ] }
+ });
}
sub biblio_copy_to_mods {
my( $self, $client, $copy ) = @_;
- my $volume = $U->storagereq(
- "open-ils.storage.direct.asset.call_number.retrieve",
+ my $volume = $U->cstorereq(
+ "open-ils.cstore.direct.asset.call_number.retrieve",
$copy->call_number() );
my $mods = _records_to_mods($volume->record());
my $record = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.biblio.record_entry.retrieve",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.biblio.record_entry.retrieve",
$recordid );
my $xmldoc = $parser->parse_string($record->marc);
my( $self, $client ) = @_;
if(!$shelving_locations) {
$shelving_locations = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.asset.copy_location.retrieve.all.atomic");
+ "open-ils.cstore",
+ "open-ils.cstore.direct.asset.copy_location.search.atomic",
+ { id => { "!=" => undef } }
+ );
}
return $shelving_locations;
}
sub fetch_copy_by_cn {
my( $self, $conn, $cnid ) = @_;
- return $U->storagereq(
- 'open-ils.storage.id_list.asset.copy.search_where.atomic',
+ return $U->cstorereq(
+ 'open-ils.cstore.search.asset.copy.id_list.atomic',
{ call_number => $cnid, deleted => 'f' } );
}
sub fetch_cn_by_info {
my( $self, $conn, $label, $record, $org ) = @_;
- return $U->storagereq(
- 'open-ils.storage.direct.asset.call_number.search_where',
+ return $U->cstorereq(
+ 'open-ils.cstore.direct.asset.call_number.search',
{ label => $label, record => $record, owning_lib => $org, deleted => 'f' });
}