Index: openacs-4/packages/static-pages/tcl/static-pages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs.tcl,v diff -u -r1.11.2.12 -r1.11.2.13 --- openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 22 Jan 2003 21:22:19 -0000 1.11.2.12 +++ openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 6 Feb 2003 13:05:51 -0000 1.11.2.13 @@ -473,7 +473,7 @@ # calling static_page.new - thus the addition of mutex # locking. --atp@piskorski.com, 2001/08/27 01:20 EDT - set mime_type [sp_maybe_create_new_mime_type $sp_filename] + set mime_type [cr_filename_to_mime_type -create $sp_filename] if { [catch { set static_page_id [db_exec_plsql do_sp_new {}] @@ -698,97 +698,6 @@ } -ad_proc sp_maybe_create_new_mime_type { - file_name -} { - - Contrary to the name, this proc does not ever insert a - new MIME type into the cr_mime_types table the way the - fs_maybe_create_new_mime_type proc does. That File Storage proc - and the design cr_mime_types table it mucks with are fundamentally - flawed, and (c. Jan. 2003) there have been several major threads - in BBoard about that already: - - one, - two, - three. - - And the old side-effecting implementation that inserted into - cr_mime_types led to some of the problems discussed in - Bug 145. - -

- The content repository insists that the MIME type already - be defined in cr_mime_types when you upload content. Therefore, - first we look for a MIME type for this file extension in - cr_mime_types. If we can't find a MIME type there, we might also - want to look in the AOLserver config file, but, that - would break things because the MIME type must be in - cr_mime_types. If you have MIME types defined in your AOLserve - config file but not in cr_mime_types, you should add them to - cr_mime_types. - -

- If no more specific MIME type for the file extension is found, we - return the "*/*" unknown MIME type. - -

- Known Bugs: -

- -

- --atp@piskorski.com, 2003/01/22 15:16 EST - - @author Andrew Piskorski (atp@piskorski.com) - @creation-date 2002-12-15 -} { - set proc_name {sp_maybe_create_new_mime_type} - set mime_type_unknown {*/*} - - set file_extension [string trimleft [file extension $file_name] "."] - if {[empty_string_p $file_extension]} { - set mime_type $mime_type_unknown - } - - if {![db_0or1row select_mime_type { - select mime_type - from cr_mime_types - where file_extension = :file_extension - }]} { - set mime_type $mime_type_unknown - - #set nsd_mime_type [ns_guesstype $file_name] - #if { ![string equal $mime_type $nsd_mime_type] } { - # ns_log Warning "$proc_name: For file extension '$file_extension', the only matching MIME type in cr_mime_types is '$mime_type', but AOLserver thinks the MIME type should be '$nsd_mime_type'." - #} - } - - return $mime_type -} - - ad_proc -public sp_package_key_is {} { Simply returns the package key string for this package. @author Andrew Piskorski (atp@piskorski.com)