Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/assessment/sql/oracle/assessment-files.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/assessment/sql/postgresql/assessment-files.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/assessment/tcl/as-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-file-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/assessment/tcl/as-file-procs.tcl 22 Nov 2004 11:59:22 -0000 1.2 +++ openacs-4/packages/assessment/tcl/as-file-procs.tcl 13 Jan 2005 17:51:59 -0000 1.3 @@ -12,24 +12,22 @@ @author eperez@it.uc3m.es @creation-date 2004-10-25 - New as_file to the CR + New file to the CR } { set package_id [ad_conn package_id] - set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] + set folder_id [as::assessment::folder_id -package_id $package_id] # Get the filename part of the upload file if { ![regexp {[^//\\]+$} $file_pathname file_name] } { # no match set file_name $file_pathname } # TODO make the CR name be a SHA1 of the file to prevent too much files repeated - set file_item_id [content::item::new -parent_id $folder_id -content_type {as_files} -name [exec uuidgen] -title $file_name] - set file_revision_id [content::revision::new -item_id $file_item_id -content_type {as_files} -title $file_name ] - set filename [cr_create_content_file $file_item_id $file_revision_id $file_pathname] - set title [template::util::file::get_property filename $file_pathname] - set mime_type [cr_filename_to_mime_type -create $title] + set filename [template::util::file::get_property filename $file_pathname] + set mime_type [cr_filename_to_mime_type -create $filename] set content_length [file size $file_pathname] - db_dml set_file_content { update cr_revisions set content = :filename, mime_type = :mime_type, content_length = :content_length where revision_id = :file_revision_id } + set content_rev_id [cr_import_content -title $filename $folder_id $file_pathname $content_length $file_mimetype [exec uuidgen]] + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $content_rev_id -type as_item_content_rel - return $file_revision_id + return $content_rev_id } Index: openacs-4/packages/assessment/tcl/as-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-install-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/assessment/tcl/as-install-procs.tcl 8 Jan 2005 10:51:09 -0000 1.16 +++ openacs-4/packages/assessment/tcl/as-install-procs.tcl 13 Jan 2005 17:51:59 -0000 1.17 @@ -35,7 +35,6 @@ content::type::new -content_type {as_sessions} -supertype {content_revision} -pretty_name {Assessment Session} -pretty_plural {Assessment Sessions} -table_name {as_sessions} -id_column {session_id} content::type::new -content_type {as_section_data} -supertype {content_revision} -pretty_name {Assessment Section Data} -pretty_plural {Assessment Sections Data} -table_name {as_section_data} -id_column {section_data_id} content::type::new -content_type {as_item_data} -supertype {content_revision} -pretty_name {Assessment Item Data} -pretty_plural {Assessment Items Data} -table_name {as_item_data} -id_column {item_data_id} -#content::type::new -content_type {as_files} -supertype {content_revision} -pretty_name {Assessment File} -pretty_plural {Assessment Files} -table_name {as_files} -id_column {file_id} # Radiobutton display type content::type::attribute::new -content_type {as_item_display_rb} -attribute_name {html_display_options} -datatype {string} -pretty_name {HTML display Options} -column_spec {varchar(50)} @@ -223,10 +222,6 @@ content::folder::register_content_type -folder_id $folder_id -content_type {as_sessions} -include_subtypes t content::folder::register_content_type -folder_id $folder_id -content_type {as_section_data} -include_subtypes t content::folder::register_content_type -folder_id $folder_id -content_type {as_item_data} -include_subtypes t - content::folder::register_content_type -folder_id $folder_id -content_type {as_files} -include_subtypes t - -# set temp_id [content::template::new -name {as_files_default} -text {@text;noquote@} -is_live {t} -package_id $package_id] -# content::type::register_template -content_type {as_files} -template_id $temp_id -use_context {public} -is_default {t} }