apm_set_callback_proc (public)

 apm_set_callback_proc [ -version_id version_id ] \
    [ -package_key package_key ] -type type proc

Defined in packages/acs-tcl/tcl/apm-procs.tcl

Set the name of an APM Tcl procedure callback for a certain package version. Checks if the callback already exists and updates if it does. If version_id is not supplied the id of the currently enabled version of the package will be used.

Switches:
-version_id (optional)
-package_key (optional)
-type (required)
Parameters:
proc (required)
Author:
Peter Marklund
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm__test_callback_get_set apm__test_callback_get_set (test acs-tcl) apm_set_callback_proc apm_set_callback_proc test_apm__test_callback_get_set->apm_set_callback_proc test_apm__test_callback_invoke apm__test_callback_invoke (test acs-tcl) test_apm__test_callback_invoke->apm_set_callback_proc apm_assert_callback_type_supported apm_assert_callback_type_supported (public) apm_set_callback_proc->apm_assert_callback_type_supported apm_get_callback_proc apm_get_callback_proc (public) apm_set_callback_proc->apm_get_callback_proc apm_version_id_from_package_key apm_version_id_from_package_key (public) apm_set_callback_proc->apm_version_id_from_package_key db_dml db_dml (public) apm_set_callback_proc->db_dml apm_package_install_callbacks apm_package_install_callbacks (private) apm_package_install_callbacks->apm_set_callback_proc packages/acs-admin/www/apm/version-callback-add-edit.tcl packages/acs-admin/ www/apm/version-callback-add-edit.tcl packages/acs-admin/www/apm/version-callback-add-edit.tcl->apm_set_callback_proc

Testcases:
apm__test_callback_get_set, apm__test_callback_invoke
Source code:
    apm_assert_callback_type_supported $type

    if { $version_id eq "" } {
        if { $package_key eq "" } {
            error "apm_set_package_callback_proc: Invoked with both version_id and package_key empty. You must supply either of these"
        }

        set version_id [apm_version_id_from_package_key $package_key]
    }

    set current_proc [apm_get_callback_proc -type $type -version_id $version_id]

    if { $current_proc eq "" } {
        # We are adding
        db_dml insert_proc {}
    } else {
        # We are editing
        db_dml update_proc {}
    }
Generic XQL file:
<fullquery name="apm_set_callback_proc.insert_proc">
    <querytext>
        insert into apm_package_callbacks
          (version_id, type, proc)
        values (:version_id, :type, :proc)
    </querytext>
</fullquery>

<fullquery name="apm_set_callback_proc.update_proc">
    <querytext>
        update apm_package_callbacks
                set proc = :proc
        where version_id = :version_id
          and type = :type
    </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: