little more. lots more tomorrow
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 22 Feb 2012 23:25:03 +0000 (18:25 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 7 Mar 2012 21:57:09 +0000 (16:57 -0500)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm

index 5260a76..c198110 100644 (file)
@@ -4352,7 +4352,18 @@ SELECT  usr,
                </links>
                <!-- Not available via PCRUD at this time -->
        </class>
-
+       <class id="sasum" controller="open-ils.cstore" oils_obj:fieldmapper="serial::any_summary" oils_persist:tablename="serial.any_summary" reporter:label="All Issues' Summaries" oils_persist:readonly="true">
+               <fields>
+                       <field name="summary_type" reporter:label="Summary Type" report:datatype="text" />
+                       <field name="id" reporter:label="Native ID" report:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
+                       <field name="distribution" reporter:label="Distribution" report:datatype="link" />
+                       <field name="generated_coverage" reporter:label="Generated Coverage" report:datatype="text" />
+                       <field name="show_generated" reporter:label="Show Generated?" report:datatype="bool" />
+               </fields>
+               <links>
+                       <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
+               </links>
+       </class>
        <class id="sbsum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::basic_summary" oils_persist:tablename="serial.basic_summary" reporter:label="Basic Issue Summary">
                <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
                        <field reporter:label="ID" name="id" reporter:datatype="id" />
index 7acc52d..8b99746 100644 (file)
@@ -662,6 +662,51 @@ q/A hash of optional arguments.  Valid keys and their meanings:
     }
 );
 
+# XXX give a less confusing name, as this addresses what
+# scoped_bib_holdings_summary() does, only more correctly.  Maybe use api_level
+# to offer the old and the new functionality side by side, if not replacing
+# the old function altogether
+
+sub scoped_holdings_tree_for_bib {
+    my ($self, $client, $bib, $opts) = @_;
+
+    # XXX trying to implement the first method defined in my notes (the pencil page)
+    
+    # TODO $opts->{org_unit} ||= top_of_org_tree;
+    $opts->{depth} ||= 0;
+    $opts->{limit} ||= 10;
+    $opts->{offset} ||= 0;
+
+    my $e = new_editor;
+
+    my $rows = $e->json_query({
+        select => {
+            sasum => [qw/summary_type id generated_coverage/],
+            sdist => [qw/holding_lib/],
+        },
+        from => {
+            sasum => {
+                sdist => {
+                    join => { ssub => { } }
+                }
+            }
+        },
+        where => {
+            "+sdist" => {
+                holding_lib => $U->get_org_descendants(
+                    int($opts->{org_unit}), int($opts->{depth})
+                )
+            },
+            "+ssub" => {record_entry => int($bib)}
+        },
+        limit => int($opts->{limit}),
+        offset => int($opts->{offset})
+    }) or return $e->die_event;
+
+
+    $e->disconnect;
+
+}
 
 ##########################################################################
 # unit methods