Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl,v diff -u -r1.25 -r1.26 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 23 Sep 2003 17:41:41 -0000 1.25 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 24 Sep 2003 17:51:24 -0000 1.26 @@ -54,13 +54,46 @@ } } +ad_proc -public apm_file_type_names {} { + Returns an array list with filetypes as keys and + filetype pretty names as values. + @author Peter Marklund +} { + return { + documentation "Documentation" + tcl_procs "Tcl procedure library" + tcl_init "Tcl initialization" + tcl_util "Tcl utility script" + content_page "Content page" + package_spec "Package specification" + sql_data "SQL Data" + ctl_file "SQL data loader control" + data_model "Data model" + data_model_create "Data model installation" + data_model_drop "Data model deinstallation" + data_model_upgrade "Data model upgrade" + java_code "Java code" + java_archive "Java archive" + query_file "Query file" + template "Template file" + shell "Shell utility" + sqlj_code "SQLJ library" + message_catalog "Message Catalog" + } +} + ad_proc -public apm_file_type_keys {} { Returns a list of valid file type keys. + @see apm_file_type_names + @see apm_pretty_name_for_file_type + + @author Peter Marklund } { - return [util_memoize [list db_list file_type_keys "select file_type_key from apm_package_file_types"]] + array set file_type_names [apm_file_type_names] + return [array names file_type_names] } Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs.xql 10 Mar 2003 19:59:04 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs.xql 24 Sep 2003 17:51:24 -0000 1.5 @@ -31,13 +31,6 @@ - - - - select file_type_key from apm_package_file_types - - - select db_type_key from apm_package_db_types 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.53 -r1.54 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 19 Sep 2003 16:13:25 -0000 1.53 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 24 Sep 2003 17:51:24 -0000 1.54 @@ -473,14 +473,15 @@ ad_proc -private apm_pretty_name_for_file_type { type } { Returns the pretty name corresponding to a particular file type key - (memoizing to save a database hit here and there). + @see apm_file_type_names + @see apm_file_type_keys + + @author Peter Marklund } { - return [util_memoize [list db_string pretty_name_select " - select pretty_name - from apm_package_file_types - where file_type_key = :type - " -default "Unknown" -bind [list type $type]]] + array set file_type_names [apm_file_type_names] + + return $file_type_names($type) } ad_proc -private apm_pretty_name_for_db_type { db_type } { Index: openacs-4/packages/acs-tcl/tcl/apm-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.xql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/acs-tcl/tcl/apm-procs.xql 26 Feb 2003 12:42:13 -0000 1.13 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.xql 24 Sep 2003 17:51:24 -0000 1.14 @@ -9,17 +9,6 @@ - - - select file_id, path - from apm_package_files - where version_id = :version_id - and file_type in ('tcl_procs', 'query_file') - and (db_type is null or db_type = '[db_type]') - order by path - - - select v.package_id, p.parameter_name, @@ -38,14 +27,6 @@ - - - select pretty_name - from apm_package_file_types - where file_type_key = :type - - - select pretty_db_name Index: openacs-4/packages/acs-tcl/tcl/apm-xml-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-xml-procs.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-tcl/tcl/apm-xml-procs.xql 17 May 2003 10:04:18 -0000 1.6 +++ openacs-4/packages/acs-tcl/tcl/apm-xml-procs.xql 24 Sep 2003 17:51:24 -0000 1.7 @@ -44,21 +44,7 @@ - - - - - select path, - file_type, - db_type - from apm_package_files - where version_id = :version_id - order by path - - - - select type,