[open-ils-commits] r16751 - in trunk/Open-ILS/src/perlmods/OpenILS: Application WWW (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jun 18 10:54:26 EDT 2010


Author: miker
Date: 2010-06-18 10:54:24 -0400 (Fri, 18 Jun 2010)
New Revision: 16751

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
pushing unapi depth support back into trunk

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2010-06-18 14:41:23 UTC (rev 16750)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2010-06-18 14:54:24 UTC (rev 16751)
@@ -1128,6 +1128,7 @@
 	my $client = shift;
 	my $bib = shift;
 	my $ou = shift;
+	my $depth = shift;
 	my $flesh = shift;
 	my $paging = shift;
 
@@ -1142,16 +1143,19 @@
 		$o_search = { parent_ou => undef };
 	}
 
-	my $orgs = $_storage->request(
-		"open-ils.cstore.direct.actor.org_unit.search",
-		$o_search,
-		{ flesh		=> 100,
-		  flesh_fields	=> { aou	=> [qw/children/] }
-		}
-	)->gather(1);
+    my $one_org = $_storage->request(
+        "open-ils.cstore.direct.actor.org_unit.search",
+        $o_search
+    )->gather(1);
 
-	my @ou_ids = tree_walker($orgs, 'children', sub {shift->id}) if $orgs;
+    my $orgs = $_storage->request(
+        'open-ils.cstore.json_query.atomic',
+        { from => [ 'actor.org_unit_descendants', defined($depth) ? ( $one_org->id, $depth ) :  ( $one_org->id ) ] }
+    )->gather(1);
 
+
+	my @ou_ids = map { $_->{id} } @$orgs;
+
 	$logger->info("Searching for holdings at orgs [".join(',', at ou_ids)."], based on $ou");
 
     my %subselect = ( '-or' => [

Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-06-18 14:41:23 UTC (rev 16750)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-06-18 14:54:24 UTC (rev 16751)
@@ -163,7 +163,7 @@
                 	my $site = shift;
 
 			$log->info("Creating record feed with params [$real_format, $record_list, $unapi, $site]");
-                	my $feed = create_record_feed( 'record', $real_format, $record_list, $unapi, $site, $real_format =~ /(-full|-uris)$/o ? 1 : 0 );
+                	my $feed = create_record_feed( 'record', $real_format, $record_list, $unapi, $site, undef, $real_format =~ /(-full|-uris)$/o ? 1 : 0 );
                 	$feed->root( "$base/../" );
                 	$feed->lib( $site );
                 	$feed->link( next => $next => $feed->type );
@@ -456,7 +456,7 @@
 	if ($uri =~ m{^tag:[^:]+:([^\/]+)/(\d+)(?:\[([0-9,]+)\])?(?:/(.+))?}o) {
 		$id = $2;
 		$paging = $3;
-		$lib = uc($4);
+		($lib,$depth) = split('/', $4);
 		$type = 'record';
 		$type = 'metarecord' if ($1 =~ /^metabib/o);
 		$type = 'isbn' if ($1 =~ /^isbn/o);
@@ -549,6 +549,7 @@
 			$format => [ $id ],
 			$base,
 			$lib,
+			$depth,
 			$flesh_feed,
             $paging
 		);
@@ -915,6 +916,7 @@
 		[ map { $_->target_biblio_record_entry } @{ $bucket->items } ],
 		$unapi,
 		$org_unit->[0]->shortname,
+		undef,
 		$flesh_feed
 	);
 	$feed->root($root);
@@ -992,7 +994,7 @@
 	#	return 302;
 	#}
 
-	my $feed = create_record_feed( 'record', $type, $list, $unapi, $org_unit->[0]->shortname, $flesh_feed);
+	my $feed = create_record_feed( 'record', $type, $list, $unapi, $org_unit->[0]->shortname, undef, $flesh_feed);
 	$feed->root($root);
 
 	if ($date) {
@@ -1221,6 +1223,7 @@
 		[ map { $_->[0] } @{$recs->{ids}} ],
 		$unapi,
 		$org,
+		undef,
 		$flesh_feed
 	);
 
@@ -1327,6 +1330,7 @@
 	my $unapi = shift;
 
 	my $lib = uc(shift()) || '-';
+	my $depth = shift;
 	my $flesh = shift;
 	$flesh = 1 if (!defined($flesh));
 
@@ -1375,7 +1379,7 @@
 
 		$xml = '';
 		if ($lib && ($type eq 'marcxml' || $type eq 'atom') &&  $flesh > 0) {
-			my $r = $supercat->request( "open-ils.supercat.$search.holdings_xml.retrieve", $rec, $lib, $flesh_feed, $paging );
+			my $r = $supercat->request( "open-ils.supercat.$search.holdings_xml.retrieve", $rec, $lib, $depth, $flesh_feed, $paging );
 			while ( !$r->complete ) {
 				$xml .= join('', map {$_->content} $r->recv);
 			}



More information about the open-ils-commits mailing list