acs_sc_proc (private)
acs_sc_proc contract operation impl [ impl_alias ] [ impl_pl ]
Defined in packages/acs-service-contract/tcl/acs-service-contract-procs.tcl
Builds the proc used by acs_sc::invoke, generally only called in acs-service-contract-init.tcl at startup.
- Parameters:
- contract (required)
- operation (required)
- impl (required)
- impl_alias (optional)
- impl_pl (optional)
- Returns:
- 0 on failure, 1 on success.
- Author:
- Neophytos Demetriou
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: 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" if { $impl_alias eq "" } { lassign [acs_sc_get_alias $contract $operation $impl] impl_alias impl_pl } if { $impl_alias eq "" } { error "ACS-SC: Cannot find alias for $proc_name" } if {![db_0or1row get_operation_definition { select operation_desc, coalesce(operation_iscachable_p,'f') as operation_iscachable_p, operation_nargs, operation_inputtype_id, operation_outputtype_id from acs_sc_operations where contract_name = :contract and operation_name = :operation }]} { ns_log warning "ACS-SC: operation definition not found for contract $contract operation $operation" return 0 } append docblock "\n<b>acs-service-contract operation. Call via acs_sc::invoke.</b>\n\n$operation_desc\n\n" set msg_type_id $operation_inputtype_id db_foreach operation_msgtype_element {} { lappend arguments "$element_name" append docblock "\n@param $element_name $element_msg_type_name" if { $element_msg_type_isset_p } { append docblock " \[\]" } } set msg_type_id $operation_outputtype_id db_foreach operation_msgtype_element {} { append docblock "\n@return <b>$element_name</b> - $element_msg_type_name" if { $element_msg_type_isset_p } { append docblock " \[\]" } } append docblock "\n@see $impl_alias\n@see acs_sc::invoke" set full_statement [acs_sc_get_statement $impl_alias $impl_pl $arguments] if { $operation_iscachable_p } { set full_statement "util_memoize \"$full_statement\"" } #FIX ME: CALL BY NAME USING UPVAR set body "return \[$full_statement\]" set arguments [join $arguments] acs_sc_log SCDebug "ACS-SC: ad_proc $proc_name $arguments\n$docblock\n$body\n" d_proc -private $proc_name $arguments $docblock $body return 1XQL Not present: PostgreSQL, Oracle Generic XQL file: <fullquery name="acs_sc_proc.operation_msgtype_element"> <querytext> select element_name, (select msg_type_name from acs_sc_msg_types where msg_type_id = element_msg_type_id) as element_msg_type_name, element_msg_type_isset_p, element_pos from acs_sc_msg_type_elements where msg_type_id = :msg_type_id order by element_pos asc </querytext> </fullquery>packages/acs-service-contract/tcl/acs-service-contract-procs.xql