ad_page_contract { @author rhs@mit.edu @author bquinn@arsidigta.com @creation-date 2000-09-09 @cvs-id $Id: index.tcl,v 1.3 2002/02/15 17:39:48 neophytosd Exp $ } { {expand:integer,multiple {}} {new_parent:integer {}} {new_type ""} {root_id:integer {}} {new_application:integer {}} } if {[empty_string_p $root_id]} { set root_id [ad_conn node_id] } # We do a check for the admin privilege because a user could have # admin privilege on a site_node that has other site_nodes beneath it # that the user does not have admin privilege on. If we don't do this # check, the user could end up making changes on site_nodes that he # does not have the admin privilege for. db_1row root_node { select parent_id, object_id from site_nodes where node_id = :root_id } if {![empty_string_p $object_id]} { ad_require_permission $object_id admin } if {![empty_string_p $new_parent]} { set javascript "onLoad=\"javascript:document.new_parent.name.focus();document.new_parent.name.select()\"" } elseif {![empty_string_p $new_application]} { set javascript "onLoad=\"javascript:document.new_application.instance_name.focus();document.new_application.instance_name.select()\"" } else { set javascript "" } set parent_link ".?[export_url_vars expand:multiple root_id=$parent_id]" doc_body_append " Site Map

Site Map

[ad_context_bar "Site Map"]
" set user_id [ad_conn user_id] db_foreach path_select { select node_id, name, directory_p, level, acs_object.name(object_id) as obj_name, acs_permission.permission_p(object_id, :user_id, 'admin') as admin_p from site_nodes start with node_id = :root_id connect by node_id = prior parent_id order by level desc } { if {$node_id != $root_id && $admin_p == "t"} { doc_body_append "" } if {[empty_string_p $name]} { doc_body_append "$obj_name:" } else { doc_body_append $name } if {$node_id != $root_id && $admin_p == "t"} { doc_body_append "" } if {$directory_p == "t"} { doc_body_append "/" } } if_no_rows { doc_body_append " " } doc_body_append "
" if {[llength $expand] == 0} { lappend expand $root_id if { ![empty_string_p $parent_id] } { lappend expand $parent_id } } # You might wonder why level is aliased as mylevel here. Well, for some # reason, Oracle does not allow level to be selected from an on-the-fly view # containing connect by. However, if you rename the column, Oracle is happy to give # it to you. We could tell you how we figured this out, but then we would have to kill you. db_foreach nodes_select " select package_id, package_key, apm_package_type.num_parameters(package_key) parameter_count, node_id, url, parent_url, name, root_p, mylevel - 1 as mylevel, object_id, object_name, directory_p, parent_id, n_children, (select decode(acs_permission.permission_p(object_id, :user_id, 'admin'), 't', 1, 0) from dual) object_admin_p from apm_packages p, ( select node_id, site_node.url(node_id) as url, site_node.url(parent_id) as parent_url, name, (select count(*) from site_nodes where parent_id = n.node_id) as n_children, decode(node_id, site_node.node_id('/'), 1, 0) as root_p, level as mylevel, object_id, acs_object.name(object_id) as object_name, directory_p, parent_id from site_nodes n where (object_id is null or acs_permission.permission_p(object_id, :user_id, 'read') = 't') start with node_id = nvl(:root_id, site_node.node_id('/')) connect by prior node_id = parent_id and parent_id in ([join $expand ", "])) site_map where site_map.object_id = p.package_id (+) " { doc_body_append "" set controls [list] if {$directory_p == "t"} { lappend controls "new sub folder" if {[empty_string_p $object_id]} { lappend controls "mount" lappend controls "new application" } else { # This makes sure you can't unmount the thing that is serving # the page you're looking at. if {[ad_conn node_id] != $node_id} { lappend controls "unmount" } # Is the object a package? if {![empty_string_p $package_id]} { if {$object_admin_p && ($parameter_count > 0)} { lappend controls "set parameters" } } # Add a link to control permissioning if {$object_admin_p} { lappend controls "set permissions" } } } if {[ad_conn node_id] != $node_id && $n_children == 0 && [empty_string_p $object_id]} { lappend controls "delete" } doc_body_append "\n" if {$node_id == $new_parent} { set parent_id $new_parent set node_type $new_type doc_body_append "\n" } } doc_body_append "
URLApplication 
" for {set i 0} {$i < 3*$mylevel} {incr i} { doc_body_append " " } if {!$root_p && $n_children > 0} { set link "+" set urlvars [list] foreach n $expand { if {$n == $node_id} { set link "-" } else { lappend urlvars "expand=$n" } } if {[string equal $link "+"]} { lappend urlvars "expand=$node_id" } lappend urlvars "root_id=$root_id" doc_body_append "($link) " } else { doc_body_append "    " } doc_body_append "" if {!$root_p && $root_id != $node_id} { doc_body_append "" } doc_body_append "$name" if {!$root_p && $root_id != $node_id} { doc_body_append "" } doc_body_append [ad_decode $directory_p t / f ""] doc_body_append "" if {[empty_string_p $object_id]} { if {$new_application == $node_id} { #Generate a package_id for double click protection set new_package_id [db_nextval acs_object_id_seq] doc_body_append "
[export_form_vars expand:multiple root_id node_id new_package_id]
" } else { doc_body_append "(none)" } } else { doc_body_append "$object_name" } doc_body_append "
\[ [join $controls " | "] \]
" for {set i 0} {$i < (3*($mylevel + 1) + 3)} {incr i} { doc_body_append " " } # Generate a node_id for doubleclick protection. set new_node_id [db_nextval acs_object_id_seq] doc_body_append " [export_form_vars expand:multiple parent_id node_type root_id new_node_id]
   

Unmounted Applications

Configurable Services
" doc_body_append "

Site Map Instructions

To add an application to this site, use new sub folder to create a new site node beneath under the selected folder. Then choose new application to select an installed application package for instantiation. The application will then be available at the displayed URL.

To configure an application select set parameters to view and edit application specific options. set permissions allows one to grant privileges to users and groups to specific application instances or other application data. For more info on parameters and permissions, see the package specific documentation.

To copy an application instance to another URL, simply create a new folder as above, then select mount. Select the application to be copied from the list of available packages.

To move or rename an application, copy it as above to the new location, then just select unmount at the old location. Selecting delete on the empty folder will remove it from the site node.

To remove an application and all of its data, select unmount from all the site nodes it is mounted from, then delete it from the Unmounted Applications link below the site map.

[ad_footer] "