apm-callback-procs.tcl

Procedures to do a new impl and aliases in the acs-sc.

Location:
packages/faq/tcl/apm-callback-procs.tcl
Created:
2004-04-06
Author:
Gerardo Morales Cadoret <gmorales@galileo.edu>

Procedures in this file

Detailed information

faq::apm_callback::create_all_faq_qa_impl (private)

 faq::apm_callback::create_all_faq_qa_impl

Register the service contract implementation and return the impl_id

Returns:
impl_id of the created implementation

Partial Call Graph (max 5 caller/called nodes):
%3 faq::apm_callback::package_install faq::apm_callback::package_install (private) faq::apm_callback::create_all_faq_qa_impl faq::apm_callback::create_all_faq_qa_impl faq::apm_callback::package_install->faq::apm_callback::create_all_faq_qa_impl acs_sc::impl::new_from_spec acs_sc::impl::new_from_spec (public) faq::apm_callback::create_all_faq_qa_impl->acs_sc::impl::new_from_spec

Testcases:
No testcase defined.

faq::apm_callback::create_all_faq_type (private)

 faq::apm_callback::create_all_faq_type impl_id

Create the notification type for one specific FAQ Q&A

Parameters:
impl_id (required)
Returns:
the type_id of the created type

Partial Call Graph (max 5 caller/called nodes):
%3 faq::apm_callback::package_install faq::apm_callback::package_install (private) faq::apm_callback::create_all_faq_type faq::apm_callback::create_all_faq_type faq::apm_callback::package_install->faq::apm_callback::create_all_faq_type notification::type::new notification::type::new (public) faq::apm_callback::create_all_faq_type->notification::type::new

Testcases:
No testcase defined.

faq::apm_callback::create_one_faq_qa_impl (private)

 faq::apm_callback::create_one_faq_qa_impl

Register the service contract implementation and return the impl_id

Returns:
impl_id of the created implementation

Partial Call Graph (max 5 caller/called nodes):
%3 faq::apm_callback::package_install faq::apm_callback::package_install (private) faq::apm_callback::create_one_faq_qa_impl faq::apm_callback::create_one_faq_qa_impl faq::apm_callback::package_install->faq::apm_callback::create_one_faq_qa_impl acs_sc::impl::new_from_spec acs_sc::impl::new_from_spec (public) faq::apm_callback::create_one_faq_qa_impl->acs_sc::impl::new_from_spec

Testcases:
No testcase defined.

faq::apm_callback::create_one_faq_type (private)

 faq::apm_callback::create_one_faq_type impl_id

Create the notification type for one specific FAQ Q&A

Parameters:
impl_id (required)
Returns:
the type_id of the created type

Partial Call Graph (max 5 caller/called nodes):
%3 faq::apm_callback::package_install faq::apm_callback::package_install (private) faq::apm_callback::create_one_faq_type faq::apm_callback::create_one_faq_type faq::apm_callback::package_install->faq::apm_callback::create_one_faq_type notification::type::new notification::type::new (public) faq::apm_callback::create_one_faq_type->notification::type::new

Testcases:
No testcase defined.

faq::apm_callback::delete_all_faq_impl (private)

 faq::apm_callback::delete_all_faq_impl

Unregister the NotificationType implementation for one_faq_qa_notif_type.

Partial Call Graph (max 5 caller/called nodes):
%3 faq::apm_callback::package_uninstall faq::apm_callback::package_uninstall (private) faq::apm_callback::delete_all_faq_impl faq::apm_callback::delete_all_faq_impl faq::apm_callback::package_uninstall->faq::apm_callback::delete_all_faq_impl acs_sc::impl::delete acs_sc::impl::delete (public) faq::apm_callback::delete_all_faq_impl->acs_sc::impl::delete

Testcases:
No testcase defined.

faq::apm_callback::delete_one_faq_impl (private)

 faq::apm_callback::delete_one_faq_impl

Unregister the NotificationType implementation for one_faq_qa_notif_type.

Partial Call Graph (max 5 caller/called nodes):
%3 faq::apm_callback::package_uninstall faq::apm_callback::package_uninstall (private) faq::apm_callback::delete_one_faq_impl faq::apm_callback::delete_one_faq_impl faq::apm_callback::package_uninstall->faq::apm_callback::delete_one_faq_impl acs_sc::impl::delete acs_sc::impl::delete (public) faq::apm_callback::delete_one_faq_impl->acs_sc::impl::delete

Testcases:
No testcase defined.

faq::apm_callback::enable_intervals_and_methods (private)

 faq::apm_callback::enable_intervals_and_methods type_id

Enable the intervals and delivery methods of a specific type

Parameters:
type_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 faq::apm_callback::package_install faq::apm_callback::package_install (private) faq::apm_callback::enable_intervals_and_methods faq::apm_callback::enable_intervals_and_methods faq::apm_callback::package_install->faq::apm_callback::enable_intervals_and_methods notification::delivery::get_id notification::delivery::get_id (public) faq::apm_callback::enable_intervals_and_methods->notification::delivery::get_id notification::interval::get_id_from_name notification::interval::get_id_from_name (public) faq::apm_callback::enable_intervals_and_methods->notification::interval::get_id_from_name notification::type::delivery_method_enable notification::type::delivery_method_enable (public) faq::apm_callback::enable_intervals_and_methods->notification::type::delivery_method_enable notification::type::interval_enable notification::type::interval_enable (public) faq::apm_callback::enable_intervals_and_methods->notification::type::interval_enable

Testcases:
No testcase defined.

faq::apm_callback::package_install (private)

 faq::apm_callback::package_install

Does the integration with the notifications package.

Partial Call Graph (max 5 caller/called nodes):
%3 faq::install::package_install faq::install::package_install (private) faq::apm_callback::package_install faq::apm_callback::package_install faq::install::package_install->faq::apm_callback::package_install faq::install::package_upgrade faq::install::package_upgrade (private) faq::install::package_upgrade->faq::apm_callback::package_install db_transaction db_transaction (public) faq::apm_callback::package_install->db_transaction faq::apm_callback::create_all_faq_qa_impl faq::apm_callback::create_all_faq_qa_impl (private) faq::apm_callback::package_install->faq::apm_callback::create_all_faq_qa_impl faq::apm_callback::create_all_faq_type faq::apm_callback::create_all_faq_type (private) faq::apm_callback::package_install->faq::apm_callback::create_all_faq_type faq::apm_callback::create_one_faq_qa_impl faq::apm_callback::create_one_faq_qa_impl (private) faq::apm_callback::package_install->faq::apm_callback::create_one_faq_qa_impl faq::apm_callback::create_one_faq_type faq::apm_callback::create_one_faq_type (private) faq::apm_callback::package_install->faq::apm_callback::create_one_faq_type

Testcases:
No testcase defined.

faq::apm_callback::package_uninstall (private)

 faq::apm_callback::package_uninstall

Remove the integration with the notification package

Partial Call Graph (max 5 caller/called nodes):
%3 faq::install::package_uninstall faq::install::package_uninstall (private) faq::apm_callback::package_uninstall faq::apm_callback::package_uninstall faq::install::package_uninstall->faq::apm_callback::package_uninstall db_transaction db_transaction (public) faq::apm_callback::package_uninstall->db_transaction faq::apm_callback::delete_all_faq_impl faq::apm_callback::delete_all_faq_impl (private) faq::apm_callback::package_uninstall->faq::apm_callback::delete_all_faq_impl faq::apm_callback::delete_one_faq_impl faq::apm_callback::delete_one_faq_impl (private) faq::apm_callback::package_uninstall->faq::apm_callback::delete_one_faq_impl notification::type::delete notification::type::delete (public) faq::apm_callback::package_uninstall->notification::type::delete

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

Content File Source

ad_library {

    Procedures to do a new impl and aliases in the acs-sc.
    @creation-date 2004-04-06
    @author Gerardo Morales Cadoret (gmorales@galileo.edu)
}

namespace eval faq::apm_callback {}

d_proc -private faq::apm_callback::package_install {
} {
    Does the integration with the notifications package.
} {
    db_transaction {

        # Create the impl and aliases for one faq Q&A
        set impl_id [create_one_faq_qa_impl]

        # Create the notification type for one specific FAQ
        set type_id [create_one_faq_type $impl_id]

        # Enable the delivery intervals and delivery methods for a specific FAQ
        enable_intervals_and_methods $type_id

        # Create the impl and aliases for all faqs Q&A
        set impl_id [create_all_faq_qa_impl]

        # Create the notification type for all FAQs
        set type_id [create_all_faq_type $impl_id]

        # Enable the delivery intervals and delivery methods for all FAQs
        enable_intervals_and_methods $type_id
    }
}

d_proc -private faq::apm_callback::package_uninstall {
} {
    Remove the integration with the notification package
} {

    db_transaction {

        # Delete the type_id for a specific FAQ
        notification::type::delete -short_name one_faq_qa_notif

        # Delete the implementation for the notification of a new Q&A of one specific FAQ
        delete_one_faq_impl

        # Delete the type_id foe all FAQs
        notification::type::delete -short_name all_faq_qa_notif

        # Delete the implementation for the notification of a new Q&A all Faqs
        delete_all_faq_impl

    }
}

ad_proc -private faq::apm_callback::delete_one_faq_impl {} {
    Unregister the NotificationType implementation for one_faq_qa_notif_type.
} {
    acs_sc::impl::delete \
        -contract_name "NotificationType" \
        -impl_name one_faq_qa_notif_type
}


ad_proc -private faq::apm_callback::delete_all_faq_impl {} {
    Unregister the NotificationType implementation for one_faq_qa_notif_type.
} {
    acs_sc::impl::delete \
        -contract_name "NotificationType" \
        -impl_name all_faq_qa_notif_type
}

ad_proc -private faq::apm_callback::create_one_faq_qa_impl {} {
    Register the service contract implementation and return the impl_id
    @return impl_id of the created implementation
} {
    return [acs_sc::impl::new_from_spec -spec {
        name one_faq_qa_notif_type
        contract_name NotificationType
        owner faq
        aliases {
            GetURL faq::notification::get_url
            ProcessReply faq::notification::process_reply
        }
    }]
}

ad_proc -private faq::apm_callback::create_one_faq_type {impl_id} {
    Create the notification type for one specific FAQ Q&A
    @return the type_id of the created type
} {
    return [notification::type::new \
        -sc_impl_id $impl_id \
        -short_name one_faq_qa_notif \
        -pretty_name "One FAQ Q&A" \
        -description "Notification of a new Q&A of one specific faq"]
}

ad_proc -private faq::apm_callback::enable_intervals_and_methods {type_id} {
    Enable the intervals and delivery methods of a specific type
} {
    # Enable the various intervals and delivery method
    notification::type::interval_enable \
        -type_id $type_id \
        -interval_id [notification::interval::get_id_from_name -name instant]

    notification::type::interval_enable \
        -type_id $type_id \
        -interval_id [notification::interval::get_id_from_name -name hourly]

    notification::type::interval_enable \
        -type_id $type_id \
        -interval_id [notification::interval::get_id_from_name -name daily]

        # Enable the delivery methods
    notification::type::delivery_method_enable \
        -type_id $type_id \
        -delivery_method_id [notification::delivery::get_id -short_name email]
}


ad_proc -private faq::apm_callback::create_all_faq_qa_impl {} {
    Register the service contract implementation and return the impl_id
    @return impl_id of the created implementation
} {
    return \
        [acs_sc::impl::new_from_spec -spec {
            name all_faq_qa_notif_type
            contract_name NotificationType
            owner faq
            aliases {
                GetURL faq::notification::get_url
                ProcessReply faq::notification::process_reply
            }
    }]

}

ad_proc -private faq::apm_callback::create_all_faq_type {impl_id} {
    Create the notification type for one specific FAQ Q&A
    @return the type_id of the created type
} {
    set type_id [notification::type::new \
        -sc_impl_id $impl_id \
        -short_name all_faq_qa_notif \
        -pretty_name "FAQ Q&A" \
        -description "Notification of a new Q&A of any faq"]
}

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