From e9c8c58374fdb0bdd801d901188ea9de230acaca Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Tue, 14 Dec 2021 10:57:58 -0500 Subject: [PATCH] Add Simple Reporter IDL definitions Add SR IDL classes, update reporter.*, add xsl2js transforms, and add sr namespace to fm_IDL.xsd. Overall IDL tidying to come. Sponsored-by: C/W MARS Sponsored-by: Missouri Evergreen Consortium Signed-off-by: Jason Boyer Signed-off-by: rfrasur Signed-off-by: Mike Rylander --- Open-ILS/examples/fm_IDL.xml | 1471 ++++++++++++++++++++++++++++++++- Open-ILS/examples/fm_IDL.xsd | 32 +- Open-ILS/examples/simple-reporter.xsd | 40 + Open-ILS/xsl/fm_IDL2js.xsl | 47 +- 4 files changed, 1560 insertions(+), 30 deletions(-) create mode 100644 Open-ILS/examples/simple-reporter.xsd diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index eb915c1419..215dcc2ada 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -71,7 +71,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA --> - + @@ -10755,7 +10755,7 @@ SELECT usr, - + @@ -10764,6 +10764,7 @@ SELECT usr, + @@ -10774,8 +10775,24 @@ SELECT usr, + + + + + + + + + + + + + + + + - + @@ -10784,6 +10801,7 @@ SELECT usr, + @@ -10794,8 +10812,24 @@ SELECT usr, + + + + + + + + + + + + + + + + - + @@ -10804,6 +10838,7 @@ SELECT usr, + @@ -10814,6 +10849,22 @@ SELECT usr, + + + + + + + + + + + + + + + + @@ -10833,14 +10884,22 @@ SELECT usr, - - - - + + + + + + + + + + + + - + @@ -10860,32 +10919,104 @@ SELECT usr, + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -13939,6 +14070,1294 @@ SELECT usr, + + + combcirc.due_date THEN true ELSE false END AS is_overdue, + + -- Copy info + acp.barcode AS copy_barcode, + acp.circ_modifier AS copy_circ_modifier_code, + ccm.name AS copy_circ_modifier_name, + acp.circ_lib AS copy_circ_lib_id, + acp.location AS location_id, + acpl.name AS location_name, + aoucp.shortname AS copy_circ_lib_shortname, + aoucp.name AS copy_circ_lib_name, + (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id, + aoucps.shortname AS copy_sys_shortname, + aoucps.name AS copy_sys_name, + combcirc.copy_owning_lib AS copy_owning_lib_id, + aoucpo.shortname AS copy_owning_lib_shortname, + aoucpo.name AS copy_owning_lib_name, + TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full, + acnp.label AS copy_call_number_prefix, + acn.label AS copy_call_number_label, + acns.label AS copy_call_number_suffix, + TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full, + acnp.label_sortkey AS copy_call_number_prefix_sortkey, + acn.label_sortkey AS copy_call_number_label_sortkey, + acns.label_sortkey AS copy_call_number_suffix_sortkey, + COALESCE(rmsr.title, acp.dummy_title) AS title, + COALESCE(rmsr.author, acp.dummy_author) AS author, + rmsr.publisher AS publisher, + public.approximate_date(rmsr.pubdate, '0') AS pubdate, + array_to_string(rmsr.isbn, ', ') AS isbn, + array_to_string(rmsr.issn, ', ') AS issn, + part.label AS part_label, + part.label_sortkey AS part_label_sortkey, + acn.record AS bib_id, + rmsr.tcn_value AS tcn_value + + FROM + action.all_circulation combcirc + + -- User + INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id) + LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id) + LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id) + + -- Circ + LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id) + LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id) + INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id) + LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id) + LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id) + LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id) + LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id) + LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id) + + -- Copy / call / title + INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id) + INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id) + INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id) + LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id) + LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id) + LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id) + LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code) + INNER JOIN asset.call_number acn ON (acp.call_number = acn.id) + INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id) + INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id) + LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id) + LEFT JOIN ( + SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy + FROM biblio.monograph_part bmp + INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id) + WHERE NOT bmp.deleted + ) part ON (part.record = acn.record AND part.target_copy = acp.id) + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + circ.due_date THEN circ.id ELSE NULL END) AS circs_overdue, + COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open + + FROM + actor.usr au + INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id) + INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id) + LEFT JOIN actor.card cardp ON (au.card = cardp.id) + LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active) + LEFT JOIN actor.card cards ON (au.id = cards.usr) + INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id) + LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr) + LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id) + LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id) + LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id) + LEFT JOIN action.circulation circ ON (au.id = circ.usr) + LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify') + LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt') + LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled') + LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1) + LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2) + + GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, + 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30, + 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45, + 46,47,48,49,50,51,52,53,54,55,56,57,58,59,60, + 61,62,63,64,65,66,67,68,69,70,71,72,73,74,75, + 76,77,78,79,80,81 + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/examples/fm_IDL.xsd b/Open-ILS/examples/fm_IDL.xsd index 82cf1ecdda..1ad986f37e 100644 --- a/Open-ILS/examples/fm_IDL.xsd +++ b/Open-ILS/examples/fm_IDL.xsd @@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" + xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:crud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" targetNamespace="http://opensrf.org/spec/IDL/base/v1" elementFormDefault="qualified" @@ -41,6 +42,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + @@ -61,7 +65,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + + + + + + + + + + @@ -75,6 +88,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + @@ -96,11 +110,27 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + + + + + + + + + diff --git a/Open-ILS/examples/simple-reporter.xsd b/Open-ILS/examples/simple-reporter.xsd new file mode 100644 index 0000000000..073a959189 --- /dev/null +++ b/Open-ILS/examples/simple-reporter.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + diff --git a/Open-ILS/xsl/fm_IDL2js.xsl b/Open-ILS/xsl/fm_IDL2js.xsl index cf7b7450a5..fd3abfdf05 100644 --- a/Open-ILS/xsl/fm_IDL2js.xsl +++ b/Open-ILS/xsl/fm_IDL2js.xsl @@ -5,6 +5,7 @@ xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" + xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" xmlns:str="http://exslt.org/strings" extension-element-prefixes="str" @@ -39,15 +40,55 @@ for (var c in _preload_fieldmapper_IDL) { - :{name:"",label:"",restrict_primary:"",table:"",core:true,virtual:true,source:"()",pkey:"",pkey_sequence:"",} + + : + {name:"", + label:"", + restrict_primary:"", + table:"", + core:true,virtual:true, + source:"()", + pkey:"", + pkey_sequence:"", + + + } fields:[,] + + ,field_groups:[ + + + , + + ] + ,permacrud:{"":{},} -{name:"",label:"",primitive:true,selector:"",virtual:true,required:true,i18n:true,config_field:true,datatype:""} + + { + name:"", + label:"", + primitive:true, + selector:"", + suggest_transform:"", + suggest_operator:"", + suggest_filter:true, + force_transform:["",], + force_operator:"", + force_filter:true, + force_filtervalues:["",], + hide_from:["",], + field_groups:["",], + virtual:true,required:true, + i18n:true,config_field:true, + + datatype: + "" + } perms:['',] @@ -58,7 +99,7 @@ for (var c in _preload_fieldmapper_IDL) { type:"link",, -map:"",key:"","class":"",reltype:"" +org_filter_field:"",map:"",key:"","class":"",reltype:"" -- 2.11.0