Index: openacs-4/packages/acs-tcl/tcl/apm-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs-oracle.xql,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-tcl/tcl/apm-procs-oracle.xql 7 Aug 2017 23:47:59 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/apm-procs-oracle.xql 14 Jun 2018 12:30:58 -0000 1.19 @@ -28,19 +28,6 @@ - - - - begin - :1 := apm_package.num_instances( - package_key => :package_key - ); - end; - - - - - @@ -70,19 +57,7 @@ - - - - select nvl(v.package_id, 0) as package_id, p.parameter_name, - decode(v.value_id, null, p.default_value, v.attr_value) as attr_value - from apm_parameters p, apm_parameter_values v - where p.package_key = :package_key - and p.parameter_id = v.parameter_id (+) - - - - @@ -142,16 +117,6 @@ - - - - select decode(count(*), 0, 0, 1) from apm_package_versions - where package_key = :package_key - and version_name = :version_name - - - - @@ -177,26 +142,6 @@ - - - - select site_node.url(min(node_id)) - from site_nodes - where object_id = :package_id - - - - - - - select package_key, pretty_name - from apm_package_types - where not (apm_package.singleton_p(package_key) = 1 and - apm_package.num_instances(package_key) >= 1) - order by pretty_name - - - select apm_parameter_value.new( Index: openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql 25 Mar 2010 01:02:16 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql 14 Jun 2018 12:30:58 -0000 1.19 @@ -26,17 +26,6 @@ - - - - select apm_package__num_instances( - :package_key - ); - - - - - @@ -113,17 +102,6 @@ - - - - select case when count(*) = 0 then 0 else 1 end - from apm_package_versions - where package_key = :package_key - and version_name = :version_name - - - - @@ -148,27 +126,6 @@ - - - - select site_node__url(min(node_id)) - from site_nodes - where object_id = :package_id - - - - - - - select package_key, - pretty_name - from apm_package_types - where not (apm_package__singleton_p(package_key) = 1 and - apm_package__num_instances(package_key) >= 1) - order by pretty_name - - - select apm_parameter_value__new(null, :package_id, ap.parameter_id, ap.default_value) Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.106 -r1.107 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 17 May 2018 14:42:03 -0000 1.106 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 14 Jun 2018 12:30:58 -0000 1.107 @@ -889,14 +889,11 @@ ad_proc -private apm_package_installed_p_not_cached { package_key } { - if {[catch {set installed_p [db_string apm_package_installed_p { - select 1 from apm_package_versions - where package_key = :package_key - and installed_p = 't' - } -default 0]}]} { - set installed_p 0 - } - return $installed_p + return [db_string apm_package_installed_p { + select exists (select 1 from apm_package_versions + where package_key = :package_key + and installed_p) from dual + }] } ad_proc -public apm_package_enabled_p { @@ -943,8 +940,10 @@ @return The number of instances of the indicated package. } { - return [db_exec_plsql apm_num_instances {}] - + return [db_string query { + select count(*) from apm_packages + where package_key = :package_key + }] } ad_proc -public apm_parameter_update { @@ -1248,13 +1247,9 @@ @return The package url of the instance of the package. } { - return [util_memoize [list apm_package_url_from_id_mem $package_id]] + return [lindex [site_node::get_url_from_object_id -object_id $package_id] 0] } -ad_proc -private apm_package_url_from_id_mem {package_id} { - return [db_string apm_package_url_from_id {} -default {}] -} - # # package_key -> package_url # @@ -1263,14 +1258,9 @@ @return The package url of the instance of the package. only valid for singleton packages. } { - return [util_memoize [list apm_package_url_from_key_mem $package_key]] + return [apm_package_url_from_id [apm_package_id_from_key $package_key]] } -ad_proc -private apm_package_url_from_key_mem {package_key} { - set package_id [apm_package_id_from_key $package_key] - return [apm_package_url_from_id $package_id] -} - # # package_key -> version_id # @@ -1340,7 +1330,11 @@ @return 1 if the indicated package version is installed, 0 otherwise. } { - return [db_string apm_package_version_installed_p {}] + return [db_0or1row apm_package_version_installed_p { + select 1 from apm_package_versions + where package_key = :package_key + and version_name = :version_name + }] } ad_proc -public apm_package_version_enabled_p {version_id} { @@ -1875,20 +1869,23 @@ @author Peter Marklund } { - set html_string "" - - return $html_string + return [subst {}] } ad_proc -private apm::read_files {path file_list} {