faq-procs.tcl

Faq Library - Reply Handling

Location:
packages/faq/tcl/faq-procs.tcl
Created:
2004-03-31
Authors:
Ben Adida
by Gerardo Morales

Procedures in this file

Detailed information

faq::get_instance_info (public)

 faq::get_instance_info -arrayname arrayname -faq_id faq_id

returns the name of the FAQ and whether to display questions and their answers all on the listing page or on separate pages

Switches:
-arrayname (required)
-faq_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_faq_create_and_retrieve faq_create_and_retrieve (test faq) faq::get_instance_info faq::get_instance_info test_faq_create_and_retrieve->faq::get_instance_info db_0or1row db_0or1row (public) faq::get_instance_info->db_0or1row packages/faq/www/categories/categorize.tcl packages/faq/ www/categories/categorize.tcl packages/faq/www/categories/categorize.tcl->faq::get_instance_info packages/faq/www/one-faq.tcl packages/faq/ www/one-faq.tcl packages/faq/www/one-faq.tcl->faq::get_instance_info

Testcases:
faq_create_and_retrieve

faq::new (public)

 faq::new [ -faq_id faq_id ] -faq_name faq_name [ -separate ] \
    [ -package_id package_id ] [ -user_id user_id ] \
    [ -creation_ip creation_ip ]

Creates a new FAQ.

Switches:
-faq_id (optional)
-faq_name (required)
-separate (optional, boolean)
-package_id (optional)
-user_id (optional)
-creation_ip (optional)
Returns:
integer faq_id

Partial Call Graph (max 5 caller/called nodes):
%3 test_faq_create_and_retrieve faq_create_and_retrieve (test faq) faq::new faq::new test_faq_create_and_retrieve->faq::new ad_conn ad_conn (public) faq::new->ad_conn db_exec_plsql db_exec_plsql (public) faq::new->db_exec_plsql db_nextval db_nextval (public) faq::new->db_nextval packages/faq/www/admin/faq-new-2.tcl packages/faq/ www/admin/faq-new-2.tcl packages/faq/www/admin/faq-new-2.tcl->faq::new

Testcases:
faq_create_and_retrieve

faq::notification::get_url (private)

 faq::notification::get_url object_id

This proc implements the GetURL operation of the NotificationType Service Contract and should not be invoked directly.

Parameters:
object_id (required)
Returns:
a full URL to the object_id (an FAQ entry)

Partial Call Graph (max 5 caller/called nodes):
%3 AcsSc.notificationtype.geturl.all_faq_qa_notif_type AcsSc.notificationtype.geturl.all_faq_qa_notif_type (private) faq::notification::get_url faq::notification::get_url AcsSc.notificationtype.geturl.all_faq_qa_notif_type->faq::notification::get_url AcsSc.notificationtype.geturl.one_faq_qa_notif_type AcsSc.notificationtype.geturl.one_faq_qa_notif_type (private) AcsSc.notificationtype.geturl.one_faq_qa_notif_type->faq::notification::get_url faq::notification_delivery::do_notification faq::notification_delivery::do_notification (private) faq::notification_delivery::do_notification->faq::notification::get_url ad_conn ad_conn (public) faq::notification::get_url->ad_conn ad_url ad_url (public) faq::notification::get_url->ad_url db_1row db_1row (public) faq::notification::get_url->db_1row

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

Content File Source

ad_library {

    Faq Library - Reply Handling

    @creation-date 2004-03-31
    @author Ben Adida <ben@openforce.biz>
    @author by Gerardo Morales <gmorales@galileo.edu>
}

namespace eval faq {

    d_proc -public get_instance_info {
        -arrayname:required
        -faq_id:required
    } {
        returns the name of the FAQ and whether to display
        questions and their answers all on the listing page
        or on separate pages
    } {
        upvar $arrayname faq_info
        db_0or1row get_info "" -column_array faq_info
    }

    d_proc -public new {
        -faq_id
        -faq_name:required
        -separate:boolean
        {-package_id ""}
        {-user_id ""}
        {-creation_ip ""}
    } {
        Creates a new FAQ.

        @return integer faq_id
    } {
        if {![info exists faq_id]} {
            set faq_id [db_nextval acs_object_id_seq]
        }

        if {[ns_conn isconnected]} {
            if {$package_id eq ""} {
                set package_id [ad_conn package_id]
            }
            if {$user_id eq ""} {
                set user_id [ad_conn user_id]
            }
            if {$creation_ip eq ""} {
                set creation_ip [ad_conn host]
            }
        }

        db_exec_plsql create_faq {}

        return $faq_id
    }

}

namespace eval faq::notification {

    d_proc -private get_url {
        object_id
    } {
        This proc implements the GetURL operation of the
        NotificationType Service Contract and should not be invoked
        directly.

        @return a full URL to the object_id (an FAQ entry)
    } {

        set q_and_a_id $object_id
        db_1row get_faq_id "*SQL*"
        set faq_url  "[ad_url][ad_conn package_url]"
        return ${faq_url}one-faq?faq_id=$faq_id

    }
}

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