moving to cstore for all basic search/retrevial
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Jul 2006 17:48:20 +0000 (17:48 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Jul 2006 17:48:20 +0000 (17:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4969 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/StatCat.pm
Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm

index f19fb9d..3ad2a40 100644 (file)
@@ -159,8 +159,8 @@ sub ou_setting_delete {
        $evt = $U->check_perms($reqr->id, $orgid, 'UPDATE_ORG_SETTING');
        return $evt if $evt;
 
-       my $id = $U->storagereq(
-               'open-ils.storage.id_list.actor.org_unit_setting.search_where', 
+       my $id = $U->cstorereq(
+               'open-ils.cstore.direct.actor.org_unit_setting.id_list', 
                { name => $setting, org_unit => $orgid } );
 
        $logger->debug("Retrieved setting $id in org unit setting delete");
@@ -2062,8 +2062,8 @@ sub _register_workstation {
        $evt = $U->check_perms($requestor->id, $owner, 'REGISTER_WORKSTATION');
        return $evt if $evt;
 
-       my $ws = $U->storagereq(
-               'open-ils.storage.direct.actor.workstation.search.name', $name );
+       my $ws = $U->cstorereq(
+               'open-ils.cstore.direct.actor.workstation.search', { name => $name } );
        return OpenILS::Event->new('WORKSTATION_NAME_EXISTS') if $ws;
 
        $ws = Fieldmapper::actor::workstation->new;
@@ -2132,16 +2132,16 @@ sub fetch_patron_note {
                        $evt = $U->check_perms($reqr->id, $patron->home_ou, 'VIEW_USER');
                        return $evt if $evt;
                }
-               return $U->storagereq(
-                       'open-ils.storage.direct.actor.usr_note.search_where.atomic', 
+               return $U->cstorereq(
+                       'open-ils.cstore.direct.actor.usr_note.search.atomic', 
                        { usr => $patronid, pub => 't' } );
        }
 
        $evt = $U->check_perms($reqr->id, $patron->home_ou, 'VIEW_USER');
        return $evt if $evt;
 
-       return $U->storagereq(
-               'open-ils.storage.direct.actor.usr_note.search.usr.atomic', $patronid );
+       return $U->cstorereq(
+               'open-ils.cstore.direct.actor.usr_note.search.atomic', { usr => $patronid } );
 }
 
 __PACKAGE__->register_method (
@@ -2181,8 +2181,8 @@ __PACKAGE__->register_method (
 sub delete_user_note {
        my( $self, $conn, $authtoken, $noteid ) = @_;
 
-       my $note = $U->storagereq(
-               'open-ils.storage.direct.actor.usr_note.retrieve', $noteid);
+       my $note = $U->cstorereq(
+               'open-ils.cstore.direct.actor.usr_note.retrieve', $noteid);
        return OpenILS::Event->new('ACTOR_USER_NOTE_NOT_FOUND') unless $note;
 
        my( $reqr, $patron, $evt ) = 
index 7ccd503..920acfb 100644 (file)
@@ -414,11 +414,11 @@ sub fetch_circulation {
        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 );
@@ -431,14 +431,23 @@ sub fetch_record_by_copy {
        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);
@@ -458,11 +467,11 @@ sub fetch_hold {
        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;
 
@@ -474,11 +483,11 @@ sub fetch_hold_transit_by_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;
 
@@ -491,8 +500,8 @@ sub fetch_open_hold_by_copy {
        $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 }, 
@@ -507,8 +516,8 @@ sub fetch_hold_transit {
        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);
 }
@@ -517,10 +526,10 @@ sub fetch_copy_by_barcode {
        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;
@@ -532,11 +541,11 @@ sub fetch_open_billable_transaction {
        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;
@@ -565,8 +574,8 @@ sub fetch_container {
 
        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;
@@ -584,8 +593,8 @@ sub fetch_container_item {
        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';
@@ -605,8 +614,8 @@ sub fetch_patron_standings {
        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 } });
 }
 
 
@@ -639,15 +648,15 @@ sub fetch_copy_statuses {
        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);
 }
@@ -655,15 +664,15 @@ sub fetch_copy_location {
 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);
@@ -675,8 +684,8 @@ sub fetch_callnumber {
        $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 );
@@ -691,8 +700,8 @@ sub fetch_org_unit {
        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;
 
@@ -704,8 +713,8 @@ sub fetch_stat_cat {
        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';
@@ -719,8 +728,8 @@ sub fetch_stat_cat_entry {
        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';
@@ -745,8 +754,8 @@ sub fetch_non_cat_type_by_name_and_org {
        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') );
@@ -757,8 +766,8 @@ sub fetch_non_cat_type {
        $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);
 }
@@ -773,8 +782,8 @@ sub fetch_circ_duration_by_name {
        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);
@@ -784,8 +793,8 @@ sub fetch_recurring_fine_by_name {
        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);
@@ -795,8 +804,8 @@ sub fetch_max_fine_by_name {
        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);
@@ -808,6 +817,12 @@ sub storagereq {
                '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 
@@ -841,8 +856,8 @@ sub fetch_all_open_circulation {
        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);
@@ -870,8 +885,8 @@ sub copy_status_to_name {
 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);
@@ -918,8 +933,8 @@ sub fetch_billable_xact {
        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);
 }
@@ -929,8 +944,8 @@ sub fetch_fleshed_copy {
        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);
 }
@@ -953,8 +968,8 @@ sub fetch_copy_note {
        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);
 }
@@ -962,8 +977,8 @@ sub fetch_copy_note {
 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);
 }
@@ -971,18 +986,18 @@ sub fetch_call_numbers_by_title {
 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);
        
@@ -1004,8 +1019,8 @@ sub update_patron_penalties {
 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);
 }
index 77f4674..7a4b1ab 100644 (file)
@@ -77,8 +77,8 @@ sub checkouts_by_user {
        return $evt if $evt;
 
        my $circs = $apputils->simplereq(
-               'open-ils.storage',
-               "open-ils.storage.direct.action.open_circulation.search.atomic", 
+               'open-ils.cstore',
+               "open-ils.cstore.direct.action.open_circulation.search.atomic", 
                { usr => $target->id, checkin_time => undef } );
 #              { usr => $target->id } );
 
@@ -126,8 +126,8 @@ sub checkouts_by_user_slim {
 
        # XXX Make the call correct..
        return $apputils->simplereq(
-               'open-ils.storage',
-               "open-ils.storage.direct.action.open_circulation.search.atomic", 
+               'open-ils.cstore',
+               "open-ils.cstore.direct.action.open_circulation.search.atomic", 
                { usr => $target->id, checkin_time => undef } );
 #              { usr => $target->id } );
 }
@@ -488,14 +488,14 @@ sub view_circs {
 
        return [] unless $count;
 
-       my $circs = $U->storagereq(
-               'open-ils.storage.direct.action.circulation.search_where.atomic',
+       my $circs = $U->cstorereq(
+               'open-ils.cstore.direct.action.circulation.search.atomic',
                        { 
                                target_copy => $copyid, 
                        }, 
                        { 
                                limit => $count, 
-                               order_by => "xact_start DESC" 
+                               order_by => { ac => "xact_start DESC" }
                        } 
        );
 
@@ -552,38 +552,38 @@ sub fetch_notes {
 
        if( $self->api_name =~ /copy/ ) {
                if( $$args{pub} ) {
-                       return $U->storagereq(
-                               'open-ils.storage.direct.asset.copy_note.search_where.atomic',
+                       return $U->cstorereq(
+                               'open-ils.cstore.direct.asset.copy_note.search.atomic',
                                { owning_copy => $id, pub => 't' } );
                } else {
                        ( $r, $evt ) = $U->checksesperm($authtoken, 'VIEW_COPY_NOTES');
                        return $evt if $evt;
-                       return $U->storagereq(
-                               'open-ils.storage.direct.asset.copy_note.search.owning_copy.atomic', $id );
+                       return $U->cstorereq(
+                               'open-ils.cstore.direct.asset.copy_note.search.atomic', {owning_copy => $id} );
                }
 
        } elsif( $self->api_name =~ /call_number/ ) {
                if( $$args{pub} ) {
-                       return $U->storagereq(
-                               'open-ils.storage.direct.asset.call_number_note.search_where.atomic',
+                       return $U->cstorereq(
+                               'open-ils.cstore.direct.asset.call_number_note.search.atomic',
                                { call_number => $id, pub => 't' } );
                } else {
                        ( $r, $evt ) = $U->checksesperm($authtoken, 'VIEW_VOLUME_NOTES');
                        return $evt if $evt;
-                       return $U->storagereq(
-                               'open-ils.storage.direct.asset.call_number_note.search.call_number.atomic', $id );
+                       return $U->cstorereq(
+                               'open-ils.cstore.direct.asset.call_number_note.search.atomic', { call_number => $id } );
                }
 
        } elsif( $self->api_name =~ /title/ ) {
                if( $$args{pub} ) {
-                       return $U->storagereq(
-                               'open-ils.storage.direct.bilbio.record_note.search_where.atomic',
+                       return $U->cstorereq(
+                               'open-ils.cstore.direct.bilbio.record_note.search.atomic',
                                { record => $id, pub => 't' } );
                } else {
                        ( $r, $evt ) = $U->checksesperm($authtoken, 'VIEW_TITLE_NOTES');
                        return $evt if $evt;
-                       return $U->storagereq(
-                               'open-ils.storage.direct.biblio.record_note.search.record.atomic', $id );
+                       return $U->cstorereq(
+                               'open-ils.cstore.direct.biblio.record_note.search.atomic', { record => $id } );
                }
        }
 
index dc33c58..75623fa 100644 (file)
@@ -207,8 +207,8 @@ sub _find_copy_by_attr {
 #              $ctx->{copy} = $copy;
 #
 #              ($ctx->{volume}) = $U->fetch_callnumber($copy->call_number);
-#              $ctx->{recordDescriptor} = $U->storagereq(
-#                      'open-ils.storage.direct.metabib.record_descriptor.search_where', 
+#              $ctx->{recordDescriptor} = $U->cstorereq(
+#                      'open-ils.cstore.direct.metabib.record_descriptor.search', 
 #                      { record => $ctx->{title}->id });
 #
 #
@@ -1455,8 +1455,8 @@ sub _handle_claims_returned {
 
 sub _fetch_open_claims_returned {
        my $copyid = shift;
-       my $trans = $U->storagereq(
-               'open-ils.storage.direct.action.circulation.search_where',
+       my $trans = $U->cstorereq(
+               'open-ils.cstore.direct.action.circulation.search',
                {       
                        target_copy             => $copyid, 
                        stop_fines              => 'CLAIMSRETURNED',
index b0756c9..7ab64fc 100644 (file)
@@ -704,8 +704,8 @@ sub fetch_hold_notify {
        return $evt if $evt;
 
        $logger->info("User ".$requestor->id." fetching hold notifications for hold $holdid");
-       return $U->storagereq(
-               'open-ils.storage.direct.action.hold_notification.search.hold.atomic', $holdid );
+       return $U->cstorereq(
+               'open-ils.cstore.direct.action.hold_notification.search.atomic', {hold => $holdid} );
 }
 
 
index 0064ebc..601f6b2 100644 (file)
@@ -434,8 +434,8 @@ __PACKAGE__->register_method (
 sub fetch_mbts {
        my($s, $c, $authtoken, $id) = @_;
 
-       my $sum = $U->storagereq(
-               'open-ils.storage.direct.money.billable_transaction_summary.retrieve', $id );
+       my $sum = $U->cstorereq(
+               'open-ils.cstore.direct.money.billable_transaction_summary.retrieve', $id );
        return OpenILS::Event->new('MONEY_BILLABLE_TRANSACTION_SUMMARY_NOT_FOUND', id => $id) unless $sum;
 
        my ($reqr, $evt) = $U->checkses($authtoken);
index c5ca1ca..f80b7ee 100644 (file)
@@ -597,8 +597,8 @@ sub fetch_stats_by_copy {
        my @entries;
 
        if( $$args{public} ) {
-               my $maps = $U->storagereq(
-                       'open-ils.storage.direct.asset.stat_cat_entry_copy_map.search.owning_copy.atomic', $$args{copyid});
+               my $maps = $U->cstorereq(
+                       'open-ils.cstore.direct.asset.stat_cat_entry_copy_map.search.atomic', { owning_copy => $$args{copyid} });
 
 
                warn "here\n";
@@ -607,13 +607,13 @@ sub fetch_stats_by_copy {
                        warn "map ".$map->id."\n";
                        warn "map ".$map->stat_cat_entry."\n";
 
-                       my $entry = $U->storagereq(
-                               'open-ils.storage.direct.asset.stat_cat_entry.retrieve', $map->stat_cat_entry);
+                       my $entry = $U->cstorereq(
+                               'open-ils.cstore.direct.asset.stat_cat_entry.retrieve', $map->stat_cat_entry);
 
                        warn "Found entry ".$entry->id."\n";
 
-                       my $cat = $U->storagereq(
-                               'open-ils.storage.direct.asset.stat_cat.retrieve', $entry->stat_cat );
+                       my $cat = $U->cstorereq(
+                               'open-ils.cstore.direct.asset.stat_cat.retrieve', $entry->stat_cat );
                        $entry->stat_cat( $cat );
                        push( @entries, $entry );
                }
index 8647441..8b0fde7 100644 (file)
@@ -54,9 +54,9 @@ sub _records_to_mods {
        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;
@@ -201,8 +201,8 @@ __PACKAGE__->register_method(
 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 } );
 }
 
 
@@ -233,8 +233,12 @@ __PACKAGE__->register_method(
 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 / ] }
+               });
 }
 
 
@@ -277,8 +281,8 @@ __PACKAGE__->register_method(
 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());
@@ -665,8 +669,8 @@ sub biblio_record_to_marc_html {
 
 
        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);
@@ -687,8 +691,10 @@ sub retrieve_all_copy_locations {
        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;
 }
@@ -1005,8 +1011,8 @@ __PACKAGE__->register_method (
 
 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' } );
 }
 
@@ -1024,8 +1030,8 @@ __PACKAGE__->register_method (
 
 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' });
 }