acs_sc::invoke (public)
acs_sc::invoke [ -contract contract ] -operation operation \ [ -impl impl ] [ -impl_id impl_id ] [ -call_args call_args ] \ [ -error ]
Defined in packages/acs-service-contract/tcl/acs-service-contract-procs.tcl
A replacement of the former acs_sc_call procedure. One must supply either contract and impl, or just impl_id. If you supply impl_id and contract, we throw an error if the impl_id's contract doesn't match the contract you passed in. If you supply both impl_id and impl, we throw an error. Additional documentation and commentary at http://openacs.org/forums/message-view?message_id=108614.
- Switches:
- -contract (optional)
- The name of the contract you wish to use.
- -operation (required)
- The name of the operation in the contract you wish to call.
- -impl (optional)
- The name of the implementation you wish to use.
- -impl_id (optional)
- The ID of the implementation you wish to use.
- -call_args (optional)
- The arguments you want to pass to the proc.
- -error (optional, boolean)
- If specified, will throw an error if the operation isn't implemented.
- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- sync_http_get_document, sync_file_get_document
Source code: if { $impl_id ne "" } { if { $impl ne "" } { error "Cannot supply both impl and impl_id" } acs_sc::impl::get -impl_id $impl_id -array impl_info set impl $impl_info(impl_name) if { $contract ne "" && $contract ne $impl_info(impl_contract_name) } { error "The contract of implementation with id $impl_id does not match contract passed in. Expected contract to be '$contract', but contract of impl_id was '$impl_info(impl_contract_name)'" } set contract $impl_info(impl_contract_name) } if { $impl eq "" || $contract eq "" } { error "You must supply either impl_id, or contract and impl to acs_sc::invoke" } set proc_name [acs_sc_generate_name $contract $impl $operation] if { [namespace which $proc_name] ne "" } { # ns_log warning "CALL FORMER ad_apply [list $proc_name {*}$call_args]" # ns_log warning "$proc_name {*}$call_args" return [$proc_name {*}$call_args] } if { $error_p } { error "Operation $operation is not implemented in '$impl' implementation of contract '$contract'" } else { ns_log warning "ACS-SC: Function Not Found: $proc_name [namespace which $proc_name]" } returnXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-service-contract/tcl/acs-service-contract-procs.xql