Buckets and their items aren't designed to be PCRUD accessible,
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 23 Aug 2012 19:46:44 +0000 (15:46 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 21 Sep 2012 15:06:58 +0000 (11:06 -0400)
so we need a handy view to link URL Verify Sessions to the bib
contained.  We can leverage this in flattener queries.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/examples/fm_IDL.xml

index 1c2b934..2f6c570 100644 (file)
@@ -9365,6 +9365,38 @@ SELECT  usr,
 
     </class>
 
+       <class id="uvsbrem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::session_biblio_record_entry_map" oils_persist:readonly="true" reporter:label="URL Verify Session Biblio Record Entry Map">
+               <oils_persist:source_definition>
+            SELECT
+                cbrebi.id AS id,  -- so we can have a pkey in our view
+                uvs.id AS session,
+                uvs.owning_lib,
+                cbrebi.target_biblio_record_entry
+            FROM url_verify.session uvs
+            JOIN container.biblio_record_entry_bucket cbreb
+                ON (uvs.container = cbreb.id)
+            JOIN container.biblio_record_entry_bucket_item cbrebi
+                ON (cbrebi.bucket = cbreb.id)
+        </oils_persist:source_definition>
+        <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
+            <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
+            <field reporter:label="Session" name="session" reporter:datatype="link" />
+            <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
+            <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
+        </fields>
+               <links>
+                       <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
+                       <link field="session" reltype="has_a" key="id" map="" class="uvs" />
+                       <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
+        </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <retrieve permission="URL_VERIFY" context_field="owning_lib" />
+            </actions>
+        </permacrud>
+
+    </class>
+
     <class
         id="uvus"
         controller="open-ils.cstore open-ils.pcrud"