| |
14 |
14 |
} { |
| |
15 |
15 |
return [db_string get_url_from_node_id { |
| |
16 |
16 |
select site_node.url(:node_id) from dual |
| |
17 |
17 |
}] |
| |
18 |
18 |
} |
| |
19 |
19 |
|
| |
20 |
20 |
ad_proc -public get_node_id_from_url { |
| |
21 |
21 |
{-url:required} |
| |
22 |
22 |
{-parent_node_id ""} |
| |
23 |
23 |
} { |
| |
24 |
24 |
get node_id from url |
| |
25 |
25 |
} { |
| |
26 |
26 |
return [db_exec_plsql get_node_id_from_url { |
| |
27 |
27 |
begin |
| |
28 |
28 |
:1 := site_node.node_id(url => :url, parent_id => :parent_node_id); |
| |
29 |
29 |
end; |
| |
30 |
30 |
}] |
| |
31 |
31 |
} |
| |
32 |
32 |
|
| |
33 |
33 |
ad_proc -public get_parent_id { |
| |
34 |
|
{-node_id:required} |
| |
|
34 |
{-node_id ""} |
| |
|
35 |
{-instance_id ""} |
| |
35 |
36 |
} { |
| |
36 |
|
get the parent_id of this node_id |
| |
|
37 |
get the parent_id (a node_id) of this node_id |
| |
37 |
38 |
} { |
| |
38 |
|
return [db_string select_parent_site_node {}] |
| |
|
39 |
if {![empty_string_p $node_id]} { |
| |
|
40 |
return [db_string select_parent_by_node_id {}] |
| |
|
41 |
} elseif {![empty_string_p $instance_id]} { |
| |
|
42 |
return [db_string select_parent_by_instance_id {}] |
| |
|
43 |
} else { |
| |
|
44 |
ns_log error "site_nodes::get_parent_id Bad params!" |
| |
|
45 |
ad_return_complaint 1 "site_nodes::get_parent_id Bad params! Tell your admin." |
| |
39 |
46 |
} |
| |
|
47 |
} |
| |
40 |
48 |
|
| |
|
49 |
ad_proc -public get_parent_name { |
| |
|
50 |
{-instance_id ""} |
| |
|
51 |
} { |
| |
|
52 |
get the name of the parent of this instance |
| |
|
53 |
} { |
| |
|
54 |
return [db_string select_parent_name_by_id {}] |
| |
|
55 |
} |
| |
41 |
56 |
|
| |
|
57 |
|
| |
42 |
58 |
# site_nodes_list procs |
| |
43 |
59 |
|
| |
44 |
60 |
ad_proc -public get_site_nodes_list { |
| |
45 |
61 |
} { |
| |
46 |
62 |
Return the list-ified site_nodes array. |
| |
47 |
63 |
} { |
| |
48 |
64 |
return [nsv_array get site_nodes] |
| |
49 |
65 |
} |
| |
50 |
66 |
|
| |
51 |
67 |
ad_proc -public get_site_nodes_list_key { |
| |
52 |
68 |
{-site_nodes_list:required} |
| |
53 |
69 |
{-index:required} |
| |
54 |
70 |
} { |
| |
55 |
71 |
return [lindex $site_nodes_list $index] |
| |
56 |
72 |
} |
| |
57 |
73 |
|
| |
58 |
74 |
ad_proc -public get_site_nodes_list_value { |
| |
59 |
75 |
{-site_nodes_list:required} |
| |
60 |
76 |
{-index:required} |
| |
61 |
77 |
} { |