subsite::callback (public)

 subsite::callback [ -object_type object_type ] event_type object_id

Defined in packages/acs-subsite/tcl/subsite-callback-procs.tcl

Executes any registered callbacks for this object.

Example:

    # Execute any callbacks registered for this object type or one of
    # its parent object types
    subsite::callback -object_type $object_type $object_id
    

Switches:
-object_type (optional)
The object's type. We look this up in the db if not specified
Parameters:
event_type
object_id
Author:
Michael Bryzek <mbryzek@arsdigita.com>
Created:
12/2000

Partial Call Graph (max 5 caller/called nodes):
%3 package_instantiate_object package_instantiate_object (public) subsite::callback subsite::callback package_instantiate_object->subsite::callback subsite_callback subsite_callback (public, deprecated) subsite_callback->subsite::callback ad_conn ad_conn (public) subsite::callback->ad_conn db_foreach db_foreach (public) subsite::callback->db_foreach

Testcases:
No testcase defined.
Source code:
    set node_id [ad_conn node_id]
    set package_id [ad_conn package_id]

    # Check to see if we have any callbacks registered for this object
    # type or one of its parent object types. Put the callbacks into
    # a list as each callback may itself require a database
    # handle. Note that we need the distinct in case two callbacks are
    # registered for an object and its parent object type.
    db_foreach get_callbacks {} {
        switch -- $type {
            tcl {
                # Execute the Tcl procedure
                $callback -object_id $object_id -node_id $node_id -package_id $package_id
            }
            default { error "Callbacks of type $type not supported" }
        }
    }
Generic XQL file:
packages/acs-subsite/tcl/subsite-callback-procs.xql

PostgreSQL XQL file:
<fullquery name="subsite::callback.get_callbacks">
    <querytext>
        with recursive object_hierarchy(object_type, supertype) as (
            select object_type, supertype
              from acs_object_types
             where object_type = coalesce(:object_type, (select object_type
                                                         from acs_objects
                                                         where object_id = :object_id))

            union all

            select t.object_type, t.supertype
            from acs_object_types t,
                 object_hierarchy s
            where t.object_type = s.supertype
        )
        select distinct callback, callback_type as type
          from subsite_callbacks
        where event_type = :event_type
          and object_type in (select object_type from object_hierarchy)
</querytext>
</fullquery>
packages/acs-subsite/tcl/subsite-callback-procs-postgresql.xql

Oracle XQL file:
<fullquery name="subsite::callback.get_callbacks">
    <querytext>
        with object_hierarchy(object_type, supertype) as (
            select object_type, supertype
              from acs_object_types
             where object_type = coalesce(:object_type, (select object_type
                                                         from acs_objects
                                                         where object_id = :object_id))

            union all

            select t.object_type, t.supertype
            from acs_object_types t,
                 object_hierarchy s
            where t.object_type = s.supertype
        )
        select distinct callback, callback_type as type
          from subsite_callbacks
        where event_type = :event_type
          and object_type in (select object_type from object_hierarchy)
</querytext>
</fullquery>
packages/acs-subsite/tcl/subsite-callback-procs-oracle.xql

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