callback-procs.tcl

Callback procs for Boomerang Library into OpenACS

Location:
packages/boomerang/tcl/callback-procs.tcl
Created:
2 Jan 2018
Author:
Gustaf Neumann
CVS Identification:
$Id: callback-procs.tcl,v 1.1.2.1 2020/02/09 15:26:10 gustafn Exp $

Procedures in this file

Detailed information

boomerang::after-install (private)

 boomerang::after-install

Partial Call Graph (max 5 caller/called nodes):
%3 apm_parameter_register apm_parameter_register (public) boomerang::after-install boomerang::after-install boomerang::after-install->apm_parameter_register

Testcases:
No testcase defined.

boomerang::before-uninstall (private)

 boomerang::before-uninstall

Partial Call Graph (max 5 caller/called nodes):
%3 apm_parameter_unregister apm_parameter_unregister (public) boomerang::before-uninstall boomerang::before-uninstall boomerang::before-uninstall->apm_parameter_unregister

Testcases:
No testcase defined.

callback::subsite::page_plugin::impl::boomerang (private)

 callback::subsite::page_plugin::impl::boomerang

Implementation of subsite::page_plugin for boomerang

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 boomerang::initialize_widget boomerang::initialize_widget (public) callback::subsite::page_plugin::impl::boomerang callback::subsite::page_plugin::impl::boomerang callback::subsite::page_plugin::impl::boomerang->boomerang::initialize_widget

Testcases:
No testcase defined.
[ hide source ] | [ make this the default ]

Content File Source

ad_library {

    Callback procs for Boomerang Library into OpenACS

    @author Gustaf Neumann
    @creation-date 2 Jan 2018
    @cvs-id $Id: callback-procs.tcl,v 1.1.2.1 2020/02/09 15:26:10 gustafn Exp $
}

namespace eval ::boomerang {

    #
    # Provide hooks for installing/uninstalling the package
    #
    ad_proc -private after-install {} {
        #
        # Add additional parameters to acs-subsite
        #
        foreach {name description default datatype} {
            "Enabled"
            "Enable/Disable Boomerang for this Subsite"
            "0" "number"

            "BeaconUrl"
            "URL for the Beacon. Either a relative URL for the subsite, or and absolute URL pointing to a different Server"
            "/boomerang_handler" "string"

            "Sample"
            "Integer greater or equal 1, indicating how many requests should be sampled (e.g. 10 means: sample every 10th request)"
            "1" "number"

        } {
            apm_parameter_register "Boomerang$name" \
                $description "acs-subsite" $default $datatype "Boomerang"
        }
    }

    ad_proc -private before-uninstall {} {
        #
        # Remove the package specific parameters from acs-subsite
        #
        foreach parameter {
            Enabled
            BeaconUrl
            Sample
        } {
            ns_log notice [list apm_parameter_unregister \
                               -parameter "Boomerang$parameter" \
                               -package_key "acs-subsite" \
                               "" ]
            ::try {
                apm_parameter_unregister \
                    -parameter "Boomerang$parameter" \
                    -package_key "acs-subsite" \
                    ""
            } on error {errMsg} {
                ns_log notice "apm_parameter_unregister of parameter Boomerang$parameter lead to: $errMsg"
            }
        }
    }


    #
    # Register a "page_plugin" callback for the subsite. In case, this
    # is used with an OpenACS version earlier than 5.10.0d2, this is
    # essentially no-op operation; the site admin has to add the
    # "::boomerang::initialize_widget" manually to the templates.
    #
    d_proc -public -callback subsite::page_plugin -impl boomerang {
    } {
        Implementation of subsite::page_plugin for boomerang
    } {
        ::boomerang::initialize_widget
    }

}

# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: