forum-reply-procs.tcl

Forums Library - Reply Handling

Location:
packages/forums/tcl/forum-reply-procs.tcl
Created:
2002-05-17
Author:
Ben Adida
CVS Identification:
$Id: forum-reply-procs.tcl,v 1.8.2.1 2023/03/20 13:58:12 antoniop Exp $

Procedures in this file

Detailed information

forum::notification::get_url (private)

 forum::notification::get_url object_id

Returns a full url to the object_id.
Handles messages and forums. This proc implements the GetURL operation of the NotificationType Service Contract and should not be invoked directly.

Parameters:
object_id

Partial Call Graph (max 5 caller/called nodes):
%3 AcsSc.notificationtype.geturl.forums_forum_moderator_notif_type AcsSc.notificationtype.geturl.forums_forum_moderator_notif_type (private) forum::notification::get_url forum::notification::get_url AcsSc.notificationtype.geturl.forums_forum_moderator_notif_type->forum::notification::get_url AcsSc.notificationtype.geturl.forums_forum_notif_type AcsSc.notificationtype.geturl.forums_forum_notif_type (private) AcsSc.notificationtype.geturl.forums_forum_notif_type->forum::notification::get_url AcsSc.notificationtype.geturl.forums_message_moderator_notif_type AcsSc.notificationtype.geturl.forums_message_moderator_notif_type (private) AcsSc.notificationtype.geturl.forums_message_moderator_notif_type->forum::notification::get_url AcsSc.notificationtype.geturl.forums_message_notif_type AcsSc.notificationtype.geturl.forums_message_notif_type (private) AcsSc.notificationtype.geturl.forums_message_notif_type->forum::notification::get_url ad_url ad_url (public) forum::notification::get_url->ad_url db_string db_string (public) forum::notification::get_url->db_string forum::message::get forum::message::get (public) forum::notification::get_url->forum::message::get

Testcases:
No testcase defined.

forum::notification::process_reply (private)

 forum::notification::process_reply reply_id

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

Parameters:
reply_id

Partial Call Graph (max 5 caller/called nodes):
%3 AcsSc.notificationtype.processreply.forums_forum_moderator_notif_type AcsSc.notificationtype.processreply.forums_forum_moderator_notif_type (private) forum::notification::process_reply forum::notification::process_reply AcsSc.notificationtype.processreply.forums_forum_moderator_notif_type->forum::notification::process_reply AcsSc.notificationtype.processreply.forums_forum_notif_type AcsSc.notificationtype.processreply.forums_forum_notif_type (private) AcsSc.notificationtype.processreply.forums_forum_notif_type->forum::notification::process_reply AcsSc.notificationtype.processreply.forums_message_moderator_notif_type AcsSc.notificationtype.processreply.forums_message_moderator_notif_type (private) AcsSc.notificationtype.processreply.forums_message_moderator_notif_type->forum::notification::process_reply AcsSc.notificationtype.processreply.forums_message_notif_type AcsSc.notificationtype.processreply.forums_message_notif_type (private) AcsSc.notificationtype.processreply.forums_message_notif_type->forum::notification::process_reply forum::message::get forum::message::get (public) forum::notification::process_reply->forum::message::get forum::message::new forum::message::new (public) forum::notification::process_reply->forum::message::new notification::reply::get notification::reply::get (public) forum::notification::process_reply->notification::reply::get

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

Content File Source

ad_library {

    Forums Library - Reply Handling

    @creation-date 2002-05-17
    @author Ben Adida <ben@openforce.biz>
    @cvs-id $Id: forum-reply-procs.tcl,v 1.8.2.1 2023/03/20 13:58:12 antoniop Exp $

}

namespace eval forum::notification {

    d_proc -private get_url {
        object_id
    } {
        Returns a full url to the object_id.<br>
        Handles messages and forums.

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

    set object_type [db_string select_object_type {}]

    if {$object_type eq "forums_message" } {

            # object is a message
        set message_id $object_id
        forum::message::get -message_id $message_id -array message
        set forum_id $message(forum_id)
        set forum_url "[ad_url][db_string select_forums_package_url {}]"
        return ${forum_url}message-view?message_id=$message(root_message_id)

    } else {

        # object_type is a forum
        set forum_id $object_id
        set forum_url "[ad_url][db_string select_forums_package_url {}]"      
        return ${forum_url}forum-view?forum_id=$forum_id

        }
    }

    d_proc -private process_reply {
        reply_id
    } {
        This proc implements the ProcessReply operation of the
        NotificationType Service Contract and should not be invoked
        directly.
    } {

        # Get the data
        notification::reply::get -reply_id $reply_id -array reply

    # get rid of Outlook HTML DOCTYPE
    set reply(content) [regsub {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4\.0 Transitional//EN">} $reply(content) {}]

        # Get the message information
        forum::message::get -message_id $reply(object_id) -array message
        # Insert the message
        forum::message::new -forum_id $message(forum_id) \
                -parent_id $message(message_id) \
                -subject $reply(subject) \
                -content $reply(content) \
                -user_id $reply(from_user)
    }
        
    
}




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