• Publicity: Public Only All

site-node-object-map-procs.tcl

Portal Node Mappings

Location:
packages/acs-tcl/tcl/site-node-object-map-procs.tcl
Created:
April 2002
Author:
Ben Adida <ben@openforce.net>
CVS Identification:
$Id: site-node-object-map-procs.tcl,v 1.7 2024/09/11 06:15:48 gustafn Exp $

Procedures in this file

Detailed information

site_node_object_map::del (public)

 site_node_object_map::del -object_id object_id

unmap object object_id from site_node node_id in table site_node_object_mappings

Switches:
-object_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 site_node_object_map::new site_node_object_map::new (public) site_node_object_map::del site_node_object_map::del site_node_object_map::new->site_node_object_map::del db_dml db_dml (public) site_node_object_map::del->db_dml

Testcases:
No testcase defined.

site_node_object_map::get_node_id (public)

 site_node_object_map::get_node_id -object_id object_id
Switches:
-object_id (required)
Returns:
the node_id of the site_node of the passed object_id

Partial Call Graph (max 5 caller/called nodes):
%3 site_node_object_map::get_url site_node_object_map::get_url (public) site_node_object_map::get_node_id site_node_object_map::get_node_id site_node_object_map::get_url->site_node_object_map::get_node_id db_string db_string (public) site_node_object_map::get_node_id->db_string

Testcases:
No testcase defined.

site_node_object_map::get_url (public)

 site_node_object_map::get_url -object_id object_id
Switches:
-object_id (required)
Returns:
the url corresponding to the site_node to which the passed object_id is mapped.

Partial Call Graph (max 5 caller/called nodes):
%3 site_node::get_url site_node::get_url (public) site_node_object_map::get_node_id site_node_object_map::get_node_id (public) site_node_object_map::get_url site_node_object_map::get_url site_node_object_map::get_url->site_node::get_url site_node_object_map::get_url->site_node_object_map::get_node_id

Testcases:
No testcase defined.

site_node_object_map::new (public)

 site_node_object_map::new -object_id object_id -node_id node_id

map object object_id to site_node node_id in table site_node_object_mappings

Switches:
-object_id (required)
-node_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 db_dml db_dml (public) db_transaction db_transaction (public) site_node_object_map::del site_node_object_map::del (public) site_node_object_map::new site_node_object_map::new site_node_object_map::new->db_dml site_node_object_map::new->db_transaction site_node_object_map::new->site_node_object_map::del

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

Content File Source

# tcl/portal-node-mapping-procs.tcl

ad_library {
    Portal Node Mappings

    @author Ben Adida (ben@openforce.net)
    @creation-date April 2002
    @cvs-id $Id: site-node-object-map-procs.tcl,v 1.7 2024/09/11 06:15:48 gustafn Exp $
}

namespace eval site_node_object_map {}

d_proc -public site_node_object_map::new {
    {-object_id:required}
    {-node_id:required}
} {
    map object object_id to site_node node_id in table site_node_object_mappings
} {
    db_transaction {
        site_node_object_map::del -object_id $object_id
        db_dml set_node_mapping {
            insert
            into site_node_object_mappings
            (object_id, node_id)
            values
            (:object_id, :node_id)
        }
    }
}

d_proc -public site_node_object_map::del {
    {-object_id:required}
} {
    unmap object object_id from site_node node_id in table site_node_object_mappings
} {
    db_dml unset_node_mapping {
        delete
        from site_node_object_mappings
        where object_id = :object_id
    }
}

d_proc -public site_node_object_map::get_node_id {
    {-object_id:required}
} {
    @return the node_id of the site_node of the passed object_id
} {
    return [db_string select_node_mapping {} -default ""]
}

d_proc -public site_node_object_map::get_url {
    {-object_id:required}
} {
    @return the url corresponding to the site_node to which the passed object_id is mapped.
} {
    set node_id [site_node_object_map::get_node_id -object_id $object_id]

    if {$node_id eq ""} {
        return {}
    }

    return [site_node::get_url -node_id $node_id]
}


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