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.5 -r1.5.2.1 --- openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl 11 Dec 2003 21:39:54 -0000 1.5 +++ openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl 16 Apr 2004 14:40:10 -0000 1.5.2.1 @@ -1,19 +1,14 @@ - +# Loop over actual bindings, finding every impl alias for each contract operation db_foreach impl_operation { - select - impl_contract_name, - impl_operation_name, - impl_name - from acs_sc_impl_aliases + select ia.impl_contract_name, + ia.impl_operation_name, + ia.impl_name, + ia.impl_alias, + ia.impl_pl + from acs_sc_bindings b, + acs_sc_impl_aliases ia + where ia.impl_id = b.impl_id } { - - acs_sc_log SCDebug "ACS_SC_PROC: checking binding exists for contract $impl_contract_name impl $impl_name" - - set binding_exists_p [db_string binding_exists_p {*SQL*}] - - if $binding_exists_p { - acs_sc_proc $impl_contract_name $impl_operation_name $impl_name - } else { - acs_sc_log SCDebug "ACS_SC_PROC: binding not found for contract $impl_contract_name impl $impl_name" - } + # This creates the AcsSc.Contract.Operation.Impl wrapper proc for this implementation + acs_sc_proc $impl_contract_name $impl_operation_name $impl_name $impl_alias $impl_pl } 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.21 -r1.21.2.1 --- openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 26 Jan 2004 15:39:46 -0000 1.21 +++ openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 16 Apr 2004 14:40:10 -0000 1.21.2.1 @@ -125,23 +125,27 @@ contract operation impl + {impl_alias {}} + {impl_pl {}} } { Builds the proc used by acs_sc_call, generally only called in acs-service-contract-init.tcl at startup. @return 0 on failure, 1 on success. @author Neophytos Demetriou } { - set arguments [list] set docblock {} set proc_name [acs_sc_generate_name $contract $impl $operation] acs_sc_log SCDebug "ACS_SC_PROC: proc_name = $proc_name" - foreach {impl_alias impl_pl} [acs_sc_get_alias $contract $operation $impl] break + + if { [empty_string_p $impl_alias] } { + foreach {impl_alias impl_pl} [acs_sc_get_alias $contract $operation $impl] break + } - if ![info exists impl_alias] { + if { [empty_string_p $impl_alias] } { error "ACS-SC: Cannot find alias for $proc_name" } @@ -270,7 +274,7 @@ # Private logging proc proc acs_sc_log {level msg} { # If you want to debug the SC, uncomment the Debug log below - if {![string equal "SCDebug" $level]} { + if { ![string equal "SCDebug" $level] } { ns_log $level "$msg" } else { # ns_log Debug "$msg"