[open-ils-commits] r8055 - in trunk/Open-ILS/src: . reporter
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Nov 9 21:22:03 EST 2007
Author: dbs
Date: 2007-11-09 21:06:00 -0500 (Fri, 09 Nov 2007)
New Revision: 8055
Added:
trunk/Open-ILS/src/reporter/report-fail
trunk/Open-ILS/src/reporter/report-success
Removed:
trunk/Open-ILS/src/reporter/config.sql
trunk/Open-ILS/src/reporter/report_base.example.xml
trunk/Open-ILS/src/reporter/report_failure.tmpl
trunk/Open-ILS/src/reporter/report_stage1.example.xml
trunk/Open-ILS/src/reporter/report_success.tmpl
trunk/Open-ILS/src/reporter/reporter.schema-gen.pl
trunk/Open-ILS/src/reporter/tables.example.xml
trunk/Open-ILS/src/reporter/templates/
trunk/Open-ILS/src/reporter/widgets.example.xml
Modified:
trunk/Open-ILS/src/Makefile
Log:
Delete reporter cruft.
Rename success and failure templates to match config file defaults.
Ensure current reporter code gets installed as part of openils_all target.
Modified: trunk/Open-ILS/src/Makefile
===================================================================
--- trunk/Open-ILS/src/Makefile 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/Makefile 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,3 +1,4 @@
+# vim:noet:ts=4
export LDFLAGS += -L . -L$(TMP) -L $(OPENSRF_LIBS)
export CFLAGS += -pipe -g -Wall -O2 -fPIC -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) \
@@ -11,7 +12,7 @@
install: perl-install web-install server-xul string-templates-install xsl-install c_apps-install circ_rules-install offline-install storage-bootstrap cgi-bootstrap
-web-install: webcore-install autojs-install mod_xmlent-install offline-install
+web-install: webcore-install autojs-install mod_xmlent-install offline-install reporter-install
circ_rules-install:
@echo $@
@@ -141,12 +142,11 @@
reporter-install:
@echo $@
-# @echo "Installing Reporter templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
-# cp reporter/report_base.example.xml $(ETCDIR)/reporter.example.xml
-# cp reporter/tables.example.xml $(ETCDIR)
-# cp reporter/widgets.example.xml $(ETCDIR)
-# mkdir -p $(REPORTERDIR)
-# cp -r reporter/templates/* $(REPORTERDIR)
+ @echo "Installing Reporter email templates to $(REPORTERDIR) and example configs to $(ETCDIR)"
+ cp reporter/clark-kent.pl $(BINDIR)
+ cp reporter/report-fail $(DATADIR)
+ cp reporter/report-success $(DATADIR)
+ mkdir -p $(REPORTERDIR)
# -----------------------------------------------------------------------------------
offline-install:
Deleted: trunk/Open-ILS/src/reporter/config.sql
===================================================================
--- trunk/Open-ILS/src/reporter/config.sql 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/config.sql 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,108 +0,0 @@
-DROP SCHEMA reporter CASCADE;
-
-CREATE SCHEMA reporter;
-
-BEGIN;
-
-CREATE OR REPLACE VIEW reporter.date_series AS
- SELECT CAST('1900/01/01' AS DATE) + x AS date,
- CAST('1900/01/01' AS DATE) + x AS date_label
- FROM GENERATE_SERIES(
- 0,
- CAST( EXTRACT( 'days' FROM CAST( NOW() - CAST( '1900/01/01' AS DATE ) AS INTERVAL ) ) AS INT )
- ) AS g(x);
-
-CREATE OR REPLACE VIEW reporter.date_hour_series AS
- SELECT CAST(date + CAST(h || ' hours' AS INTERVAL) AS TIMESTAMP WITH TIME ZONE) AS date_hour,
- CAST(date + CAST(h || ' hours' AS INTERVAL) AS TIMESTAMP WITH TIME ZONE) AS date_hour_label
- FROM reporter.date_series,
- GENERATE_SERIES(0,23) g(h);
-
-
-
-CREATE TABLE reporter.date_dim AS
- SELECT
- EXTRACT('year' FROM date_label)::INT AS year,
- EXTRACT('month' FROM date_label)::INT AS month,
- EXTRACT('day' FROM date_label)::INT AS day
- FROM
- (SELECT '1900-01-01'::date + g.x AS date_label
- FROM GENERATE_SERIES(0, EXTRACT('days' FROM NOW() + '10 years'::INTERVAL - '1900-01-01'::TIMESTAMP WITH TIME ZONE)::INT) g(x)) as y
- ORDER BY 1,2,3;
-
-
-CREATE TABLE reporter.time_dim AS
- SELECT
- a.x AS hour,
- b.x AS minute,
- c.x AS second
- FROM
- GENERATE_SERIES(0, 23) as a(x),
- GENERATE_SERIES(0, 59) as b(x),
- GENERATE_SERIES(0, 59) as c(x)
- order by 1,2,3;
-
-
-CREATE TABLE reporter.stage2 (
- id serial primary key,
- stage1 text not null,
- params text not null,
- owner int not null,
- pub bool not null
- default false,
- create_date timestamp with time zone not null
- default now(),
- edit_date timestamp with time zone not null
- default now()
-);
-
-CREATE OR REPLACE FUNCTION reporter.force_edit_date_update () RETURNS TRIGGER AS $$
- BEGIN
- NEW.edit_date = NOW();
- RETURN NEW;
- END;
-$$ LANGUAGE PLPGSQL;
-
-CREATE TRIGGER force_edit_date_update_trig
- BEFORE UPDATE ON reporter.stage2
- FOR EACH ROW
- EXECUTE PROCEDURE reporter.force_edit_date_update ();
-
-CREATE TABLE reporter.stage3 (
- id serial primary key,
- stage2 int not null
- references reporter.stage2 (id)
- on delete restrict
- deferrable
- initially deferred,
- params text not null,
- owner int not null,
- disable bool not null
- default false,
- pub bool not null
- default false,
- create_date timestamp with time zone not null
- default now(),
- runtime timestamp with time zone default now(),
- recurrence interval
-);
-
-CREATE TABLE reporter.output (
- id serial primary key,
- stage3 int not null
- references reporter.stage3 (id)
- on delete restrict
- deferrable
- initially deferred,
- queue_time timestamp with time zone not null default now(),
- run_time timestamp with time zone,
- run_pid int,
- query text,
- error text,
- error_time timestamp with time zone,
- complete_time timestamp with time zone,
- state text check (state in ('wait','running','complete','error'))
-);
-
-COMMIT;
-
Copied: trunk/Open-ILS/src/reporter/report-fail (from rev 8053, trunk/Open-ILS/src/reporter/report_failure.tmpl)
===================================================================
--- trunk/Open-ILS/src/reporter/report-fail (rev 0)
+++ trunk/Open-ILS/src/reporter/report-fail 2007-11-10 02:06:00 UTC (rev 8055)
@@ -0,0 +1,18 @@
+To: {TO}
+From: {FROM}
+Reply-To: {REPLY_TO}
+Subject: Report failed: "{REPORT_NAME}"
+
+Your report, named [{REPORT_NAME}], scheduled to run at {RUN_TIME},
+has failed with the following error message:
+
+ {ERROR_TEXT}
+
+The SQL command attempted was:
+
+ {SQL}
+
+If you are unsure of the meaning of this message, please contact your
+ILS adminstrator or support staff and give them both the error message
+and the SQL command.
+
Copied: trunk/Open-ILS/src/reporter/report-success (from rev 8048, trunk/Open-ILS/src/reporter/report_success.tmpl)
===================================================================
--- trunk/Open-ILS/src/reporter/report-success (rev 0)
+++ trunk/Open-ILS/src/reporter/report-success 2007-11-10 02:06:00 UTC (rev 8055)
@@ -0,0 +1,10 @@
+To: {TO}
+From: {FROM}
+Reply-To: {REPLY_TO}
+Subject: Report finished: "{REPORT_NAME}"
+
+At {RUN_TIME} the report "{REPORT_NAME}" finished running with a complete
+time of {COMPLETE_TIME}.
+
+You can view the report at the following URL:
+{OUTPUT_URL}
Deleted: trunk/Open-ILS/src/reporter/report_base.example.xml
===================================================================
--- trunk/Open-ILS/src/reporter/report_base.example.xml 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/report_base.example.xml 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<reporter xmlns:xi="http://www.w3.org/2001/XInclude">
-
- <setup>
- <files>
- <output_base>/openils/var/web/reporter/</output_base>
- <!-- <chart_logo>/openils/var/web/opac/images/small_logo.gif</chart_logo> -->
- </files>
- <database>
- <driver>Pg</driver>
- <host>127.0.0.1</host>
- <port>5433</port>
- <name>develooper</name>
- <user>postgres</user>
- <password/>
- </database>
- </setup>
-
- <xi:include href="tables.example.xml">
- This file sucks in table definitions
- </xi:include>
- <xi:include href="widgets.example.xml">
- This file sucks in widget definitions
- </xi:include>
-
-</reporter>
Deleted: trunk/Open-ILS/src/reporter/report_failure.tmpl
===================================================================
--- trunk/Open-ILS/src/reporter/report_failure.tmpl 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/report_failure.tmpl 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,18 +0,0 @@
-To: {TO}
-From: {FROM}
-Reply-To: {REPLY_TO}
-Subject: Report failed: "{REPORT_NAME}"
-
-Your report, named [{REPORT_NAME}], scheduled to run at {RUN_TIME},
-has failed with the following error message:
-
- {ERROR_TEXT}
-
-The SQL command attempted was:
-
- {SQL}
-
-If you are unsure of the meaning of this message, please contact your
-ILS adminstrator or support staff and give them both the error message
-and the SQL command.
-
Deleted: trunk/Open-ILS/src/reporter/report_stage1.example.xml
===================================================================
--- trunk/Open-ILS/src/reporter/report_stage1.example.xml 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/report_stage1.example.xml 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<reporter xmlns:xi="http://www.w3.org/2001/XInclude">
- <report
- type="stage1"
- name="Silly"
- fact-table="silly.fact">
- <description>Silly Report base</description>
- <dims>
- <dim include="silly_word_dim"/>
- <dim include="silly_sayer_dim"/>
- </dims>
- </report>
-</reporter>
-
Deleted: trunk/Open-ILS/src/reporter/report_success.tmpl
===================================================================
--- trunk/Open-ILS/src/reporter/report_success.tmpl 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/report_success.tmpl 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,10 +0,0 @@
-To: {TO}
-From: {FROM}
-Reply-To: {REPLY_TO}
-Subject: Report finished: "{REPORT_NAME}"
-
-At {RUN_TIME} the report "{REPORT_NAME}" finished running with a complete
-time of {COMPLETE_TIME}.
-
-You can view the report at the following URL:
-{OUTPUT_URL}
Deleted: trunk/Open-ILS/src/reporter/reporter.schema-gen.pl
===================================================================
--- trunk/Open-ILS/src/reporter/reporter.schema-gen.pl 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/reporter.schema-gen.pl 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,111 +0,0 @@
-#!/usr/bin/perl
-use strict; use warnings;
-use XML::LibXML;
-use OpenSRF::Utils qw/:datetime/;
-use DateTime;
-use DateTime::Duration;
-use DateTime::Format::ISO8601;
-
-my $dt_parser = DateTime::Format::ISO8601->new;
-my $log = 'OpenSRF::Utils::Logger';
-
-
-my %chunkmap =
- ( doy => '%j',
- woy => '%U',
- month => '%m',
- year => '%Y',
- );
-
-
-my $parser = XML::LibXML->new;
-my $doc = $parser->parse_file($ARGV[0]);
-$parser->process_xincludes($doc);
-
-print "BEGIN;\n\n";
-for my $table ($doc->findnodes('/reporter/tables/table')) {
- my $tname = $table->getElementsByTagName('tablename')->string_value;
-
- (my $pkey_name = $tname) =~ s/\./_/gso;
- $pkey_name .= '_pkey';
- warn "$tname\n";
-
- my (@primary, at other, at indexed);
- for my $field ($table->findnodes('fields/field')) {
- my $fname = $field->getAttribute('name');
- my $fdatatype = $field->getAttribute('create-type') || $field->getAttribute('datatype');
- warn "\t$fname\n";
-
- if ($field->getAttribute('indexed')) {
- my $itype = $field->getAttribute('index-type') || 'BTREE';
- push @indexed, [$fname, $itype];
- }
-
- if ($field->getAttribute('primary')) {
- push @primary, [$fname, $fdatatype];
- } else {
- push @other, [$fname, $fdatatype];
- }
- }
-
- warn "\n";
- print "DROP TABLE $tname CASCADE;\n";
- print "CREATE TABLE $tname (\n\t".
- join(",\n\t", map { join("\t", @$_) } (@primary, @other))."\n".
- do {
- @primary ?
- ",\tCONSTRAINT $pkey_name PRIMARY KEY (".
- join(", ", map { $$_[0] } @primary). ")\n" :
- ''
- }.
- ");\n";
-
- print "\n";
-
- if ($table->getAttribute('partition')) {
- my ($part) = $table->getElementsByTagName('partition')->get_nodelist;
- my ($field) = $part->getElementsByTagName('field')->get_nodelist;
- my ($chunk) = $part->getElementsByTagName('chunk')->get_nodelist;
- my ($start) = $part->getElementsByTagName('start')->get_nodelist;
- my ($end) = $part->getElementsByTagName('end')->get_nodelist;
-
- $field = $field->textContent;
- $chunk = $chunk->textContent;
- $start = $dt_parser->parse_datetime( $start->textContent );
- $end = $dt_parser->parse_datetime( $end->textContent );
-
-
- while ( $start->epoch < $end->epoch ) {
-
- my $chunk_end = $start->clone;
- $chunk_end->add( DateTime::Duration->new( $chunk => 1 ) );
- $chunk_end->subtract( DateTime::Duration->new( seconds => 1 ) );
-
- my $tpart = $start->epoch;
-
- my $where = "BETWEEN '".$start->strftime('%FT%T%z').
- "' AND '".$chunk_end->strftime('%FT%T%z')."'";
-
- print "CREATE TABLE ${tname}_${chunk}_$tpart () INHERITS ($tname);\n";
- print "ALTER TABLE ${tname}_${chunk}_$tpart\n".
- "\tADD CONSTRAINT \"${tname}_${chunk}_${tpart}_test\"\n".
- "\tCHECK ($field $where);\n";
- print "CREATE RULE \"${tname}_${chunk}_${tpart}_ins_rule\" AS\n\tON INSERT TO ".
- "$tname \n\tWHERE NEW.$field $where".
- "\n\tDO INSTEAD INSERT INTO ${tname}_${chunk}_$tpart VALUES (NEW.*);\n";
- for my $i (@indexed) {
- print "CREATE INDEX \"${tname}_${chunk}_${tpart}_$$i[0]_idx\" ".
- "ON ${tname}_${chunk}_$tpart USING $$i[1] ($$i[0]);\n";
- }
- print "\n";
- $start->add( DateTime::Duration->new( $chunk => 1 ) );
- }
- } else {
- for my $i (@indexed) {
- print "CREATE INDEX \"${tname}_$$i[0]_idx\" ON $tname USING $$i[1] ($$i[0]);\n";
- }
- }
- print "\n";
-
-}
-print "COMMIT;\n";
Deleted: trunk/Open-ILS/src/reporter/tables.example.xml
===================================================================
--- trunk/Open-ILS/src/reporter/tables.example.xml 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/tables.example.xml 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,758 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<tables>
-
- <table id="wide-circulation" partition="false" fact-table="true">
- <label>Circulation</label>
- <description>Base table for creating circulation reports</description>
- <tablename>stats.fleshed_circulation</tablename>
-
- <fields>
- <field
- name="id"
- primary="true"
- create-type="serial"
- datatype="int">
- <label>ID</label>
- <description>Circulation ID</description>
- </field>
- <field
- name="circ_lib"
- datatype="int"
- indexed="true">
- <label>Circulator</label>
- <description>ID of the Circulating Library</description>
- </field>
- <field
- name="checkin_lib"
- datatype="int"
- indexed="true">
- <label>Checkin Library</label>
- <description>ID of the Checkin Library</description>
- </field>
- <field
- name="owning_lib"
- datatype="int"
- indexed="true">
- <label>Owner</label>
- <description>ID of the Owning Library</description>
- </field>
- <field
- name="start_date_day"
- datatype="date">
- <label>Start Date</label>
- <description>Date of the copy's cataloging</description>
- </field>
- <field
- name="start_date_hour"
- datatype="timestamptz">
- <label>Start Date and Hour</label>
- <description>Date and Hour of the circulation start</description>
- </field>
- <field
- name="due_date_day"
- datatype="date"
- indexed="true" >
- <label>Due Date</label>
- <description>Day the circulation is due</description>
- </field>
- <field
- name="due_date_hour"
- datatype="timestamptz"
- indexed="true" >
- <label>Due Date and Hour</label>
- <description>Day and Hour the circulation is due</description>
- </field>
- <field
- name="due_date"
- datatype="timestamptz"
- indexed="true"
- default="now()">
- <label>Due Date</label>
- <description>Timestamp of the circulation due date</description>
- </field>
- <field
- name="xact_start"
- datatype="timestamptz"
- indexed="true"
- default="now()">
- <label>Start Time</label>
- <description>Timestamp of the circulation start</description>
- </field>
- <field
- name="xact_finish"
- datatype="timestamptz"
- indexed="true"
- default="now()">
- <label>Finish Time</label>
- <description>Timestamp of the circulation end</description>
- </field>
- <field
- name="finish_date_day"
- datatype="date">
- <label>Finsh Date</label>
- <description>Date of the circulation end</description>
- </field>
- <field
- name="finish_date_hour"
- datatype="timestamptz">
- <label>Finish Date and Hour</label>
- <description>Date and Hour of the circulation end</description>
- </field>
- <field
- name="item_lang"
- datatype="text">
- <label>Language</label>
- <description>MARC Item Language</description>
- </field>
- <field
- name="item_form"
- datatype="text">
- <label>Form</label>
- <description>MARC Item Form of Material</description>
- </field>
- <field
- name="item_type"
- datatype="text">
- <label>Type</label>
- <description>MARC Item Type</description>
- </field>
- <field
- name="call_number_label"
- transform-group="call_number"
- widget-family="string-input"
- datatype="text">
- <label>Call Number</label>
- <description>Copy Call Number Label</description>
- </field>
- </fields>
-
- <links>
- <link
- field="start_date_day"
- table="generic_day_series"
- id="circ_start_day"
- key="date"
- type="has_a"/>
- <link
- field="start_date_hour"
- table="generic_hour_series"
- id="circ_start_hour"
- key="date_hour"
- type="has_a"/>
- <link
- field="finish_date_day"
- table="generic_day_series"
- id="circ_finish_day"
- key="date"
- type="has_a"/>
- <link
- field="finish_date_hour"
- table="generic_hour_series"
- id="circ_finish_hour"
- key="date_hour"
- type="has_a"/>
- <link
- field="due_date_day"
- table="generic_day_series"
- id="circ_due_date_day"
- key="date"
- type="has_a"/>
- <link
- field="due_date_hour"
- table="generic_hour_series"
- id="circ_due_date_hour"
- key="date_hour"
- type="has_a"/>
- <link
- field="checkin_lib"
- table="org_unit"
- id="circ_checkin_lib"
- key="id"
- type="has_a"/>
- <link
- field="owning_lib"
- table="org_unit"
- id="circ_owning_lib"
- key="id"
- type="has_a"/>
- <link
- field="item_lang"
- table="marc_lang_map"
- id="circ_language"
- key="code"
- type="has_a"/>
- <link
- field="item_form"
- table="marc_form_map"
- id="circ_item_form"
- key="code"
- type="has_a"/>
- <link
- field="item_type"
- table="marc_type_map"
- id="circ_item_type"
- key="code"
- type="has_a"/>
- <link
- field="circ_lib"
- table="org_unit"
- id="circ_circ_lib"
- key="id"
- type="has_a"/>
- </links>
-
- </table>
-
- <table id="wide-copy" partition="false" fact-table="true">
- <label>Copies</label>
- <description>Base table for creating snapshot reports on copy information</description>
- <tablename>stats.fleshed_copy</tablename>
-
- <fields>
- <field
- name="id"
- primary="true"
- create-type="serial"
- datatype="int">
- <label>ID</label>
- <description>Copy ID</description>
- </field>
- <field
- name="barcode"
- widget-family="string-input"
- datatype="text">
- <label>Barcode</label>
- <description>Copy Barcode</description>
- </field>
- <field
- name="owning_lib"
- datatype="int"
- indexed="true">
- <label>Owner</label>
- <description>ID of the Owning Library</description>
- </field>
- <field
- name="circ_lib"
- datatype="int"
- indexed="true">
- <label>Circulator</label>
- <description>ID of the Circulating Library</description>
- </field>
- <field
- name="create_date_day"
- datatype="date">
- <label>Create Date</label>
- <description>Date of the copy's cataloging</description>
- </field>
- <field
- name="create_date_hour"
- datatype="timestamptz">
- <label>Create Date and Hour</label>
- <description>Date and Hour of the copy's cataloging</description>
- </field>
- <field
- name="create_date"
- datatype="timestamptz"
- indexed="true"
- default="now()">
- <label>Create Date</label>
- <description>Timestamp of the copy's cataloging</description>
- </field>
- <field
- name="edit_date"
- datatype="timestamptz"
- indexed="true"
- default="now()">
- <label>Edit Date</label>
- <description>Timestamp of the copy's last edit</description>
- </field>
- <field
- name="edit_date_day"
- datatype="date">
- <label>Edit Date</label>
- <description>Date of the copy's last edit</description>
- </field>
- <field
- name="edit_date_hour"
- datatype="timestamptz">
- <label>Edit Date and Hour</label>
- <description>Date and Hour of the copy's last edit</description>
- </field>
- <field
- name="item_lang"
- datatype="text">
- <label>Language</label>
- <description>MARC Item Language</description>
- </field>
- <field
- name="item_form"
- datatype="text">
- <label>Form</label>
- <description>MARC Item Form of Material</description>
- </field>
- <field
- name="item_type"
- datatype="text">
- <label>Type</label>
- <description>MARC Item Type</description>
- </field>
- <field
- name="call_number_label"
- transform-group="call_number"
- widget-family="string-input"
- datatype="text">
- <label>Call Number</label>
- <description>Copy Call Number Label</description>
- </field>
- </fields>
-
- <links>
- <link
- field="create_date_day"
- table="generic_day_series"
- id="copy_create_day"
- key="date"
- type="has_a"/>
- <link
- field="create_date_hour"
- table="generic_hour_series"
- id="copy_create_hour"
- key="date_hour"
- type="has_a"/>
- <link
- field="edit_date_day"
- table="generic_day_series"
- id="copy_edit_day"
- key="date"
- type="has_a"/>
- <link
- field="edit_date_hour"
- table="generic_hour_series"
- id="copy_edit_hour"
- key="date_hour"
- type="has_a"/>
- <link
- field="owning_lib"
- table="org_unit"
- id="copy_owning_lib"
- key="id"
- type="has_a"/>
- <link
- field="item_lang"
- table="marc_lang_map"
- id="copy_language"
- key="code"
- type="has_a"/>
- <link
- field="item_form"
- table="marc_form_map"
- id="copy_item_form"
- key="code"
- type="has_a"/>
- <link
- field="item_type"
- table="marc_type_map"
- id="copy_item_type"
- key="code"
- type="has_a"/>
- <link
- field="circ_lib"
- table="org_unit"
- id="copy_circ_lib"
- key="id"
- type="has_a"/>
- </links>
-
- </table>
-
- <table id="wide-call-number" partition="false" fact-table="true">
- <label>Call Numbers/Volumes</label>
- <description>Base table for creating snapshot reports on call number/volume information</description>
- <tablename>stats.fleshed_call_number</tablename>
-
- <fields>
- <field
- name="id"
- primary="true"
- create-type="serial"
- datatype="int">
- <label>ID</label>
- <description>Call Number ID</description>
- </field>
- <field
- name="owning_lib"
- datatype="int"
- indexed="true">
- <label>Owner</label>
- <description>ID of the Owning Library</description>
- </field>
- <field
- name="create_date_day"
- datatype="date">
- <label>Create Date</label>
- <description>Date of the call number's cataloging</description>
- </field>
- <field
- name="create_date_hour"
- datatype="timestamptz">
- <label>Create Date and Hour</label>
- <description>Date and Hour of the call number's cataloging</description>
- </field>
- <field
- name="create_date"
- datatype="timestamptz"
- indexed="true"
- default="now()">
- <label>Create Date</label>
- <description>Timestamp of the call number's cataloging</description>
- </field>
- <field
- name="edit_date"
- datatype="timestamptz"
- indexed="true"
- default="now()">
- <label>Edit Date</label>
- <description>Timestamp of the call number's last edit</description>
- </field>
- <field
- name="edit_date_day"
- datatype="date">
- <label>Edit Date</label>
- <description>Date of the call number's last edit</description>
- </field>
- <field
- name="edit_date_hour"
- datatype="timestamptz">
- <label>Edit Date and Hour</label>
- <description>Date and Hour of the call number's last edit</description>
- </field>
- <field
- name="item_lang"
- datatype="text">
- <label>Language</label>
- <description>MARC Item Language</description>
- </field>
- <field
- name="item_form"
- datatype="text">
- <label>Form</label>
- <description>MARC Item Form of Material</description>
- </field>
- <field
- name="item_type"
- datatype="text">
- <label>Type</label>
- <description>MARC Item Type</description>
- </field>
- <field
- name="label"
- transform-group="call_number"
- widget-family="string-input"
- datatype="text">
- <label>Call Number</label>
- <description>Call Number Label</description>
- </field>
- </fields>
-
- <links>
- <link
- field="create_date_day"
- table="generic_day_series"
- id="call_number_create_day"
- key="date"
- type="has_a"/>
- <link
- field="create_date_hour"
- table="generic_hour_series"
- id="call_number_create_hour"
- key="date_hour"
- type="has_a"/>
- <link
- field="edit_date_day"
- table="generic_day_series"
- id="call_number_edit_day"
- key="date"
- type="has_a"/>
- <link
- field="edit_date_hour"
- table="generic_hour_series"
- id="call_number_edit_hour"
- key="date_hour"
- type="has_a"/>
- <link
- field="owning_lib"
- table="org_unit"
- id="call_number_owning_lib"
- key="id"
- type="has_a"/>
- <link
- field="item_lang"
- table="marc_lang_map"
- id="call_number_language"
- key="code"
- type="has_a"/>
- <link
- field="item_form"
- table="marc_form_map"
- id="call_number_item_form"
- key="code"
- type="has_a"/>
- <link
- field="item_type"
- table="marc_type_map"
- id="call_number_item_type"
- key="code"
- type="has_a"/>
- </links>
-
- </table>
-
- <table id="org_unit" partition="false" fact-table="false">
- <label>Organizational Units</label>
- <description>Table containing library hierarchy definition</description>
- <tablename>actor.org_unit</tablename>
-
- <fields>
- <field
- name="id"
- primary="true"
- filterable='true'
- widget-family="lib-choose"
- create-type="serial"
- datatype="int">
- <label>Unique Library</label>
- <description>Globally Unique Library Identifier</description>
- </field>
- <field
- name="name"
- widget-family="string-choose"
- datatype="text">
- <label>Library Name</label>
- <description>Friendly Library Name</description>
- </field>
- <field
- name="shortname"
- widget-family="string-choose"
- datatype="text">
- <label>Short Name</label>
- <description>Library Short (Policy) Name</description>
- </field>
- </fields>
- </table>
-
- <table id="marc_lang_map" partition="false" fact-table="false">
- <label>MARC Language Codes</label>
- <description>Table mapping MARC three character codes to language names</description>
- <tablename>config.language_map</tablename>
-
- <fields>
- <field
- name="code"
- primary='true'
- datatype="text">
- <label>Code</label>
- <description>MARC Language Code</description>
- </field>
- <field
- name="value"
- widget-family="string-choose"
- datatype="text">
- <label>Language Name</label>
- <description>Name associated with the MARC code</description>
- </field>
- </fields>
- </table>
-
- <table id="generic_day_series" partition="false" fact-table="false">
- <label>Constant day series</label>
- <description>View providing a day series starting at 1900 and ending at 'now'</description>
- <tablename>reporter.date_series</tablename>
-
- <fields>
- <field
- name="date"
- primary='true'
- filterable='true'
- hidden='false'
- datatype="timestamptz">
- <label>Date</label>
- <description>Date</description>
- </field>
- </fields>
- </table>
-
- <table id="generic_hour_series" partition="false" fact-table="false">
- <label>Constant hour series</label>
- <description>View providing a hour series starting at 1900 and ending at 'now'</description>
- <tablename>reporter.date_hour_series</tablename>
-
- <fields>
- <field
- name="date_hour"
- primary='true'
- filterable='true'
- hidden='false'
- datatype="timestamptz">
- <label>Date and Hour</label>
- <description>Date and Hour</description>
- </field>
- </fields>
- </table>
-
- <table id="marc_form_map" partition="false" fact-table="false">
- <label>MARC Item Form Codes</label>
- <description>Table mapping MARC three character codes to Item Form names</description>
- <tablename>config.item_form_map</tablename>
-
- <fields>
- <field
- name="code"
- primary='true'
- datatype="text">
- <label>Code</label>
- <description>MARC Item Form Code</description>
- </field>
- <field
- name="value"
- widget-family="string-choose"
- datatype="text">
- <label>Item Form Name</label>
- <description>Name associated with the MARC code</description>
- </field>
- </fields>
- </table>
-
- <table id="marc_type_map" partition="false" fact-table="false">
- <label>MARC Item Type Codes</label>
- <description>Table mapping MARC three character codes to Item Type names</description>
- <tablename>config.item_type_map</tablename>
-
- <fields>
- <field
- name="code"
- primary='true'
- datatype="text">
- <label>Code</label>
- <description>MARC Item Type Code</description>
- </field>
- <field
- name="value"
- widget-family="string-choose"
- datatype="text">
- <label>Item Type Name</label>
- <description>Name associated with the MARC code</description>
- </field>
- </fields>
- </table>
-
- <!--
-
- <table id="silly.fact" partition="true" fact-table="false">
- <label>Silly Fact table</label>
- <description>Base table for creating reports on silly words</description>
- <tablename>stats.silly_fact</tablename>
-
- <partition>
- <field>said_when</field>
- --><!-- Valid options: years, months, weeks, days, hours, minutes, seconds --><!--
- <chunk>months</chunk>
- <start>2005-09-01</start>
- <end>2005-12-31</end>
- </partition>
-
- <fields>
- <field
- name="id"
- primary="true"
- create-type="serial"
- datatype="int">
- <label>Silly entry id</label>
- <description>Silly entry id</description>
- </field>
- <field
- name="silly_word_dim"
- datatype="int"
- indexed="true">
- <label>Silly word dim</label>
- <description>Silly word entry dimension link</description>
- </field>
- <field
- name="silly_sayer_dim"
- datatype="int"
- indexed="true">
- <label>Silly sayer dim</label>
- <description>Silly sayer entry dimension link</description>
- </field>
- <field
- name="said_when"
- datatype="timestamptz"
- core="true"
- indexed="true"
- default="now()">
- <label>Silly word timestamp</label>
- <description>Silly word entry timestamp</description>
- </field>
- </fields>
- <links>
- <link
- field="silly_word_dim"
- table="silly.word_dim"
- key="id"
- type="has_a"/>
- <link
- field="silly_sayer_dim"
- table="silly.sayer_dim"
- key="id"
- type="has_a"/>
- </links>
- </table>
-
- <table id="silly.word_dim">
- <label>Silly word list</label>
- <description>Silly word list</description>
- <tablename>stats.words</tablename>
- <fields>
- <field
- name="id"
- primary="true"
- create-type="serial"
- datatype="int">
- <label>Silly word id</label>
- </field>
- <field
- name="word"
- datatype="text"
- indexed="true"
- index-type="BTREE">
- <label>Silly word</label>
- </field>
- </fields>
- </table>
-
- <table id="silly.sayer_dim">
- <label>Silly word sayer list</label>
- <description>Silly word sayer list</description>
- <tablename>stats.silly_sayers</tablename>
- <fields>
- <field
- name="id"
- primary="true"
- create-type="serial"
- datatype="int">
- <label>Silly person id</label>
- </field>
- <field
- name="sayer"
- widget-family="string-choose"
- datatype="text"
- indexed="true"
- index-type="BTREE">
- <label>Silly person</label>
- </field>
- </fields>
- </table>
-
- -->
-
-</tables>
-
Deleted: trunk/Open-ILS/src/reporter/widgets.example.xml
===================================================================
--- trunk/Open-ILS/src/reporter/widgets.example.xml 2007-11-10 01:53:29 UTC (rev 8054)
+++ trunk/Open-ILS/src/reporter/widgets.example.xml 2007-11-10 02:06:00 UTC (rev 8055)
@@ -1,291 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widgets>
-
- <!-- String selection from user input -->
- <widget-family name="string-input" datatype="text">
- <label>String matching from user input</label>
-
- <widget name="exact">
- <label>Exactly match a user supplied string</label>
- <description>
- This widget filters a column based on an exact string
- match.
- </description>
- </widget>
-
- <widget name="multistring">
- <label>Exactly match one of several user supplied strings</label>
- <description>
- This widget filters a column based on an set of strings.
- </description>
- </widget>
-
- <widget name="initial-substring">
- <label>Match the begining of a string from user input</label>
- <description>
- This widget filters a column based on an initial substring
- match.
- </description>
- </widget>
- </widget-family>
-
-
- <!-- String selection from in-database data -->
- <widget-family name="string-choose" datatype="text">
- <label>String filter from known data</label>
-
- <widget name="dropdown">
- <label>Exactly match a string chosen from a dropdown</label>
- <description>
- This widget filters a column based on an exact string match.
- </description>
- </widget>
-
- <widget name="multiselect">
- <label>Match multiple strings chosen from a multiselect box</label>
- <description>
- This widget filters a column based on multiple strings.
- </description>
- </widget>
- </widget-family>
-
- <!-- Comparative time range selection -->
- <widget-family name="comparative-timerange" datatype="timestamptz">
- <label>Comparative time-range widgets</label>
-
- <widget name="month">
- <label>Compare runtime relative time months</label>
- <description>
- This widget allows the user to pick an arbitrary time range
- on which to report.
- </description>
- <filter-code type="perl">
- $full_col = "CAST(DATE_TRUNC('month', $full_col) AS DATE)";
- $where_clause =
- "$full_col IN ( CAST(DATE_TRUNC('month', NOW() - CAST( ? || ' month' AS INTERVAL )) AS DATE), ".
- " CAST(DATE_TRUNC('month', NOW() - CAST( ? || ' month' AS INTERVAL )) AS DATE))";
- push @$bind_list, $$val{target}, $$val{target} + $$val{compare};
- </filter-code>
- </widget>
- </widget-family>
-
- <!-- Specific time range selection family -->
- <widget-family name="specific-timerange" datatype="timestamptz">
- <label>Specific time-range widgets</label>
-
- <!--
- <widget name="any">
- <label>User defined time range</label>
- <description>
- This widget allows the user to pick an arbitrary time range
- on which to report.
- </description>
- </widget>
- -->
-
- <widget name="day">
- <label>Choose a specific date</label>
- <description>
- This widget allows the user to pick a specific date on which
- to report.
- </description>
- <filter-code type="perl">
- $full_col = "DATE_TRUNC('day', $full_col)";
- $where_clause = "$full_col = CAST(? AS DATE)";
- push @$bind_list, sprintf('%d/%02d/%02d', @$val{qw/year month day/});
- </filter-code>
- </widget>
-
- <widget name="week">
- <label>Choose a specific week of the year</label>
- <description>
- This widget allows the user to pick a specific week of the year
- on which to report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "( EXTRACT('year' FROM $full_col) = ? ".
- " AND EXTRACT('week' FROM $full_col) = ? )";
- push @$bind_list, $$val{year}, $$val{week};
- </filter-code>
- </widget>
-
- <widget name="multiweek">
- <label>Choose a range of weeks of the year</label>
- <description>
- This widget allows the user to pick a range of weeks of the year
- on which to report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "( EXTRACT('year' FROM $full_col) = ? ".
- " AND EXTRACT('week' FROM $full_col) ".
- "BETWEEN ? AND ? )";
- push @$bind_list, $$val{year}, $$val{start}, $$val{end};
- </filter-code>
- </widget>
-
- <widget name="month">
- <label>Choose a specific year and month</label>
- <description>
- This widget allows the user to pick a specific year and month
- on which to report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "( EXTRACT('year' FROM $full_col) = ? ".
- " AND EXTRACT('month' FROM $full_col) = ? )";
- push @$bind_list, $$val{'start-year'}, $$val{'start-month'};
- </filter-code>
- </widget>
-
- <widget name="multimonth">
- <label>Choose a range of months</label>
- <description>
- This widget allows the user to pick a range of month on which to
- report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "DATE_TRUNC('month', $full_col) ".
- "BETWEEN CAST(? AS DATE) AND CAST(? AS DATE)";
- push @$bind_list,
- sprintf('%d/%02d/01', @$val{qw/start-year start-month/}),
- sprintf('%d/%02d/01', @$val{qw/end-year end-month/});
- </filter-code>
- </widget>
-
- <!--
- <widget name="quarter">
- <label>Choose a specific year and quarter</label>
- <description>
- This widget allows the user to pick a specific year and
- quarter on which to report.
- </description>
- </widget>
-
- <widget name="multiquarter">
- <label>Choose a range of quarters</label>
- <description>
- This widget allows the user to pick a range of quarter on which
- to report.
- </description>
- </widget>
- -->
-
- <widget name="year">
- <label>Choose a specific year</label>
- <description>
- This widget allows the user to pick a specific year on which to
- report.
- </description>
- <filter-code type="perl">
- $where_clause = "EXTRACT('year' FROM $full_col) = ?";
- push @$bind_list, $val;
- </filter-code>
- </widget>
-
- <widget name="multiyear">
- <label>Choose a range of years</label>
- <description>
- This widget allows the user to pick a range of years on which to
- report.
- </description>
- <filter-code type="perl">
- $where_clause = "EXTRACT('year' FROM $full_col) BETWEEN ? AND ?";
- push @$bind_list, $$val{year}, $$val{year} + $$val{year-count};
- </filter-code>
- </widget>
- </widget-family>
-
- <!-- Specific time range selection family -->
- <widget-family name="relative-timerange" datatype="timestamptz">
- <label>Relative time-range widgets</label>
-
- <widget name="day">
- <label>Choose a date relative to the report runtime</label>
- <description>
- This widget allows the user to pick a date relative to the
- report runtime on which to report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "CAST($full_col AS DATE) = ".
- "CAST((NOW() - CAST(? || ' day' AS INTERVAL)) AS DATE)";
- push @$bind_list, $val;
- </filter-code>
- </widget>
-
- <widget name="week">
- <label>Choose a week (sun-sat) relative to the report runtime</label>
- <description>
- This widget allows the user to pick a week (sun-sat) relative
- to the report runtime on which to report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "( CAST(DATE_TRUNC('week', $full_col) AS DATE) = ".
- " CAST(DATE_TRUNC('week', NOW() - CAST(? || ' weeks' AS INTERVAL) ) AS DATE) ";
- push @$bind_list, $val;
- </filter-code>
- </widget>
-
- <widget name="month">
- <label>Choose a month relative to the report runtime</label>
- <description>
- This widget allows the user to pick a month relative to the
- report runtime on which to report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "CAST(DATE_TRUNC('month', $full_col) AS DATE) = ".
- "CAST(DATE_TRUNC('month', NOW()) - CAST(? || ' months' AS INTERVAL) AS DATE)";
- push @$bind_list, $val;
- </filter-code>
- </widget>
-
- <!--
- <widget name="quarter">
- <label>Choose a quarter relative to the report runtime</label>
- <description>
- This widget allows the user to pick a quarter relative to the
- report runtime on which to report.
- </description>
- </widget>
- -->
-
- <widget name="year">
- <label>Choose a year relative to the report runtime</label>
- <description>
- This widget allows the user to pick a year relative to the
- report runtime on which to report.
- </description>
- <filter-code type="perl">
- $where_clause =
- "CAST(DATE_TRUNC('year', $full_col) AS DATE)= ".
- "CAST(DATE_TRUNC('year', NOW()) - CAST(? || ' years' AS INTERVAL) AS DATE)";
- push @$bind_list, $val;
- </filter-code>
- </widget>
- </widget-family>
-
- <!-- Library selection from in-database data - special to OpenILS -->
- <widget-family name="lib-choose" datatype="text">
- <label>String filter from known data</label>
-
- <widget name="dropdown">
- <label>Exactly match a Library chosen from a dropdown</label>
- <description>
- This widget filters on an exact Library Name match.
- </description>
- </widget>
-
- <widget name="multiselect">
- <label>Match multiple Libraries chosen from a multiselect box</label>
- <description>
- This widget filters based on multiple Library names.
- </description>
- </widget>
- </widget-family>
- </widgets>
-
More information about the open-ils-commits
mailing list