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.8 -r1.9 --- openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl 7 Aug 2017 23:47:57 -0000 1.8 +++ openacs-4/packages/acs-service-contract/tcl/acs-service-contract-init.tcl 4 Oct 2018 09:53:51 -0000 1.9 @@ -1,23 +1,16 @@ -# Loop over actual bindings, finding every impl alias for each contract operation -db_foreach impl_operation { - 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 -} { - # This creates the AcsSc.Contract.Operation.Impl wrapper proc for this implementation - if {[catch { - acs_sc_proc $impl_contract_name $impl_operation_name $impl_name $impl_alias $impl_pl - } errorMsg]} { - ns_log error "Service contract initialization failed, call was:\n\ - acs_sc_proc $impl_contract_name $impl_operation_name $impl_name $impl_alias $impl_pl" - } +ad_library { + + Server startup initialization code for creating service contract + alias wrappers. + + @author Gustaf Neumann + @creation-date 2018-10-04 } +ns_log notice "================== acs-service-contract INIT" + +acs_sc_update_alias_wrappers + # Local variables: # mode: tcl # tcl-indent-level: 4 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.32 -r1.33 --- openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 24 Jul 2018 19:12:29 -0000 1.32 +++ openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 4 Oct 2018 09:53:51 -0000 1.33 @@ -218,7 +218,41 @@ return 1 } +ad_proc acs_sc_update_alias_wrappers {} { + Loop over actual bindings, finding every impl alias for each contract operation + and adfine a "acs_sc_proc" for all of these. + +} { + db_foreach impl_operation { + 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 + } { + # + # Create the AcsSc.Contract.Operation.Impl wrapper proc for this implementation + # + if {[catch { + # + # Check, if the wrapper exists already + # + set proc_name [acs_sc_generate_name $impl_contract_name $impl_name $impl_operation_name] + if {[info commands ::$proc_name] eq ""} { + # + # Create it new. + # + acs_sc_proc $impl_contract_name $impl_operation_name $impl_name $impl_alias $impl_pl + } + } errorMsg]} { + ns_log error "Service contract initialization failed, call was:\n\ + acs_sc_proc $impl_contract_name $impl_operation_name $impl_name $impl_alias $impl_pl" + } + } +} ad_proc -private acs_sc_get_statement { impl_alias