[open-ils-commits] r12735 - in trunk/Open-ILS: examples src/sql/Pg (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 31 12:51:47 EDT 2009
Author: miker
Date: 2009-03-31 12:51:44 -0400 (Tue, 31 Mar 2009)
New Revision: 12735
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
Log:
adding template_output table to support storing just one copy of batch output
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2009-03-31 16:50:24 UTC (rev 12734)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2009-03-31 16:51:44 UTC (rev 12735)
@@ -580,6 +580,27 @@
</links>
</class>
+ <class id="atto" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::template_output" oils_persist:tablename="action_trigger.template_output" reporter:label="Event output">
+ <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.template_output_id_seq">
+ <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+ <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+ <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+ <field reporter:label="Output ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+ <field reporter:label="Create Date/Time" name="create_time" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
+ <field reporter:label="Data" name="data" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Events" name="events" oils_obj:array_position="6" oils_persist:virtual="true" reporter:datatype="link"/>
+ </fields>
+ <links>
+ <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
+ <links/>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <retrieve/>
+ <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
+ </actions>
+ </permacrud>
+ </class>
+
<class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger hook point">
<fields oils_persist:primary="key">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
@@ -756,12 +777,13 @@
<field reporter:label="Update Time" name="update_time" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="timestamp"/>
<field reporter:label="Complete Time" name="complete_time" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="timestamp"/>
<field reporter:label="State" name="state" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="text"/>
- <field reporter:label="Template Output" name="template_output" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Template Output" name="template_output" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="link"/>
<field reporter:label="Error Output" name="error_output" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
<field reporter:label="Update Process" name="update_process" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="int"/>
</fields>
<links>
<link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
+ <link field="template_output" reltype="has_a" key="id" map="" class="atto"/>
</links>
</class>
Modified: trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql 2009-03-31 16:50:24 UTC (rev 12734)
+++ trunk/Open-ILS/src/sql/Pg/400.schema.action_trigger.sql 2009-03-31 16:51:44 UTC (rev 12735)
@@ -131,10 +131,16 @@
complete_time TIMESTAMPTZ,
update_process INT,
state TEXT NOT NULL DEFAULT 'pending' CHECK (state IN ('pending','invalid','found','collecting','collected','validating','valid','reacting','reacted','cleaning','complete','error')),
- template_output TEXT,
+ template_output BIGINT REFERENCES action_trigger.event_output (id),
error_output TEXT
);
+CREATE TABLE action_trigger.event_output (
+ id BIGSERIAL PRIMARY KEY,
+ create_time TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+ data TEXT NOT NULL
+);
+
CREATE TABLE action_trigger.event_params (
id BIGSERIAL PRIMARY KEY,
event_def INT NOT NULL REFERENCES action_trigger.event_definition (id) DEFERRABLE INITIALLY DEFERRED,
More information about the open-ils-commits
mailing list