Index: openacs-4/packages/download/tcl/download-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/tcl/download-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/download/tcl/download-procs-postgresql.xql 11 May 2001 05:20:45 -0000 1.2 +++ openacs-4/packages/download/tcl/download-procs-postgresql.xql 14 May 2001 20:31:42 -0000 1.3 @@ -34,8 +34,9 @@ select '[cr_fs_path]' || content as content, storage_type - from cr_revisions - where revision_id = :revision_id + from cr_revisions r, cr_items i + where r.revision_id = :revision_id and + r.item_id = i.item_id @@ -73,7 +74,7 @@ update cr_revisions - set content = '[cr_create_content_file $item_id $revision_id $tmp_filename]' + set content = '[cr_create_content_file $archive_id $revision_id $tmpfile]' where revision_id = :revision_id @@ -83,11 +84,7 @@ - begin - content_item__set_live_revision(:revision_id); - - return 0; - end; + select content_item__set_live_revision(:revision_id); Index: openacs-4/packages/download/www/archive-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/archive-add-2-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/download/www/archive-add-2-postgresql.xql 11 May 2001 05:20:45 -0000 1.2 +++ openacs-4/packages/download/www/archive-add-2-postgresql.xql 14 May 2001 20:31:42 -0000 1.3 @@ -5,12 +5,11 @@ - FIX ME PLSQL - declare v_archive_id integer; v_archive_desc_id integer; v_live_archive_desc_id integer; + v_id integer; v_name cr_items.name%TYPE; begin v_name := 'Download Archive Desc for ' || :archive_id; @@ -34,9 +33,14 @@ 'file' ); - select content_item__get_live_revision(v_archive_desc_id) - into v_live_archive_desc_id; + -- get the latest revision + select into v_live_archive_desc_id + content_item__get_latest_revision (v_archive_desc_id); + -- make it live + select into v_id + content_item__set_live_revision ( v_live_archive_desc_id ); + insert into download_archive_descs (archive_desc_id) values @@ -61,6 +65,14 @@ 'file' ); + -- get the latest revision + select into v_id + content_item__get_latest_revision (v_archive_id); + + -- make it live + select into v_id + content_item__set_live_revision ( v_id ); + insert into download_archives (archive_id, archive_type_id, archive_desc_id) values Index: openacs-4/packages/download/www/download-verify.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/download-verify.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/download/www/download-verify.tcl 11 May 2001 05:20:45 -0000 1.2 +++ openacs-4/packages/download/www/download-verify.tcl 14 May 2001 20:31:42 -0000 1.3 @@ -56,5 +56,5 @@ set reason_widget [ad_db_select_widget -option_list {{"" "Other"}} reasons " select reason, download_reason_id from download_reasons where repository_id = $repository_id" reason_id] -set download_id [db_nextval download_reasons_seq] +set download_id [db_nextval download_reasons_sequence] ad_return_template \ No newline at end of file Index: openacs-4/packages/download/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/download/www/index.tcl 20 Apr 2001 20:51:10 -0000 1.1 +++ openacs-4/packages/download/www/index.tcl 14 May 2001 20:31:42 -0000 1.2 @@ -61,11 +61,12 @@ set approval " and dar.approved_p = 't' " } +#FIXME fix the file size thing set table_def { {archive_name "Software Name" {lower(archive_name) $order} - {  $archive_name $version_name  ([expr $file_size / 1024]k)
$summary}} + {  $archive_name $version_name  ([expr [cr_file_size $file_size] / 1024]k)
$summary}} {archive_type "Software Type" {} {}} {downloads "# Downloads" {} {}} } Index: openacs-4/packages/download/www/admin/repository-ae-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/repository-ae-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/download/www/admin/repository-ae-postgresql.xql 11 May 2001 05:20:45 -0000 1.2 +++ openacs-4/packages/download/www/admin/repository-ae-postgresql.xql 14 May 2001 20:31:42 -0000 1.3 @@ -5,7 +5,6 @@ - begin; select download_rep__new( :repository_id, :title, @@ -17,16 +16,12 @@ :package_id, null ); - - end; - - begin; select download_rep__edit( :repository_id, :title, @@ -36,9 +31,6 @@ :user_id, null ); - - end; - Index: openacs-4/packages/download/www/admin/repository-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/repository-ae.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/download/www/admin/repository-ae.tcl 20 Apr 2001 20:51:10 -0000 1.1 +++ openacs-4/packages/download/www/admin/repository-ae.tcl 14 May 2001 20:31:42 -0000 1.2 @@ -41,7 +41,7 @@ form get_values ae_repository set edit_p [db_string rep_count_get "select count(*) from download_repository_obj where repository_id = :repository_id"] if { $edit_p == "0" } { - db_dml todo_insert { + db_exec_plsql todo_insert { declare the_id integer; begin @@ -55,7 +55,7 @@ end; } } else { - db_dml repository_edit { + db_exec_plsql repository_edit { begin download_rep.edit(repository_id => :repository_id, title => :title,