$logger->debug("User " . $staff->id . " fetching user $uid\n");
my $s = $apputils->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.actor.user_setting.search.usr.atomic',$uid );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.actor.user_setting.search.atomic', { usr => $uid } );
return { map { ( $_->name => JSON->JSON2perl($_->value) ) } @$s };
}
$logger->info("Fetching org unit settings for org $ouid");
my $s = $apputils->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.actor.org_unit_setting.search.org_unit.atomic', $ouid);
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.actor.org_unit_setting.search.atomic', {org_unit => $ouid});
return { map { ( $_->name => JSON->JSON2perl($_->value) ) } @$s };
}
$logger->debug("Retrieved setting $id in org unit setting delete");
- my $s = $U->storagereq(
- 'open-ils.storage.direct.actor.org_unit_setting.delete', $id );
+ my $s = $U->cstorereq(
+ 'open-ils.cstore.direct.actor.org_unit_setting.delete', $id );
$logger->activity("User ".$reqr->id." deleted org unit setting $id") if $s;
return $s;
sub search_username {
my($self, $client, $username) = @_;
my $users = OpenILS::Application::AppUtils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.user.search.usrname.atomic",
- $username );
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.user.search.atomic",
+ { usrname => $username }
+ );
return $users;
}
my ($user_obj, $evt) = $apputils->checkses($user_session);
return $evt if $evt;
-
- my $session = OpenSRF::AppSession->create("open-ils.storage");
-
- # find the card with the given barcode
- my $creq = $session->request(
- "open-ils.storage.direct.actor.card.search.barcode.atomic",
- $barcode );
- my $card = $creq->gather(1);
+ my $card = OpenILS::Application::AppUtils->simple_scalar_request(
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.card.search.atomic",
+ { barcode => $barcode },
+ { flesh => 1,
+ flesh_fields => { ac => [ 'usr' ] }
+ }
+ );
if(!$card || !$card->[0]) {
$session->disconnect();
$evt = $U->check_perms($user_obj->id, $user->home_ou, 'VIEW_USER');
return $evt if $evt;
- $session->disconnect();
if(!$user) { return OpenILS::Event->new( 'ACTOR_USER_NOT_FOUND' ); }
return $user;
return $user_profiles =
$apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.profile.retrieve.all.atomic");
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.profile.search.atomic", { id => { "!=" => undef });
}
my( $self, $client, $field, $value ) = @_;
my $list = OpenILS::Application::AppUtils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.org_unit.search.$field.atomic",
- $value );
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.org_unit.search.atomic",
+ { $field => $value } );
return $list;
}
return $user_standings if $user_standings;
return $user_standings =
$apputils->simple_scalar_request(
- "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 } }
+ );
}
#grab the user with password
$user_obj = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.user.retrieve",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.user.retrieve",
$user_obj->id );
if($user_obj->passwd eq $password) {
}
return $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.money.open_user_summary.search.usr",
- $user_id );
+ "open-ils.cstore",
+ "open-ils.cstore.direct.money.open_user_summary.search",
+ { usr => $user_id } );
}
if($api =~ /have_charge/o) {
$trans = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.money.open_billable_transaction_summary.search_where.atomic",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.money.open_billable_transaction_summary.search.atomic",
{ usr => $user_id, total_owed => { ">" => 0 }, @xact });
} elsif($api =~ /have_balance/o) {
$trans = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.money.open_billable_transaction_summary.search_where.atomic",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.money.open_billable_transaction_summary.search.atomic",
{ usr => $user_id, balance_owed => { "<>" => 0 }, @xact });
} else {
$trans = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.money.open_billable_transaction_summary.search_where.atomic",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.money.open_billable_transaction_summary.search.atomic",
{ usr => $user_id, @xact });
}
}
my $circ = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.action.circulation.retrieve",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.action.circulation.retrieve",
$t->id );
next unless $circ;
my( $self, $client, $login_session, $bill_id ) = @_;
my $trans = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.money.billable_transaction_summary.retrieve",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.money.billable_transaction_summary.retrieve",
$bill_id
);
}
my $circ = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.action.circulation.retrieve",
+ "open-ils.cstore",
+ "open-ils..direct.action.circulation.retrieve",
$trans->id );
return {transaction => $trans} unless $circ;
} otherwise {
if ($title->id == -1) {
my $copy = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.asset.copy.retrieve",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.asset.copy.retrieve",
$circ->target_copy );
$mods = new Fieldmapper::metabib::virtual_record;
my $holds = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.action.hold_request.search_where.atomic",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.action.hold_request.search.atomic",
{ usr => $userid,
fulfillment_time => {"=" => undef } }
);
next unless $h->capture_time;
my $copy = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.asset.copy.retrieve",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.asset.copy.retrieve",
$h->current_copy
);
return $evt if $evt;
my $circs = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.action.circulation.search_where.atomic",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.action.circulation.search.atomic",
{ usr => $userid, stop_fines => undef }
#{ usr => $userid, checkin_time => {"=" => undef } }
);
$logger->debug("searching for transaction history: @xact : @balance, @charge");
my $trans = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.money.billable_transaction_summary.search_where.atomic",
- { usr => $user_id, @xact, @charge, @balance }, { order_by => 'xact_start DESC' });
+ "open-ils.cstore",
+ "open-ils.cstore.direct.money.billable_transaction_summary.search.atomic",
+ { usr => $user_id, @xact, @charge, @balance }, { order_by => { mbts => 'xact_start DESC' } });
return [ map { $_->id } @$trans ];
}
sub retrieve_perms {
my( $self, $client ) = @_;
return $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.permission.perm_list.retrieve.all.atomic");
+ "open-ils.cstore",
+ "open-ils.cstore.direct.permission.perm_list.search.atomic",
+ { id => { '!=' => undef } }
+ );
}
__PACKAGE__->register_method(
sub retrieve_org_address {
my( $self, $client, $id ) = @_;
return $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.org_address.retrieve",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.org_address.retrieve",
$id
);
}
return $evt if $evt;
return $apputils->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.permission.usr_grp_map.search.usr.atomic', $userid );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.permission.usr_grp_map.search.atomic', { usr => $userid } );
}
sub initialize { return 1; }
-my $svc = 'open-ils.storage';
-my $meth = 'open-ils.storage.direct.container';
+my $svc = 'open-ils.cstore';
+my $meth = 'open-ils.cstore.direct.container';
my %types;
$types{'biblio'} = "$meth.biblio_record_entry_bucket";
$types{'callnumber'} = "$meth.call_number_bucket";
$logger->activity("User " . $staff->id . " updating container ". $container->id);
my $meth = $types{$class}.".update";
- return $U->storagereq($meth, $container);
+ return $U->cstorereq($meth, $container);
}
if(!$orglist) {
warn "Retrieving Org Tree\n";
$orglist = $self->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.org_unit.retrieve.all.atomic" );
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.org_unit.search.atomic",
+ { id => { '!=' => undef } }
+ );
}
if( ! $org_typelist ) {
warn "Retrieving org types\n";
$org_typelist = $self->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.org_unit_type.retrieve.all.atomic" );
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.org_unit_type.search.atomic",
+ { id => { '!=' => undef } }
+ );
$self->build_org_type($org_typelist);
}
if(!$orglist) {
warn "Retrieving Org Tree\n";
$orglist = $self->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.actor.org_unit.retrieve.all.atomic" );
+ "open-ils.cstore",
+ "open-ils.cstore.direct.actor.org_unit.search.atomic",
+ { id => { '!=' => undef } }
+ );
}
$slimtree = $self->build_org_tree($orglist);
my( $self, $cd ) = @_;
my $evt;
- $logger->debug("Fetching closed_date $cd from storage");
+ $logger->debug("Fetching closed_date $cd from cstore");
my $cd_obj = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.actor.org_unit.closed_date.retrieve', $cd );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.actor.org_unit.closed_date.retrieve', $cd );
if(!$cd_obj) {
$logger->info("closed_date $cd not found in the db");
my( $self, $userid ) = @_;
my( $user, $evt );
- $logger->debug("Fetching user $userid from storage");
+ $logger->debug("Fetching user $userid from cstore");
$user = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.actor.user.retrieve', $userid );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.actor.user.retrieve', $userid );
if(!$user) {
$logger->info("User $userid not found in the db");
my( $self, $copyid ) = @_;
my( $copy, $evt );
- $logger->debug("Fetching copy $copyid from storage");
+ $logger->debug("Fetching copy $copyid from cstore");
$copy = $self->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.asset.copy.retrieve', $copyid );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.asset.copy.retrieve', $copyid );
if(!$copy) { $evt = OpenILS::Event->new('ASSET_COPY_NOT_FOUND'); }
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, stop_fines_time => undef } );
$evt = OpenILS::Event->new('ACTION_CIRCULATION_NOT_FOUND') unless $circ;
return ($circ, $evt);
sub complete_authenticate {
my( $self, $client, $username, $passwdhash, $type ) = @_;
- my $name = "open-ils.storage.direct.actor.user.search.usrname.atomic";
+ my $name = "open-ils.cstore.direct.actor.user.search.atomic";
warn "Completing Authentication\n";
- warn "Retrieving user from storage..\n";
+ warn "Retrieving user from cstore..\n";
my $user_list = OpenILS::Application::AppUtils->simple_scalar_request(
- "open-ils.storage", $name, $username );
+ "open-ils.cstore", $name, { usrname => $username } );
unless(ref($user_list)) {
return { ilsevent => 1000 };
}
- warn "We have the user from storage with usrname $username\n";
+ warn "We have the user from cstore with usrname $username\n";
my $user = $user_list->[0];
sub biblio_record_marc_cn {
my( $self, $client, $id ) = @_;
- my $session = OpenSRF::AppSession->create("open-ils.storage");
+ my $session = OpenSRF::AppSession->create("open-ils.cstore");
my $marc = $session
- ->request("open-ils.storage.direct.biblio.record_entry.retrieve", $id )
+ ->request("open-ils.cstore.direct.biblio.record_entry.retrieve", $id )
->gather(1)
->marc;
my @users = @_;
my @ids;
- my $session = OpenSRF::AppSession->create( "open-ils.storage" );
+ my $session = OpenSRF::AppSession->create( "open-ils.cstore" );
my $request = $session->request(
- "open-ils.storage.direct.actor.user.search.usrname.atomic", @users );
+ "open-ils.cstore.direct.actor.user.search.atomic", { usrname => \@users } );
$request->wait_complete;
my $response = $request->recv();
if(!$request->complete) {
- throw OpenSRF::EX::ERROR ("no response from storage on user retrieve");
+ throw OpenSRF::EX::ERROR ("no response from cstore on user retrieve");
}
if(UNIVERSAL::isa( $response, "Error")){
my( $self, $client, $record_id ) = @_;
my $vols = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.asset.call_number.search_where.atomic",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.asset.call_number.search.atomic",
{ record => $record_id, deleted => 'f' });
my $orgs = { map {$_->owning_lib => 1 } @$vols };
$search_hash->{deleted} = 'f';
- my $session = OpenSRF::AppSession->create( "open-ils.storage" );
+ my $session = OpenSRF::AppSession->create( "open-ils.cstore" );
my $request = $session->request(
- "open-ils.storage.direct.asset.call_number.search.atomic", $search_hash );
+ "open-ils.cstore.direct.asset.call_number.search.atomic", $search_hash );
#"open-ils.storage.direct.asset.call_number.search.atomic", $search_hash );
my $vols = $request->gather(1);
warn "Grabbing copies for volume: " . $volume->id . "\n";
my $creq = $session->request(
- "open-ils.storage.direct.asset.copy.search_where.atomic",
+ "open-ils.cstore.direct.asset.copy.search.atomic",
{ call_number => $volume->id , deleted => 'f' });
#"open-ils.storage.direct.asset.copy.search.call_number.atomic", $volume->id );
#return $evt if $evt;
my $holds = $apputils->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.action.hold_request.search.atomic",
- "id" => $hold_id , fulfillment_time => undef, { order_by => "request_time" });
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.action.hold_request.search.atomic",
+ { id => $hold_id , fulfillment_time => undef, { order_by => { ahr => "request_time" } });
for my $hold ( @$holds ) {
$hold->transit(
$apputils->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.action.hold_transit_copy.search.hold.atomic" => $hold->id,
- { order_by => 'id desc', limit => 1 }
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.action.hold_transit_copy.search.atomic",
+ { hold => $hold->id },
+ { order_by => { ahtc => 'id desc' }, limit => 1 }
)->[0]
);
}
return $evt if $evt;
my $holds = $apputils->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.action.hold_request.search.atomic",
- "usr" => $user_id , fulfillment_time => undef, { order_by => "request_time" });
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.action.hold_request.search.atomic",
+ { usr => $user_id , fulfillment_time => undef }, { order_by => { ahr => "request_time" } });
for my $hold ( @$holds ) {
$hold->transit(
$apputils->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.action.hold_transit_copy.search.hold.atomic" => $hold->id,
- { order_by => 'id desc', limit => 1 }
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.action.hold_transit_copy.search.atomic",
+ { hold => $hold->id },
+ { order_by => { ahtc => 'id desc' }, limit => 1 }
)->[0]
);
}
#return $evt if $evt;
my $holds = $apputils->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.action.hold_request.search.atomic",
- "pickup_lib" => $ou_id , fulfillment_time => undef, { order_by => "request_time" });
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.action.hold_request.search.atomic",
+ { pickup_lib => $ou_id , fulfillment_time => undef }, { order_by => { ahr => "request_time" } });
for my $hold ( @$holds ) {
$hold->transit(
$apputils->simplereq(
- 'open-ils.storage',
- "open-ils.storage.direct.action.hold_transit_copy.search.hold.atomic" => $hold->id,
- { order_by => 'id desc', limit => 1 }
+ 'open-ils.cstore',
+ "open-ils.cstore.direct.action.hold_transit_copy.search.atomic",
+ { hold => $hold->id },
+ { order_by => { ahtc => 'id desc' }, limit => 1 }
)->[0]
);
}
my $class = shift;
my $copyid = shift;
my $hold = $apputils->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.action.hold_request.search.atomic',
- current_copy => $copyid , fulfillment_time => undef );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.action.hold_request.search.atomic',
+ { current_copy => $copyid , fulfillment_time => undef });
return $hold->[0] if ref($hold);
return undef;
}
my $class = shift;
my $copyid = shift;
return $apputils->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.action.hold_request.search.atomic',
- current_copy => $copyid , fulfillment_time => undef );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.action.hold_request.search.atomic',
+ { current_copy => $copyid , fulfillment_time => undef });
}
# to make sure the requestor has access
return $apputils->simplereq(
- 'open-ils.storage',
- 'open-ils.storage.direct.money.payment.search.xact.atomic', $transid );
+ 'open-ils.cstore',
+ 'open-ils.cstore.direct.money.payment.search.atomic', { xact => $transid } );
}
return $evt if $evt;
}
- return $apputils->simplereq( 'open-ils.storage',
- 'open-ils.storage.direct.money.billing.search.xact.atomic', $transid )
+ return $apputils->simplereq( 'open-ils.cstore',
+ 'open-ils.cstore.direct.money.billing.search.atomic', { xact => $transid } )
}
}
my $res = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.direct.action.survey_response.search.atomic",
+ "open-ils.cstore",
+ "open-ils.cstore.direct.action.survey_response.search.atomic",
{ usr => $user_id, survey => $survey_id } );
warn "Surveys: " . Dumper($res);