[open-ils-commits] r11393 - in trunk/Open-ILS: examples src/sql/Pg

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 3 16:39:51 EST 2008


Author: miker
Date: 2008-12-03 16:39:47 -0500 (Wed, 03 Dec 2008)
New Revision: 11393

Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/src/sql/Pg/070.schema.container.sql
Log:
codify bucket types

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2008-12-03 19:58:16 UTC (rev 11392)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2008-12-03 21:39:47 UTC (rev 11393)
@@ -616,6 +616,82 @@
         </permacrud>
 	</class>
 
+	<class id="ccpbt" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
+		<fields oils_persist:primary="code">
+			<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="Code" name="code" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
+			<field reporter:label="Label" name="label" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+		</fields>
+		<links/>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="CREATE_COPY_BTYPE" global_required="true"/>
+                <retrieve permission="CREATE_COPY_BTYPE|UPDATE_COPY_BTYPE|DELETE_COPY_BTYPE" global_required="true"/>
+                <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
+                <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
+            </actions>
+        </permacrud>
+	</class>
+
+	<class id="ccnbt" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
+		<fields oils_persist:primary="code">
+			<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="Code" name="code" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
+			<field reporter:label="Label" name="label" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+		</fields>
+		<links/>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="CREATE_CN_BTYPE" global_required="true"/>
+                <retrieve permission="CREATE_CN_BTYPE|UPDATE_CN_BTYPE|DELETE_CN_BTYPE" global_required="true"/>
+                <update permission="UPDATE_CN_BTYPE" global_required="true"/>
+                <delete permission="DELETE_CN_BTYPE" global_required="true"/>
+            </actions>
+        </permacrud>
+	</class>
+
+	<class id="cbrebt" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
+		<fields oils_persist:primary="code">
+			<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="Code" name="code" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
+			<field reporter:label="Label" name="label" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+		</fields>
+		<links/>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="CREATE_BIB_BTYPE" global_required="true"/>
+                <retrieve permission="CREATE_BIB_BTYPE|UPDATE_BIB_BTYPE|DELETE_BIB_BTYPE" global_required="true"/>
+                <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
+                <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
+            </actions>
+        </permacrud>
+	</class>
+
+	<class id="cubt" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
+		<fields oils_persist:primary="code">
+			<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="Code" name="code" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
+			<field reporter:label="Label" name="label" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+		</fields>
+		<links/>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="CREATE_USER_BTYPE" global_required="true"/>
+                <retrieve permission="CREATE_USER_BTYPE|UPDATE_USER_BTYPE|DELETE_USER_BTYPE" global_required="true"/>
+                <update permission="UPDATE_USER_BTYPE" global_required="true"/>
+                <delete permission="DELETE_USER_BTYPE" global_required="true"/>
+            </actions>
+        </permacrud>
+	</class>
+
 	<class id="cvrfm" controller="open-ils.cstore" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
 		<fields oils_persist:primary="code">
 			<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />

Modified: trunk/Open-ILS/src/sql/Pg/070.schema.container.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/070.schema.container.sql	2008-12-03 19:58:16 UTC (rev 11392)
+++ trunk/Open-ILS/src/sql/Pg/070.schema.container.sql	2008-12-03 21:39:47 UTC (rev 11393)
@@ -20,6 +20,13 @@
 BEGIN;
 CREATE SCHEMA container;
 
+CREATE TABLE container.copy_bucket_type (
+	code	TEXT	PRIMARY KEY,
+	label	TEXT	NOT NULL UNIQUE
+);
+INSERT INTO container.copy_bucket_type (code,label) VALUES ('misc','Miscellaneous');
+INSERT INTO container.copy_bucket_type (code,label) VALUES ('staff_client','General Staff Client container');
+
 CREATE TABLE container.copy_bucket (
 	id		SERIAL				PRIMARY KEY,
 	owner		INT				NOT NULL
@@ -29,7 +36,7 @@
 								DEFERRABLE
 								INITIALLY DEFERRED,
 	name		TEXT				NOT NULL,
-	btype		TEXT				NOT NULL DEFAULT 'misc',
+	btype		TEXT				NOT NULL DEFAULT 'misc' REFERENCES container.copy_bucket_type (code),
 	pub		BOOL				NOT NULL DEFAULT FALSE,
 	create_time	TIMESTAMP WITH TIME ZONE	NOT NULL DEFAULT NOW(),
 	CONSTRAINT cb_name_once_per_owner UNIQUE (owner,name,btype)
@@ -55,6 +62,12 @@
 
 
 
+CREATE TABLE container.call_number_bucket_type (
+	code	TEXT	PRIMARY KEY,
+	label	TEXT	NOT NULL UNIQUE
+);
+INSERT INTO container.call_number_bucket_type (code,label) VALUES ('misc','Miscellaneous');
+
 CREATE TABLE container.call_number_bucket (
 	id	SERIAL	PRIMARY KEY,
 	owner	INT	NOT NULL
@@ -64,7 +77,7 @@
 				DEFERRABLE
 				INITIALLY DEFERRED,
 	name	TEXT	NOT NULL,
-	btype	TEXT	NOT NULL DEFAULT 'misc',
+	btype	TEXT	NOT NULL DEFAULT 'misc' REFERENCES container.call_number_bucket_type (code),
 	pub	BOOL	NOT NULL DEFAULT FALSE,
 	create_time	TIMESTAMP WITH TIME ZONE	NOT NULL DEFAULT NOW(),
 	CONSTRAINT cnb_name_once_per_owner UNIQUE (owner,name,btype)
@@ -89,7 +102,15 @@
 
 
 
+CREATE TABLE container.biblio_record_entry_bucket_type (
+	code	TEXT	PRIMARY KEY,
+	label	TEXT	NOT NULL UNIQUE
+);
+INSERT INTO container.biblio_record_entry_bucket_type (code,label) VALUES ('misc','Miscellaneous');
+INSERT INTO container.biblio_record_entry_bucket_type (code,label) VALUES ('staff_client','General Staff Client container');
+INSERT INTO container.biblio_record_entry_bucket_type (code,label) VALUES ('bookbag','Book Bag');
 
+
 CREATE TABLE container.biblio_record_entry_bucket (
 	id	SERIAL	PRIMARY KEY,
 	owner	INT	NOT NULL
@@ -99,7 +120,7 @@
 				DEFERRABLE
 				INITIALLY DEFERRED,
 	name	TEXT	NOT NULL,
-	btype	TEXT	NOT NULL DEFAULT 'misc',
+	btype	TEXT	NOT NULL DEFAULT 'misc' REFERENCES container.biblio_record_entry_bucket_type (code),
 	pub	BOOL	NOT NULL DEFAULT FALSE,
 	create_time	TIMESTAMP WITH TIME ZONE	NOT NULL DEFAULT NOW(),
 	CONSTRAINT breb_name_once_per_owner UNIQUE (owner,name,btype)
@@ -124,6 +145,14 @@
 
 
 
+CREATE TABLE container.user_bucket_type (
+	code	TEXT	PRIMARY KEY,
+	label	TEXT	NOT NULL UNIQUE
+);
+INSERT INTO container.user_bucket_type (code,label) VALUES ('misc','Miscellaneous');
+INSERT INTO container.user_bucket_type (code,label) VALUES ('folks','Friends');
+INSERT INTO container.user_bucket_type (code,label) VALUES ('folks:pub_book_bags.view','List Published Book Bags');
+INSERT INTO container.user_bucket_type (code,label) VALUES ('folks:pub_book_bags.add','Add to Published Book Bags');
 
 CREATE TABLE container.user_bucket (
 	id	SERIAL	PRIMARY KEY,
@@ -134,7 +163,7 @@
 				DEFERRABLE
 				INITIALLY DEFERRED,
 	name	TEXT	NOT NULL,
-	btype	TEXT	NOT NULL DEFAULT 'misc',
+	btype	TEXT	NOT NULL DEFAULT 'misc' REFERENCES container.user_bucket_type (code),
 	pub	BOOL	NOT NULL DEFAULT FALSE,
 	create_time	TIMESTAMP WITH TIME ZONE	NOT NULL DEFAULT NOW(),
 	CONSTRAINT ub_name_once_per_owner UNIQUE (owner,name,btype)



More information about the open-ils-commits mailing list