Index: openacs-4/packages/acs-subsite/www/admin/site-map/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index.adp,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/acs-subsite/www/admin/site-map/index.adp 30 Dec 2003 20:44:40 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/site-map/index.adp 24 Sep 2004 14:14:36 -0000 1.1.2.1 @@ -1,5 +1,47 @@ @page_title;noquote@ @context;noquote@ +@javascript;noquote@ -@body;noquote@ + +@head;noquote@ + + + +»Create new application
+»Manage unmounted applications + +

Services

+ + +

Site Map Instructions

+ + +
\ No newline at end of file Index: openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl,v diff -u -r1.21 -r1.21.2.1 --- openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl 5 Jan 2004 09:36:03 -0000 1.21 +++ openacs-4/packages/acs-subsite/www/admin/site-map/index.tcl 24 Sep 2004 14:14:37 -0000 1.21.2.1 @@ -1,10 +1,10 @@ ad_page_contract { - + @author rhs@mit.edu @author bquinn@arsidigta.com @creation-date 2000-09-09 @cvs-id $Id$ - + } { {expand:integer,multiple ""} {new_parent:integer ""} @@ -47,294 +47,251 @@ set page_title "Site Map" set context [list $page_title] -append body " -

-» Create new application -

- - - - - - - -
" - set user_id [ad_conn user_id] db_foreach path_select {} { if {$node_id != $root_id && $admin_p == "t"} { - append body "" + append head "" } if {[empty_string_p $name]} { - append body "$obj_name:" + append head "$obj_name:" } else { - append body $name + append head $name } - + if {$node_id != $root_id && $admin_p == "t"} { - append body "" + append head "" } - + if {$directory_p == "t"} { - append body "/" + append head "/" } } if_no_rows { - append body " " + append head " " } -append body " -
- - - - - - - -" - 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. +template::list::create \ + -name nodes \ + -multirow nodes \ + -key node_id \ + -elements { + name { + label "URL" + html "align left" + display_template { + + @nodes.tree_indent;noquote@ + + + (+) + + + (-) + + @nodes.name;noquote@ + + +
+ @nodes.tree_indent;noquote@ + @nodes.action_form_part;noquote@ + + + +
+ } + } instance { + label "Instance" + html "align left" + display_template { + + +
+ + @nodes.action_form_part;noquote@ + + + + +
+
+ + @nodes.action_form_part;noquote@ + + + + +
@nodes.instance;noquote@ + + } + } type { + label "Package Type" + html "align left" + display_template { + @nodes.type;noquote@ + } + } actions { + label "Action" + html "align left" + display_template { + + add folder + + + new application + + + unmount + + + mount + + + rename + + + delete + + + parameters + + + permissions + + + @nodes.extra_form_part;noquote@ + + } + } + } + +multirow create nodes node_id expand_mode expand_url tree_indent name name_url instance instance_url type action_type action_form_part add_folder_url new_app_url unmount_url mount_url rename_url delete_url parameters_url permissions_url extra_form_part + set open_nodes [list] + db_foreach nodes_select {} { - if { [lsearch -exact $open_nodes $parent_id] == -1 && $parent_id != "" && $mylevel > 2 } { continue } + set add_folder_url "" + set new_app_url "" + set unmount_url "" + set mount_url "" + set rename_url "" + set delete_url "" + set parameters_url "" + set permissions_url "" - # set up commands to put in the various columns - set controls [list] - set dir_controls [list] - set name_controls [list] - + if { [lsearch -exact $open_nodes $parent_id] == -1 && $parent_id != "" && $mylevel > 2 } { continue } + if {$directory_p == "t"} { - lappend controls "add folder" + set add_folder_url "?[export_url_vars expand:multiple root_id node_id new_parent=$node_id new_type=folder]" if {[empty_string_p $object_id]} { - lappend controls "mount" - lappend controls "new application" + set mount_url "mount?[export_url_vars expand:multiple root_id node_id]" + set new_app_url "?[export_url_vars expand:multiple root_id new_application=$node_id]" } else { - # This makes sure you can't unmount the thing that is serving - # the page you're looking at. + # 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" + set unmount_url "unmount?[export_url_vars expand:multiple root_id node_id]" } + # Add a link to control permissioning + if {$object_admin_p} { + set permissions_url "../../permissions/one?[export_url_vars object_id]" + set rename_url "?[export_url_vars expand:multiple root_id rename_application=$node_id]" + set delete_url "instance-delete?package_id=$object_id&root_id=$root_id" + } # Is the object a package? if {![empty_string_p $package_id]} { if {$object_admin_p && ($parameter_count > 0)} { - lappend controls "parameters" + set parameters_url "[export_vars -base "/shared/parameters" { package_id {return_url {[ad_return_url]} } }]" } } - - # Add a link to control permissioning - if {$object_admin_p} { - lappend controls "permissions" - lappend controls "rename" - lappend controls "delete" - } } } - if {[ad_conn node_id] != $node_id && $n_children == 0 && [empty_string_p $object_id]} { - lappend controls "delete" - } - - append body "" - - - - append body " - " - } - append body "\n" - - if {$node_id == $new_parent} { - set parent_id $new_parent - set node_type $new_type - append body " - - \n" - } } -append body " - - - - - - - [export_form_vars expand:multiple] - - - - +set new_app_form_part_1 "

[export_form_vars expand:multiple]

" - -
URLInstance NamePackage Type 
" - - # use the indent variable to hold current indent level - # we'll use it later to indent stuff at the end by the amount - # of the last node + if {[ad_conn node_id] != $node_id && $n_children == 0 && [empty_string_p $object_id]} { + set delete_url "delete?[export_url_vars expand:multiple root_id node_id]" + } + + # use the indent variable to hold current indent level we'll use it later to indent stuff at the end by the amount of the last node set indent "" for {set i 0} {$i < 3*$mylevel} {incr i} { append indent " " } - append body $indent - + + set expand_mode 0 if {!$root_p && $n_children > 0} { - set link "+" + set expand_mode 1 set urlvars [list] foreach n $expand { if {$n == $node_id} { - set link "-" + set expand_mode 2 lappend open_nodes "$node_id" } else { lappend urlvars "expand=$n" } } - - if {[string equal $link "+"]} { + + if { $expand_mode == 1} { lappend urlvars "expand=$node_id" } - + lappend urlvars "root_id=$root_id" - - append body "($link) " + + set expand_url "[join $urlvars "&"]" } else { - append body "    " + set expand_url "" } - - append body "" - if {!$root_p && $root_id != $node_id} { - append body "" + + set name_url [export_url_vars expand:multiple root_id=$node_id] + + set action_type 0 + set action_form_part "" + + if {[empty_string_p $object_id]} { + if {$new_application == $node_id} { + + set action_type "new_app" + set action_form_part "[export_form_vars expand:multiple root_id node_id new_package_id] [apm_application_new_checkbox]" + + #Generate a package_id for double click protection + set new_package_id [db_nextval acs_object_id_seq] + } else { + set action_form_part "(none)" + } + } elseif {$rename_application == $node_id} { + set action_type "rename_app" + set action_form_part "[export_form_vars expand:multiple root_id node_id rename_package_id]" + + } else {} + + if {$node_id == $new_parent} { + set parent_id $new_parent + set node_type $new_type + set action_type "new_folder" + set action_form_part "[export_form_vars expand:multiple parent_id node_type root_id]" } - append body "$name" - if {!$root_p && $root_id != $node_id} { - append body "" - } - append body [ad_decode $directory_p t / f ""] + multirow append nodes $node_id $expand_mode $expand_url $indent $name $name_url $object_name $url $package_pretty_name $action_type $action_form_part $add_folder_url $new_app_url $unmount_url $mount_url $rename_url $delete_url $parameters_url $permissions_url "" - append body " [join $dir_controls " | "] " - - 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] - append body "
- [export_form_vars expand:multiple root_id node_id new_package_id] - - -
- [apm_application_new_checkbox] - - - - - " - } else { - append body "(none)" - } - } elseif {$rename_application == $node_id} { - append body "
- [export_form_vars expand:multiple root_id node_id rename_package_id] - - - - -
- " - } else { - append body "[lang::util::localize $object_name]" - } - - if {![empty_string_p $object_id] || $new_application != $node_id } { - append body "
$package_pretty_name\[ [join $controls " | "] \]
" - for {set i 0} {$i < (3*($mylevel + 1) + 3)} {incr i} { - append body " " - } - # Generate a node_id for doubleclick protection. - append body " - [export_form_vars expand:multiple parent_id node_type root_id] - - - -
-
  
$indent - - [apm_application_new_checkbox] - - -
-
+set new_app_form_part_2 "

[apm_application_new_checkbox]

" +set new_app_form_part_3 "

" + multirow append nodes "" "" "" "" $new_app_form_part_1 "" "" "" $new_app_form_part_2 "" "" "" "" "" "" "" "" "" "" $new_app_form_part_3 - - - -" +set services "" -append body " -

-Manage unmounted applications -

- -

Services

- -" - -append body "

-

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, -create a new folder as above, then select mount. Select -the application to be copied from the list of available packages.

- -To move an application, -copy it as above to the new location, then 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. - - - -"