notification::display::get_urls (public)

 notification::display::get_urls -type type -object_id object_id \
    [ -return_url return_url ] [ -pretty_name pretty_name ] \
    [ -user_id user_id ]

Defined in packages/notifications/tcl/notification-display-procs.tcl

Get both subscribe_url and unsubscribe_url as a list. At most one of them will be set. Example:

    lassign [notification::display::get_urls  -type "my_notif_type"  -object_id $object_id  -pretty_name $title] subscribe_url unsubscribe_url
    

Switches:
-type
(required)
-object_id
(required)
-return_url
(optional)
-pretty_name
(optional)
-user_id
(optional)
Returns:
a Tcl list with two elements (subscribe_url, unsubscribe_url)

Partial Call Graph (max 5 caller/called nodes):
%3 ad_conn ad_conn (public) ad_return_url ad_return_url (public) apm_package_url_from_key apm_package_url_from_key (public) export_vars export_vars (public) notification::package_key notification::package_key (public) notification::display::get_urls notification::display::get_urls notification::display::get_urls->ad_conn notification::display::get_urls->ad_return_url notification::display::get_urls->apm_package_url_from_key notification::display::get_urls->export_vars notification::display::get_urls->notification::package_key

Testcases:
No testcase defined.
Source code:
    set root_path [apm_package_url_from_key [notification::package_key]]
    if { $root_path eq "" } {
        return [list {} {}]
    }
    set type_id [notification::type::get_type_id -short_name $type]

    if { $return_url eq "" } {
        set return_url [ad_return_url]
    }

    # Check if subscribed
    if {![info exists user_id]} {
        set user_id [ad_conn untrusted_user_id]
    }
    set request_id [notification::request::get_request_id  -type_id $type_id -object_id $object_id -user_id $user_id]


    if { $request_id eq "" } {
        return [list [export_vars -base "${root_path}request-new" { type_id object_id pretty_name return_url }] {}]
    } else {
        return [list {} [export_vars -base "${root_path}request-delete" { request_id return_url }]]
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: