Index: openacs-4/packages/acs-admin/acs-admin.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/acs-admin.info,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-admin/acs-admin.info 16 Jan 2003 13:27:52 -0000 1.18 +++ openacs-4/packages/acs-admin/acs-admin.info 25 Feb 2003 16:56:45 -0000 1.19 @@ -7,7 +7,7 @@ t t - + oracle postgresql @@ -18,7 +18,7 @@ OpenACS A UI for administering the OpenACS system. - + Index: openacs-4/packages/acs-admin/www/apm/file-watch.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/file-watch.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-admin/www/apm/file-watch.tcl 31 Jan 2003 12:23:46 -0000 1.6 +++ openacs-4/packages/acs-admin/www/apm/file-watch.tcl 25 Feb 2003 16:57:20 -0000 1.7 @@ -1,48 +1,20 @@ ad_page_contract { Schedules a file to be watched. - - @param file_id The id of the file to watch. @author Jon Salz [jsalz@arsdigita.com] @creation-date 17 April 2000 @cvs-id $Id$ } { - file_id:integer,multiple -} -validate { - valid_version_id { - foreach single_file_id $file_id { - set version_id [apm_version_from_file $single_file_id] - if { $version_id == 0 } { - ad_complain - } - } - } -} -errors { - valid_version_id {The file you have requested is not registerd.} -} + version_id:integer + paths:multiple +} -set file_id_list $file_id +apm_version_info $version_id set count 0 -foreach file_id $file_id_list { +foreach path $paths { incr count - db_1row apm_get_file_to_watch { - select t.package_key, t.pretty_name, - v.version_name, v.package_key, v.installed_p, - f.path, f.version_id - from apm_package_types t, apm_package_versions v, apm_package_files f - where f.file_id = :file_id - and f.version_id = v.version_id - and v.package_key = t.package_key - } - - # Why did we need all that information? -KS - - db_1row apm_get_path_from_file_id { - select path from apm_package_files where file_id = :file_id - } - apm_file_watch "packages/$package_key/$path" lappend path_list $path Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/acs-admin/www/apm/file-watch.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-admin/www/apm/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/index.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-admin/www/apm/index.tcl 31 Jan 2003 12:23:46 -0000 1.7 +++ openacs-4/packages/acs-admin/www/apm/index.tcl 25 Feb 2003 16:57:20 -0000 1.8 @@ -74,16 +74,18 @@ { action "" "" {  [eval { - # LARS: Ugh! We were calling the expensive 'apm_version_load_status' proc twice! - # ns_log Notice "Status for $version_id: [apm_version_load_status $version_id]" + if { $installed_p == "t" && $enabled_p == "t" } { + set watch_all_link "watch all files" + set format_string $watch_all_link - - if { $installed_p == "t" && $enabled_p == "t" && \ - [string equal [apm_version_load_status $version_id] "needs_reload"]} { - format "reload" - } else { - set format "" + if {[string equal [apm_version_load_status $version_id] "needs_reload"]} { + set format_string "$watch_all_link | reload changed" + } + } else { + set format_string "" } + format $format_string + }]  } } } @@ -94,7 +96,10 @@ db_release_unused_handles -doc_body_append "

Packages

$table
+doc_body_append "

Packages

+ +$table +
  • Create a new package.
  • Write new specification files for all installed, locally generated packages Index: openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl 31 Jan 2003 17:00:55 -0000 1.3 +++ openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl 25 Feb 2003 16:57:20 -0000 1.4 @@ -25,19 +25,37 @@ doc_body_append [apm_header [list "version-view?version_id=$version_id" "$pretty_name $version_name"] "Delete"] -# Invoke the Tcl callback before the sql drop scripts -apm_invoke_callback_proc -version_id $version_id -type before-uninstall -arg_list [list version_id $version_id] +# Unmount all instances of this package with the Tcl API that invokes before-unmount callbacks +db_foreach all_package_instances { + select site_nodes.node_id + from apm_packages, site_nodes + where apm_packages.package_id = site_nodes.object_id + and apm_packages.package_key = :package_key +} { + set url [site_node::get_url -node_id $node_id] + doc_body_append "Unmounting package instance at url $url
    " + site_node::unmount -node_id $node_id +} +# Delete the package instances with Tcl API that invokes before-uninstantiate callbacks +db_foreach all_package_instances { + select package_id + from apm_packages + where package_key = :package_key +} { + doc_body_append "Deleting package instance $package_id
    " + apm_package_instance_delete $package_id +} + +# Invoke the before-uninstall Tcl callback before the sql drop scripts +apm_invoke_callback_proc -version_id $version_id -type before-uninstall + if {![empty_string_p $sql_drop_scripts]} { doc_body_append "Now executing drop scripts.
      " - db_foreach drop_file_query " - select path from apm_package_files - where file_id in ([join $sql_drop_scripts \",\"]) - and file_type='data_model_drop' - " { + foreach path $sql_drop_scripts { doc_body_append "
    • "
       	db_source_sql_file -callback apm_doc_body_callback "[acs_package_root_dir $package_key]/$path"
       	doc_body_append "
      " Index: openacs-4/packages/acs-admin/www/apm/package-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/package-delete.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-admin/www/apm/package-delete.tcl 22 Jan 2003 18:39:11 -0000 1.4 +++ openacs-4/packages/acs-admin/www/apm/package-delete.tcl 25 Feb 2003 16:57:20 -0000 1.5 @@ -14,24 +14,17 @@ set db_type [db_type] -db_foreach apm_package_drop_scripts { - select file_id, path - from apm_package_files - where version_id = :version_id - and file_type = 'data_model_drop' - and (db_type is null or db_type = :db_type) -} { +set file_list "" +foreach file [apm_get_package_files -package_key $package_key -file_types data_model_drop] { append file_list " - - $path + + $file " -} if_no_rows { - set file_list "" -} +} if {![empty_string_p $file_list]} { set file_list " - Please check the drop scripts you want to run. Be aware that this will + We recommend sourcing all of the drop scripts for the package. Be aware that this will erase all data associated with this package from the database. $file_list Index: openacs-4/packages/acs-admin/www/apm/package-watch.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/package-watch.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-admin/www/apm/package-watch.tcl 25 Feb 2003 16:57:20 -0000 1.1 @@ -0,0 +1,13 @@ +ad_page_contract { + Schedules all -procs.tcl and xql files of a package to be watched. + + + @author Peter Marklund + @cvs-id $Id: package-watch.tcl,v 1.1 2003/02/25 16:57:20 peterm Exp $ +} { + package_key +} + +apm_watch_all_files $package_key + +ad_returnredirect "index" \ No newline at end of file Index: openacs-4/packages/acs-admin/www/apm/packages-install-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install-3.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-admin/www/apm/packages-install-3.tcl 19 Dec 2002 16:06:59 -0000 1.5 +++ openacs-4/packages/acs-admin/www/apm/packages-install-3.tcl 25 Feb 2003 16:57:20 -0000 1.6 @@ -21,7 +21,6 @@ " set sql_file_list [list] -set catalog_file_list [list] set file_count 0 foreach pkg_info $pkg_install_list { @@ -47,8 +46,10 @@ # Find out which script is appropriate to be run. set data_model_in_package 0 set table_rows "" - set data_model_files [apm_data_model_scripts_find -upgrade_from_version_name \ - $initial_version_name -upgrade_to_version_name $final_version_name $package_key $version(files)] + set data_model_files [apm_data_model_scripts_find \ + -upgrade_from_version_name $initial_version_name \ + -upgrade_to_version_name $final_version_name \ + $package_key] set sql_file_list [concat $sql_file_list $data_model_files] if {![empty_string_p $data_model_files]} { foreach file $data_model_files { @@ -62,6 +63,12 @@ " incr file_count } + + if { [empty_string_p $version(auto-mount)] && [string equal $version(package.type) apm_application] } { + set mount_html " Mount package under the main site at path " + } else { + set mount_html "" + } append body " Select what data files to load for $version(package-name) $final_version_name
      @@ -72,17 +79,14 @@
      $table_rows -
      File Name

      " + + $mount_html +

      " } - - # I18N: Get the list of message catalog files to source - set catalog_file_list [concat $catalog_file_list [apm_message_catalog_files_find $package_key $version(files)]] } ad_set_client_property -clob t apm sql_file_paths $sql_file_list -ad_set_client_property -clob t apm catalog_file_paths $catalog_file_list - if {[empty_string_p $sql_file_list]} { ad_returnredirect packages-install-4 ad_script_abort Index: openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl 16 Feb 2003 00:03:58 -0000 1.6 +++ openacs-4/packages/acs-admin/www/apm/packages-install-4.tcl 25 Feb 2003 16:57:20 -0000 1.7 @@ -7,12 +7,13 @@ @cvs-id $Id$ } { {sql_file:multiple ""} + {mount_p:multiple ""} + {mount_path:array ""} } set pkg_install_list [ad_get_client_property apm pkg_install_list] set pkg_enable_list [ad_get_client_property apm pkg_enable_list] set sql_file_paths [ad_get_client_property apm sql_file_paths] -set catalog_file_paths [ad_get_client_property apm catalog_file_paths] set install_path [ad_get_client_property apm install_path] set copy_files_p [ad_get_client_property apm copy_files_p] @@ -58,21 +59,20 @@ } } - set message_catalog_files [list] - # Find the message catalog files for the package - foreach file $catalog_file_paths { - if { [string equal [lindex $file 1] $package_key] } { - # We only need a list of file paths relative to package root - lappend message_catalog_files [lindex $file 0] - } + # Mount path of package + if { [lsearch $mount_p $package_key] != -1 && [info exists mount_path($package_key)] && ![empty_string_p $mount_path($package_key)] } { + set selected_mount_path $mount_path($package_key) + } else { + set selected_mount_path "" } # Install the packages. ns_log Debug "APM: Installing packages from $install_path." if {$copy_files_p} { set version_id [apm_package_install -install_path $install_path \ -callback apm_ns_write_callback -copy_files -load_data_model \ - -data_model_files $data_model_files -message_catalog_files $message_catalog_files \ + -data_model_files $data_model_files \ + -mount_path $selected_mount_path \ $spec_file] if {$version_id != 0} { file delete -force $install_path/$package_key @@ -86,7 +86,7 @@ -callback apm_ns_write_callback \ -load_data_model \ -data_model_files $data_model_files \ - -message_catalog_files $message_catalog_files \ + -mount_path $selected_mount_path \ $spec_file] } Index: openacs-4/packages/acs-admin/www/apm/version-files.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-files.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-admin/www/apm/version-files.tcl 18 Sep 2002 14:54:45 -0000 1.7 +++ openacs-4/packages/acs-admin/www/apm/version-files.tcl 25 Feb 2003 16:57:20 -0000 1.8 @@ -1,14 +1,11 @@ ad_page_contract { List all the files in a particular version of a package. - @param version_id The package to be processed. - @param remove_files_p Set to 1 if you want to remove all the files. @author Jon Salz [jsalz@arsdigita.com] @creation-date 9 May 2000 @cvs-id $Id$ } { {version_id:integer} - {remove_files_p 0} } db_1row apm_package_by_version_id { @@ -17,17 +14,10 @@ from apm_package_version_info where version_id = :version_id } -if { $remove_files_p == 1 } { - # This is really a "remove multiple files" page. - set form "action=\"file-remove\" method=post" - set apm_header_args [list [list "version-files?version_id=$version_id" "Files"] "Remove Files"] -} else { - set form "" - set apm_header_args [list "Files"] -} +set form "" +set apm_header_args [list "Files"] -doc_body_append "[eval [concat [list apm_header -form $form [list "version-view?version_id=$version_id" "$pretty_name $version_name"]] $apm_header_args]] -" +doc_body_append "[eval [concat [list apm_header -form $form [list "version-view?version_id=$version_id" "$pretty_name $version_name"]] $apm_header_args]]" doc_body_append " @@ -40,17 +30,18 @@ set counter 0 doc_body_append "PathFile type - Database supportActions\n" + Database support\n" -db_foreach apm_all_files { - select f.file_id, f.path, f.file_type, nvl(t.pretty_name, 'Unknown type') file_pretty_name, - f.db_type, nvl(d.pretty_db_name, 'All') as db_pretty_name - from apm_package_files f, apm_package_file_types t, apm_package_db_types d - where f.version_id = :version_id - and f.file_type = t.file_type_key(+) - and f.db_type = d.db_type_key(+) - order by path -} { +foreach path [apm_get_package_files -package_key $package_key] { + set file_id "" + set db_type [apm_guess_db_type $package_key $path] + set db_pretty_name $db_type + set file_type [apm_guess_file_type $package_key $path] + if { [empty_string_p $file_type] } { + set file_type "?" + } + set file_pretty_name $file_type + incr counter # Set i to the index of the last component which hasn't changed since the last component @@ -86,10 +77,7 @@ doc_body_append "" doc_body_append " $file_pretty_name $db_pretty_name  " - if { $remove_files_p == 1 } { - # Display a checkbox which the user can check to delete the file. - doc_body_append "" - } else { + if { $installed_p == "t" } { if { $file_type == "tcl_procs" || ($file_type == "query_file" && [db_compatible_rdbms_p $db_type]) } { if { [nsv_exists apm_reload_watch "packages/$package_key/$path"] } { @@ -99,77 +87,56 @@ if {![ad_parameter -package_id [ad_acs_kernel_id] \ PerformanceModeP request-processor 1]} { # Provide a link to watch the procs file. - doc_body_append " watch " + doc_body_append " watch " } else { doc_body_append "" } } } else { doc_body_append "" } - } - # Allow the user to remove the file from the package. - doc_body_append "remove" - } + + } } doc_body_append "\n" incr i } set last_components $components -} else { +} + +if { [string equal $counter 0] } { doc_body_append "This package does not contain any registered files.\n" } -if { $counter > 0 && $remove_files_p == 1 } { - doc_body_append " -[export_form_vars version_id] -" -} - -doc_body_append " - +doc_body_append " " -if { $remove_files_p } { - doc_body_append "

      \n" -} else { - if { $installed_p == "t" } { - doc_body_append "" - } elseif { [info exists tagged_p] } { - if { $tagged_p == "t" } { - doc_body_append " - " - } +} elseif { [info exists tagged_p] } { + if { $tagged_p == "t" } { + doc_body_append " + " } } doc_body_append [ad_footer] - Index: openacs-4/packages/acs-admin/www/apm/version-i18n.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-i18n.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-admin/www/apm/version-i18n.adp 10 Jan 2003 17:12:12 -0000 1.11 +++ openacs-4/packages/acs-admin/www/apm/version-i18n.adp 25 Feb 2003 16:57:20 -0000 1.12 @@ -101,10 +101,10 @@ variables (i.e. \@var_name\@), will be listed on the result page. Make sure to take note of these texts and translate them manually. Suppose for example that our script tells you that it left - the text "Forum \@forum_name\@" untouched. What you should do then + the text "Manage forum \@forum_name\@" untouched. What you should do then is to edit the corresponding adp file and manually replace that text - with something like "<#Forum Forum#> \@forum_name\@" (to save you - from too much typing you may use the shorthand <#_ Forum#>, an + with something like "<#manage_forum Manage forum \@forum_name\@#>" (to save you + from too much typing you may use the shorthand <#_ Manage forum \@forum_name\@#>, an underscore key will result in the script auto-generating a key for you based on the text). After you have made all such manual edits you can simply run the second action labeled "Replace tags with keys