Index: openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-views-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-views-create.sql 15 Feb 2002 14:55:19 -0000 1.3 +++ openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-views-create.sql 16 Sep 2003 08:29:58 -0000 1.4 @@ -1,7 +1,7 @@ -- $Id$ create or replace view valid_uninstalled_bindings as - select c.contract_id, c.contract_name, i.impl_id, i.impl_name + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name from acs_sc_contracts c, acs_sc_impls i where c.contract_name = i.impl_contract_name and not exists (select 1 @@ -20,7 +20,7 @@ create or replace view invalid_uninstalled_bindings as - select c.contract_id, c.contract_name, i.impl_id, i.impl_name + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name from acs_sc_contracts c, acs_sc_impls i where c.contract_name = i.impl_contract_name and not exists (select 1 @@ -38,7 +38,7 @@ create or replace view orphan_implementations as - select i.impl_id, i.impl_name, i.impl_contract_name + select i.impl_id, i.impl_name, i.impl_contract_name, i.impl_owner_name, i.impl_pretty_name from acs_sc_impls i where not exists (select 1 from acs_sc_bindings b Index: openacs-4/packages/acs-service-contract/sql/oracle/upgrade/upgrade-4.7d2-4.7d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/oracle/upgrade/upgrade-4.7d2-4.7d3.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/sql/oracle/upgrade/upgrade-4.7d2-4.7d3.sql 11 Sep 2003 08:58:22 -0000 1.2 +++ openacs-4/packages/acs-service-contract/sql/oracle/upgrade/upgrade-4.7d2-4.7d3.sql 16 Sep 2003 08:29:59 -0000 1.3 @@ -7,6 +7,8 @@ -- add column impl_pretty_name alter table acs_sc_impls add impl_pretty_name varchar2(200); +update acs_sc_impls set impl_pretty_name = impl_name; + create or replace package acs_sc_impl as @@ -66,6 +68,10 @@ begin v_impl_id := acs_object.new (object_type => 'acs_sc_implementation'); + if impl_pretty_name is null theen + impl_pretty_name := impl_name; + end if; + insert into acs_sc_impls ( impl_id, impl_name, @@ -179,3 +185,51 @@ end acs_sc_impl; / show errors + + +create or replace view valid_uninstalled_bindings as + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name + 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_bindings b + where b.contract_id = c.contract_id + and b.impl_id = i.impl_id) + and not exists (select 1 + from acs_sc_operations o + where o.contract_id = c.contract_id + and not exists (select 1 + 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 or replace view invalid_uninstalled_bindings as + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name + 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_bindings b + where b.contract_id = c.contract_id + and b.impl_id = i.impl_id) + and exists (select 1 + from acs_sc_operations o + where o.contract_id = c.contract_id + and not exists (select 1 + 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 or replace view orphan_implementations as + select i.impl_id, i.impl_name, i.impl_contract_name, i.impl_owner_name, i.impl_pretty_name + from acs_sc_impls i + where not exists (select 1 + from acs_sc_bindings b + where b.impl_id = i.impl_id) + and not exists (select 1 + from acs_sc_contracts c + where c.contract_name = i.impl_contract_name); 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.8 -r1.9 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql 11 Sep 2003 09:12:17 -0000 1.8 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql 16 Sep 2003 08:29:59 -0000 1.9 @@ -259,7 +259,7 @@ v_impl_id := acs_sc_impl__new( p_impl_contract_name, p_impl_name, - null, + p_impl_name, p_impl_owner_name ); 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.2 -r1.3 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-create.sql 6 Oct 2001 16:30:30 -0000 1.2 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-views-create.sql 16 Sep 2003 08:29:59 -0000 1.3 @@ -1,46 +1,45 @@ -create view valid_uninstalled_bindings as - select c.contract_id, c.contract_name, i.impl_id, i.impl_name + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name 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_bindings b - where b.contract_id = c.contract_id - and b.impl_id = i.impl_id) + 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_operations o - where o.contract_id = c.contract_id - and not exists (select 1 - 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)); + from acs_sc_operations o + where o.contract_id = c.contract_id + and not exists (select 1 + 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_bindings as - select c.contract_id, c.contract_name, i.impl_id, i.impl_name + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name 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_bindings b - where b.contract_id = c.contract_id - and b.impl_id = i.impl_id) + 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_operations o - where o.contract_id = c.contract_id - and not exists (select 1 - 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)); + from acs_sc_operations o + where o.contract_id = c.contract_id + and not exists (select 1 + 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_implementations as - select i.impl_id, i.impl_name, i.impl_contract_name + select i.impl_id, i.impl_name, i.impl_owner_name, i.impl_contract_name, i.impl_pretty_name from acs_sc_impls i where not exists (select 1 - from acs_sc_bindings b - where b.impl_id = i.impl_id) + from acs_sc_bindings b + where b.impl_id = i.impl_id) and not exists (select 1 - from acs_sc_contracts c - where c.contract_name = i.impl_contract_name); \ No newline at end of file + from acs_sc_contracts c + where c.contract_name = i.impl_contract_name); Index: openacs-4/packages/acs-service-contract/sql/postgresql/upgrade/upgrade-4.7d2-4.7d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/upgrade/upgrade-4.7d2-4.7d3.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/sql/postgresql/upgrade/upgrade-4.7d2-4.7d3.sql 10 Sep 2003 14:53:06 -0000 1.1 +++ openacs-4/packages/acs-service-contract/sql/postgresql/upgrade/upgrade-4.7d2-4.7d3.sql 16 Sep 2003 08:29:59 -0000 1.2 @@ -7,6 +7,8 @@ -- add column impl_pretty_name alter table acs_sc_impls add column impl_pretty_name varchar(200); +update acs_sc_impls set impl_pretty_name = impl_name; + create or replace function acs_sc_impl__new(varchar,varchar,varchar,varchar) returns integer as ' declare @@ -43,3 +45,54 @@ return v_impl_id; end;' language 'plpgsql'; + + +drop view valid_uninstalled_bindings; +create view valid_uninstalled_bindings as + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name + 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_bindings b + where b.contract_id = c.contract_id + and b.impl_id = i.impl_id) + and not exists (select 1 + from acs_sc_operations o + where o.contract_id = c.contract_id + and not exists (select 1 + 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)); + + + +drop view invalid_uninstalled_bindings; +create view invalid_uninstalled_bindings as + select c.contract_id, c.contract_name, i.impl_id, i.impl_name, i.impl_owner_name, i.impl_pretty_name + 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_bindings b + where b.contract_id = c.contract_id + and b.impl_id = i.impl_id) + and exists (select 1 + from acs_sc_operations o + where o.contract_id = c.contract_id + and not exists (select 1 + 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)); + + +drop view orphan_implementations; +create view orphan_implementations as + select i.impl_id, i.impl_name, i.impl_owner_name, i.impl_contract_name, i.impl_pretty_name + from acs_sc_impls i + where not exists (select 1 + from acs_sc_bindings b + where b.impl_id = i.impl_id) + and not exists (select 1 + from acs_sc_contracts c + where c.contract_name = i.impl_contract_name); Index: openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl 12 Sep 2003 12:28:20 -0000 1.6 +++ openacs-4/packages/acs-service-contract/tcl/implementation-procs.tcl 16 Sep 2003 08:29:59 -0000 1.7 @@ -162,12 +162,18 @@ @author Peter Marklund } { set full_list [db_list_of_lists select_impl_options { - select impl_name, + select case when impl_pretty_name != '' then impl_pretty_name else impl_name end as impl_name, impl_id from acs_sc_impls where impl_contract_name = :contract_name }] + set impl_list [list] + + if { ![empty_string_p $empty_label] } { + lappend impl_list [list $empty_label ""] + } + if { [llength $exclude_names] > 0 } { # There are exclude names foreach element $full_list { @@ -179,13 +185,9 @@ } } else { # No exclude names, use all options - set impl_list $full_list + set impl_list [concat $impl_list $full_list] } - if { ![empty_string_p $empty_label] } { - lappend impl_list [list $empty_label ""] - } - return $impl_list } Index: openacs-4/packages/acs-service-contract/www/contract-display-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/contract-display-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/www/contract-display-oracle.xql 17 May 2003 09:56:59 -0000 1.2 +++ openacs-4/packages/acs-service-contract/www/contract-display-oracle.xql 16 Sep 2003 08:30:00 -0000 1.3 @@ -9,7 +9,8 @@ b.contract_id, b.impl_id, acs_sc_impl.get_name(b.impl_id) as impl_name, - impl.impl_owner_name + impl.impl_owner_name, + impl.impl_pretty_name from acs_sc_bindings b, acs_sc_impls impl Index: openacs-4/packages/acs-service-contract/www/contract-display-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/contract-display-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/www/contract-display-postgresql.xql 17 May 2003 09:56:59 -0000 1.2 +++ openacs-4/packages/acs-service-contract/www/contract-display-postgresql.xql 16 Sep 2003 08:30:00 -0000 1.3 @@ -9,7 +9,8 @@ b.contract_id, b.impl_id, acs_sc_impl__get_name(b.impl_id) as impl_name, - impl.impl_owner_name + impl.impl_owner_name, + impl.impl_pretty_name from acs_sc_bindings b, acs_sc_impls impl Index: openacs-4/packages/acs-service-contract/www/contract-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/contract-display.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-service-contract/www/contract-display.adp 22 May 2003 14:06:49 -0000 1.4 +++ openacs-4/packages/acs-service-contract/www/contract-display.adp 16 Sep 2003 08:30:00 -0000 1.5 @@ -1,6 +1,6 @@ - contract @contract_name;noquote@ - "one contract" + Contract @contract_name;noquote@ + {@contract_name;noquote@}