Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-object-types-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-object-types-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-object-types-create.sql 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-object-types-create.sql 6 Oct 2001 16:30:30 -0000 1.2 @@ -3,7 +3,7 @@ 'ACS SC Contract', -- pretty_name 'ACS SC Contracts', -- pretty_plural 'acs_object', -- supertype - 'acs_sc_contract', -- table_name + 'acs_sc_contracts', -- table_name 'contract_id', -- id_column null, -- package_name 'f', -- abstract_p @@ -18,7 +18,7 @@ 'ACS SC Operation', -- pretty_name 'ACS SC Operations', -- pretty_plural 'acs_object', -- supertype - 'acs_sc_operation', -- table_name + 'acs_sc_operations', -- table_name 'operation_id', -- id_column null, -- package_name 'f', -- abstract_p @@ -32,11 +32,15 @@ 'ACS SC Implementation', -- pretty_name 'ACS SC Implementations', -- pretty_plural 'acs_object', -- supertype - 'acs_sc_impl', -- table_name + 'acs_sc_impls', -- table_name 'impl_id', -- id_column null, -- package_name 'f', -- abstract_p null, -- type_extension_table null -- name_method ); + + + + Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql 6 Oct 2001 16:30:30 -0000 1.2 @@ -15,7 +15,7 @@ null ); - insert into acs_sc_contract ( + insert into acs_sc_contracts ( contract_id, contract_name, contract_desc @@ -39,7 +39,7 @@ begin select contract_id into v_contract_id - from acs_sc_contract + from acs_sc_contracts where contract_name = p_contract_name; return v_contract_id; @@ -56,7 +56,7 @@ begin select contract_name into v_contract_name - from acs_sc_contract + from acs_sc_contracts where contract_id = p_contract_id; return v_contract_name; @@ -71,7 +71,7 @@ p_contract_id alias for $1; begin - delete from acs_sc_contract + delete from acs_sc_contracts where contract_id = p_contract_id; return 0; @@ -128,7 +128,7 @@ v_operation_outputtype_id := acs_sc_msg_type__get_id(p_operation_outputtype); - insert into acs_sc_operation ( + insert into acs_sc_operations ( contract_id, operation_id, contract_name, @@ -165,7 +165,7 @@ begin select operation_id into v_operation_id - from acs_sc_operation + from acs_sc_operations where contract_name = p_contract_name and operation_name = p_operation_name; @@ -181,7 +181,7 @@ p_operation_id alias for $1; begin - delete from acs_sc_operation + delete from acs_sc_operations where operation_id = p_operation_id; return 0; @@ -229,7 +229,7 @@ null ); - insert into acs_sc_impl ( + insert into acs_sc_impls ( impl_id, impl_name, impl_owner_name, @@ -256,7 +256,7 @@ begin select impl_id into v_impl_id - from acs_sc_impl + from acs_sc_impls where impl_name = p_impl_name and impl_contract_name = p_impl_contract_name; @@ -273,7 +273,7 @@ begin select impl_name into v_impl_name - from acs_sc_impl + from acs_sc_impls where impl_id = p_impl_id; return v_impl_name; @@ -289,7 +289,7 @@ p_impl_name alias for $2; begin - delete from acs_sc_impl + delete from acs_sc_impls where impl_contract_name = p_impl_contract_name and impl_name = p_impl_name; @@ -315,7 +315,7 @@ v_impl_id := acs_sc_impl__get_id(p_impl_contract_name,p_impl_name); - insert into acs_sc_impl_alias ( + insert into acs_sc_impl_aliases ( impl_id, impl_name, impl_contract_name, @@ -349,7 +349,7 @@ v_impl_id := acs_sc_impl__get_id(p_impl_name); - delete from acs_sc_impl_alias + delete from acs_sc_impl_aliases where impl_contract_name = p_impl_contract_name and impl_name = p_impl_name and impl_operation_name = p_impl_operation_name; @@ -374,18 +374,18 @@ v_impl_name := acs_sc_impl__get_name(p_impl_id); select count(*) into v_count - from acs_sc_operation + from acs_sc_operations where contract_id = p_contract_id and operation_name not in (select impl_operation_name - from acs_sc_impl_alias + from acs_sc_impl_aliases where impl_contract_name = v_contract_name and impl_id = p_impl_id); if v_count > 0 then raise exception ''Binding of % to % failed.'', v_contract_name, v_impl_name; end if; - insert into acs_sc_binding ( + insert into acs_sc_bindings ( contract_id, impl_id ) values ( @@ -427,7 +427,7 @@ p_impl_id alias for $2; begin - delete from acs_sc_binding + delete from acs_sc_bindings where contract_id = p_contract_id and impl_id = p_impl_id; @@ -471,7 +471,7 @@ v_impl_id := acs_sc_impl__get_id(p_contract_name,p_impl_name); select case when count(*)=0 then 0 else 1 end into v_exists_p - from acs_sc_binding + from acs_sc_bindings where contract_id = v_contract_id and impl_id = v_impl_id; Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-create.sql 26 Sep 2001 21:01:35 -0000 1.2 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-create.sql 6 Oct 2001 16:30:30 -0000 1.3 @@ -1,58 +1,58 @@ -create table acs_sc_contract ( +create table acs_sc_contracts ( contract_id integer - constraint acs_sc_contract_id_fk + constraint acs_sc_contracts_id_fk references acs_objects(object_id) on delete cascade - constraint acs_sc_contract_pk + constraint acs_sc_contracts_pk primary key, contract_name varchar(1000) - constraint acs_sc_contract_name_nn + constraint acs_sc_contracts_name_nn not null - constraint acs_sc_contract_name_un + constraint acs_sc_contracts_name_un unique, contract_desc text - constraint acs_sc_contract_desc_nn + constraint acs_sc_contracts_desc_nn not null ); -create table acs_sc_operation ( +create table acs_sc_operations ( contract_id integer - constraint acs_sc_operation_cid_fk + constraint acs_sc_operations_cid_fk references acs_sc_contract(contract_id) on delete cascade, operation_id integer - constraint acs_sc_operation_opid_fk + constraint acs_sc_operations_opid_fk references acs_objects(object_id) on delete cascade - constraint acs_sc_operation_pk + constraint acs_sc_operations_pk primary key, contract_name varchar(1000), operation_name varchar(100), operation_desc text - constraint acs_sc_operation_desc_nn + constraint acs_sc_operations_desc_nn not null, operation_iscachable_p boolean, operation_nargs integer, operation_inputtype_id integer - constraint acs_sc_operation_intype_fk + constraint acs_sc_operations_intype_fk references acs_sc_msg_types(msg_type_id), operation_outputtype_id integer - constraint acs_sc_operation_outtype_fk + constraint acs_sc_operations_outtype_fk references acs_sc_msg_types(msg_type_id) ); -create table acs_sc_impl ( +create table acs_sc_impls ( impl_id integer - constraint acs_sc_impl_impl_id_fk + constraint acs_sc_impls_impl_id_fk references acs_objects(object_id) on delete cascade - constraint acs_sc_impl_pk + constraint acs_sc_impls_pk primary key, impl_name varchar(100), impl_owner_name varchar(1000), @@ -61,7 +61,7 @@ -create table acs_sc_impl_alias ( +create table acs_sc_impl_aliases ( impl_id integer constraint acs_sc_impl_proc_impl_id_fk references acs_sc_impl(impl_id) @@ -76,13 +76,13 @@ -create table acs_sc_binding ( +create table acs_sc_bindings ( contract_id integer - constraint acs_sc_binding_cid_fk + constraint acs_sc_bindings_cid_fk references acs_sc_contract(contract_id) on delete cascade, impl_id integer - constraint acs_sc_binding_impl_id_fk + constraint acs_sc_bindings_impl_id_fk references acs_sc_impl(impl_id) on delete cascade ); Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-drop.sql 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-tables-drop.sql 6 Oct 2001 16:30:30 -0000 1.2 @@ -1,5 +1,5 @@ -drop table acs_sc_binding; -drop table acs_sc_impl_alias; -drop table acs_sc_impl; -drop table acs_sc_operation; -drop table acs_sc_contract; +drop table acs_sc_bindings; +drop table acs_sc_impl_aliases; +drop table acs_sc_impls; +drop table acs_sc_operations; +drop table acs_sc_contracts; Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-create.sql 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-create.sql 6 Oct 2001 16:30:30 -0000 1.2 @@ -1,46 +1,46 @@ -create view valid_uninstalled_binding as +create view valid_uninstalled_bindings as select c.contract_id, c.contract_name, i.impl_id, i.impl_name - from acs_sc_contract c, acs_sc_impl i + from acs_sc_contracts c, acs_sc_impls i where c.contract_name = i.impl_contract_name and not exists (select 1 - from acs_sc_binding b + from acs_sc_bindings b where b.contract_id = c.contract_id and b.impl_id = i.impl_id) and not exists (select 1 - from acs_sc_operation o + from acs_sc_operations o where o.contract_id = c.contract_id and not exists (select 1 - from acs_sc_impl_alias a + from acs_sc_impl_aliases a where a.impl_contract_name = c.contract_name and a.impl_id = i.impl_id and a.impl_operation_name = o.operation_name)); -create view invalid_uninstalled_binding as +create view invalid_uninstalled_bindings as select c.contract_id, c.contract_name, i.impl_id, i.impl_name - from acs_sc_contract c, acs_sc_impl i + from acs_sc_contracts c, acs_sc_impls i where c.contract_name = i.impl_contract_name and not exists (select 1 - from acs_sc_binding b + from acs_sc_bindings b where b.contract_id = c.contract_id and b.impl_id = i.impl_id) and exists (select 1 - from acs_sc_operation o + from acs_sc_operations o where o.contract_id = c.contract_id and not exists (select 1 - from acs_sc_impl_alias a + from acs_sc_impl_aliases a where a.impl_contract_name = c.contract_name and a.impl_id = i.impl_id and a.impl_operation_name = o.operation_name)); -create view orphan_implementation as +create view orphan_implementations as select i.impl_id, i.impl_name, i.impl_contract_name - from acs_sc_impl i + from acs_sc_impls i where not exists (select 1 - from acs_sc_binding b + from acs_sc_bindings b where b.impl_id = i.impl_id) and not exists (select 1 - from acs_sc_contract c + from acs_sc_contracts c where c.contract_name = i.impl_contract_name); \ No newline at end of file Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-drop.sql 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-drop.sql 6 Oct 2001 16:30:30 -0000 1.2 @@ -1,3 +1,3 @@ -drop view orphan_implementation; -drop view invalid_uninstalled_binding; -drop view valid_uninstalled_binding; \ No newline at end of file +drop view orphan_implementations; +drop view invalid_uninstalled_bindings; +drop view valid_uninstalled_bindings; \ No newline at end of file Index: openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl 6 Oct 2001 16:30:30 -0000 1.2 @@ -4,7 +4,7 @@ impl_contract_name, impl_operation_name, impl_name - from acs_sc_impl_alias + from acs_sc_impl_aliases } { set binding_exists_p [db_exec_plsql binding_exists_p {select acs_sc_binding__exists_p(:impl_contract_name,:impl_name)}] Index: openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 30 Sep 2001 06:59:15 -0000 1.4 +++ openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 6 Oct 2001 16:30:30 -0000 1.5 @@ -41,7 +41,7 @@ db_0or1row get_alias { select impl_alias, impl_pl - from acs_sc_impl_alias + from acs_sc_impl_aliases where impl_contract_name = :contract and impl_operation_name = :operation and impl_name = :impl @@ -82,7 +82,7 @@ operation_nargs, operation_inputtype_id, operation_outputtype_id - from acs_sc_operation + from acs_sc_operations where contract_name = :contract and operation_name = :operation } Index: openacs-4/packages/acs-service-contract/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/www/index.tcl 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/www/index.tcl 6 Oct 2001 16:30:30 -0000 1.2 @@ -8,23 +8,24 @@ acs_sc_contract__get_name(contract_id) as contract_name, acs_sc_impl__get_name(impl_id) as impl_name from - acs_sc_binding + acs_sc_bindings } db_multirow valid_uninstalled_binding valid_uninstalled_binding { select contract_id, contract_name, impl_name,impl_id - from valid_uninstalled_binding; + from valid_uninstalled_bindings; } db_multirow invalid_uninstalled_binding invalid_uninstalled_binding { select contract_id, contract_name, impl_name,impl_id - from invalid_uninstalled_binding; + from invalid_uninstalled_bindings; } db_multirow orphan_implementation orphan_implementation { select impl_id, impl_name, impl_contract_name - from orphan_implementation -} \ No newline at end of file + from orphan_implementations +} +