Index: openacs-4/packages/directory/tcl/directory-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/directory/tcl/Attic/directory-procs-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/directory/tcl/directory-procs-oracle.xql 21 Oct 2001 18:16:34 -0000 1.1 +++ openacs-4/packages/directory/tcl/directory-procs-oracle.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -3,7 +3,7 @@ oracle8.1.6 - + select * from ( @@ -19,17 +19,15 @@ - + - select * from ( - select object_id as subsite_id + select object_id as subsite_id, acs_object.name(object_id) as subsite_name from site_nodes n where (select package_key from apm_packages p where p.package_id = n.object_id) = 'acs-subsite' connect by node_id = prior parent_id start with node_id = :node_id order by level - ) where rownum = 1 Index: openacs-4/packages/directory/tcl/directory-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/directory/tcl/Attic/directory-procs-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/directory/tcl/directory-procs-postgresql.xql 21 Oct 2001 18:16:34 -0000 1.1 +++ openacs-4/packages/directory/tcl/directory-procs-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -3,7 +3,7 @@ postgresql7.1 - + select s2.object_id as subsite_id, tree_level(s2.tree_sortkey) as level @@ -17,5 +17,22 @@ + + + + + select s2.object_id as subsite_id, + tree_level(s2.tree_sortkey) as level, + acs_object__name(object_id) as subsite_name + from site_nodes s1, site_nodes s2, apm_packages p + where s1.node_id = :node_id + and s2.tree_sortkey <= s1.tree_sortkey + and s1.tree_sortkey like (s2.tree_sortkey || '%') + and p.package_id = s2.object_id and p.package_key = 'acs-subsite' + order by level + limit 1 + + + Index: openacs-4/packages/directory/tcl/directory-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/directory/tcl/directory-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/directory/tcl/directory-procs.tcl 21 Oct 2001 18:16:34 -0000 1.2 +++ openacs-4/packages/directory/tcl/directory-procs.tcl 27 Oct 2001 00:11:04 -0000 1.3 @@ -108,7 +108,7 @@ # find the closest subsite to the current package on the site_nodes tree # the inner query is guaranteed to always return at least 1 row, # because the Main Site subsite is mounted at / - db_1row subsite_p { + db_1row subsite_p_1 { select * from ( select object_id as subsite_id from site_nodes n @@ -145,7 +145,7 @@ # find the closest subsite to the current package on the site_nodes tree # the inner query is guaranteed to always return at least 1 row, # because the Main Site subsite is mounted at / - db_1row subsite_p { + db_1row subsite_p_2 { select * from ( select object_id as subsite_id, acs_object.name(object_id) as subsite_name from site_nodes n Index: openacs-4/packages/directory/tcl/directory-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/directory/tcl/directory-procs.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/directory/tcl/directory-procs.xql 21 Oct 2001 18:16:34 -0000 1.1 +++ openacs-4/packages/directory/tcl/directory-procs.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -32,7 +32,7 @@ - + select node_id from site_nodes Index: openacs-4/packages/glossary/www/glossary-add-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/glossary-add-edit-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/glossary-add-edit-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/glossary-add-edit-oracle.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -3,6 +3,19 @@ oracle8.1.6 + + + + select g.workflow_key, wf.description as workflow_description, pretty_name as workflow_name + from glossariesx g, wf_workflows wf, acs_object_types ot + where g.workflow_key = wf.workflow_key + and wf.workflow_key = ot.object_type + and g.item_id = :item_id + and g.revision_id = content_item.get_live_revision(:item_id) + + + + Index: openacs-4/packages/glossary/www/glossary-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/glossary-add-edit-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/glossary-add-edit-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/glossary-add-edit-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -3,6 +3,20 @@ postgresql7.1 + + + + select g.workflow_key, wf.description as workflow_description, pretty_name as workflow_name + from glossariesx g, wf_workflows wf, acs_object_types ot + where g.workflow_key = wf.workflow_key + and wf.workflow_key = ot.object_type + and g.item_id = :item_id + and g.revision_id = content_item__get_live_revision(:item_id); + + + + + Index: openacs-4/packages/glossary/www/glossary-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/glossary-add-edit.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/glossary-add-edit.tcl 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/www/glossary-add-edit.tcl 27 Oct 2001 00:11:04 -0000 1.2 @@ -211,9 +211,9 @@ db_dml glossary_update { insert into glossariesi ( - item_id, revision_id, title, description, context_id, creation_user, creation_ip + item_id, revision_id, title, description, context_id, creation_user, creation_ip, workflow_key ) values ( - :item_id, :revision_id, :title, :description, :context_id, :user_id, :peeraddr + :item_id, :revision_id, :title, :description, :context_id, :user_id, :peeraddr, :workflow_key ) } # for right now we are setting things live right away Index: openacs-4/packages/glossary/www/glossary-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/glossary-add-edit.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/glossary-add-edit.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/glossary-add-edit.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -1,26 +1,13 @@ - - - - - select g.workflow_key, wf.description as workflow_description, pretty_name as workflow_name - from glossariesx g, wf_workflows wf, acs_object_types ot - where g.workflow_key = wf.workflow_key - and wf.workflow_key = ot.object_type - and g.item_id = :item_id - - - - insert into glossariesi ( - item_id, revision_id, title, description, context_id, creation_user, creation_ip, package_id + item_id, revision_id, title, description, context_id, creation_user, creation_ip, package_id, workflow_key ) values ( - :item_id, :revision_id, :title, :description, :context_id, :user_id, :peeraddr, :package_id + :item_id, :revision_id, :title, :description, :context_id, :user_id, :peeraddr, :package_id, :workflow_key ) Index: openacs-4/packages/glossary/www/illustration-add-edit-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-add-edit-2-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-add-edit-2-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-add-edit-2-oracle.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -24,6 +24,15 @@ + + + + update cr_revisions + set content_length = dbms_lob.getlength(content) + where revision_id = :revision_id + + + @@ -42,7 +51,7 @@ - + begin @@ -71,19 +80,27 @@ + + + + update cr_revisions + set content_length = dbms_lob.getlength(content) + where revision_id = :new_revision_id + + + - + + + - begin - :1 := content_revision.new( - item_id => :new_item_id, - title => :title, - description => :description, - creation_user => :user_id, - creation_ip => :peeraddr - ); - end; + begin + :1 := acs_object.new( + object_type => 'cr_item_child_rel', + context_id => :term_item_id + ); + end; Index: openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -11,87 +11,107 @@ - - FIX ME LOB update cr_revisions set mime_type = :mime_type, - content = empty_blob() + lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]] where revision_id = :revision_id - returning content into :1 + + + + update cr_revisions + set content_length = lob_length(lob) + where revision_id = :revision_id + + + + - FIX ME PLSQL -FIX ME PLSQL - begin - :1 := content_item__new ( - name => :name, - content_type => 'image', - context_id => :term_item_id, - creation_user => :user_id, - creation_ip => :peeraddr - ); - end; + select content_item__new ( + :name, + NULL, + NULL, + NULL, + current_timestamp, + :user_id, + :term_item_id, + :peeraddr, + 'content_item', + 'image', + NULL, + NULL, + NULL, + NULL, + NULL + ); - + - FIX ME PLSQL -FIX ME PLSQL - begin - :1 := content_revision__new( - item_id => :new_item_id, - title => :title, - description => :description, - creation_user => :user_id, - creation_ip => :peeraddr - ); - end; - + select content_revision__new( + :title, + :description, + current_timestamp, + NULL, + NULL, + NULL, + :new_item_id, + NULL, + current_timestamp, + :user_id, + :peeraddr + ); + - FIX ME LOB update cr_revisions set mime_type = :mime_type, - content = empty_blob() + lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]] where revision_id = :new_revision_id - returning content into :1 + + + + update cr_revisions + set content_length = lob_length(lob) + where revision_id = :new_revision_id + + + + - + - FIX ME PLSQL -FIX ME PLSQL - begin - :1 := content_revision__new( - item_id => :new_item_id, - title => :title, - description => :description, - creation_user => :user_id, - creation_ip => :peeraddr - ); - end; + select acs_object__new( + NULL, + 'cr_item_child_rel', + current_timestamp, + NULL, + NULL, + :term_item_id + ); Index: openacs-4/packages/glossary/www/illustration-add-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-add-edit-2.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/glossary/www/illustration-add-edit-2.tcl 25 Oct 2001 01:52:19 -0000 1.2 +++ openacs-4/packages/glossary/www/illustration-add-edit-2.tcl 27 Oct 2001 00:11:04 -0000 1.3 @@ -89,7 +89,8 @@ where revision_id = :revision_id returning content into :1 } -blob_files [list $tmp_filename] - + + db_dml image_blob_size_1 "" # update the images with the file details db_dml set_revision_live_1 { @@ -125,7 +126,7 @@ end; }] - set new_revision_id [db_exec_plsql term_new_content_revision { + set new_revision_id [db_exec_plsql term_new_content_revision_1 { begin :1 := content_revision.new( item_id => :new_item_id, @@ -194,6 +195,8 @@ where revision_id = :new_revision_id returning content into :1 } -blob_files [list $tmp_filename] + + db_dml image_blob_size_2 "" # update the images with the file details db_dml set_revision_live_3 { @@ -223,7 +226,7 @@ # finally we associate the image with its parent term # i.e. make it an illustration of the term - set rel_id [db_exec_plsql term_new_content_revision { + set rel_id [db_exec_plsql term_new_content_revision_2 { begin :1 := acs_object.new( object_type => 'cr_item_child_rel', Index: openacs-4/packages/glossary/www/illustration-add-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-add-edit-2.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-add-edit-2.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-add-edit-2.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -5,7 +5,7 @@ insert into imagesi ( - item_id, revision_id, title, desciption, context_id, + item_id, revision_id, title, description, context_id, creation_user, creation_ip ) values ( :item_id, :revision_id,:title, :description, Index: openacs-4/packages/glossary/www/illustration-add-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-add-edit-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-add-edit-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-add-edit-oracle.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -7,9 +7,8 @@ select title, description, name - from imagesx im, cr_items i - where im.item_id = :item_id - and im.item_id = i.item_id + from imagesx + where item_id = :item_id and revision_id = content_item.get_latest_revision(:item_id) Index: openacs-4/packages/glossary/www/illustration-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/illustration-add-edit-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-add-edit-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-add-edit-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -7,9 +7,8 @@ select title, description, name - from imagesx im, cr_items i - where im.item_id = :item_id - and im.item_id = i.item_id + from imagesx + where item_id = :item_id and revision_id = content_item__get_latest_revision(:item_id) Index: openacs-4/packages/glossary/www/illustration-bits-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/Attic/illustration-bits-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-bits-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-bits-oracle.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -5,9 +5,11 @@ - select content -from cr_revisions -where revision_id = :revision_id + + select r.content, i.storage_type + from cr_revisions r, cr_items i + where revision_id = $revision_id and i.item_id = r.item_id + Index: openacs-4/packages/glossary/www/illustration-bits-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/Attic/illustration-bits-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-bits-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-bits-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -5,10 +5,12 @@ - FIX ME LOB -select content -from cr_revisions -where revision_id = :revision_id + + select r.lob as content, i.storage_type + from cr_revisions r, cr_items i + where r.item_id = i.item_id + and r.revision_id = :revision_id + Index: openacs-4/packages/glossary/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/index-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/index-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/index-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -6,7 +6,7 @@ - select case count(*) = 0 then 0 else 1 end + select case when count(*) = 0 then 0 else 1 end from wf_user_tasks t, wf_cases c, cr_items i where t.user_id = :user_id and t.state in ('enabled','started') Index: openacs-4/packages/glossary/www/term-add-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/term-add-edit-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/term-add-edit-oracle.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -6,10 +6,11 @@ - select workflow_key from glossariesx - where item_id = :glossary_item_id - and revision_id = content_item.get_live_revision(:glossary_item_id) - + select workflow_key + from glossariesx + where item_id = :glossary_item_id and + revision_id = content_item.get_live_revision(:glossary_item_id) + @@ -85,20 +86,21 @@ - begin - :1 := content_revision.new( - item_id => :new_item_id, - title => :term, - creation_user => :user_id, - creation_ip => :peeraddr - ); - end; + begin + :1 := content_revision.new( + item_id => :new_item_id, + title => :term, + mime_type => :mime_type, + creation_user => :user_id, + creation_ip => :peeraddr + ); + end; - + update cr_revisions Index: openacs-4/packages/glossary/www/term-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/term-add-edit-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/term-add-edit-postgresql.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -14,7 +14,7 @@ - + select workflow_key @@ -33,7 +33,7 @@ select term, definition, publish_status, live_revision, latest_revision, name, mime_type, case acs_permission__permission_p(item_id, :user_id, 'glossary_term_add_illustration') - when 't' then 1, + when 't' then 1 when 'f' then 0 end as illustration_add_p from glossary_terms_latest @@ -54,12 +54,10 @@ - FIX ME LOB - update cr_revisions - set content = empty_blob() - where revision_id = :revision_id - returning content into :1 + update cr_revisions + set content = :definition + where revision_id = :revision_id @@ -81,8 +79,8 @@ 'glossary_term', NULL, NULL, - 'text/plain', NULL, + NULL, NULL ); @@ -97,7 +95,7 @@ :term, NULL, current_timestamp, - 'text/plain', + :mime_type, NULL, NULL, :new_item_id, @@ -113,12 +111,10 @@ - FIX ME LOB - update cr_revisions - set content = empty_blob() - where revision_id = :new_revision_id - returning content into :1 + update cr_revisions + set content = :definition + where revision_id = :new_revision_id Index: openacs-4/packages/glossary/www/term-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/glossary/www/term-add-edit.tcl 25 Oct 2001 01:52:19 -0000 1.2 +++ openacs-4/packages/glossary/www/term-add-edit.tcl 27 Oct 2001 00:11:04 -0000 1.3 @@ -69,7 +69,7 @@ set new_p 1 } -# find out what the workflow is for the parent glossry of this term +# find out what the workflow is for the parent glossary of this term if {[info exists glossary_item_id] && ![empty_string_p $glossary_item_id]} { set glossary_workflow [db_string get_glossary_workflow_1 { select workflow_key from glossariesx @@ -139,7 +139,7 @@ db_with_handle db { template::query get_mime_types mime_types multilist { select label, mime_type - from cr_mime_types + from cr_text_mime_types order by label } -db $db } @@ -190,7 +190,7 @@ db_with_handle db { template::query get_mime_types mime_types multilist { select label, mime_type - from cr_mime_types + from cr_text_mime_types order by label } -db $db } Index: openacs-4/packages/glossary/www/term-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/term-add-edit.xql 25 Oct 2001 01:52:19 -0000 1.1 +++ openacs-4/packages/glossary/www/term-add-edit.xql 27 Oct 2001 00:11:04 -0000 1.2 @@ -4,7 +4,7 @@ select label, mime_type - from cr_mime_types + from cr_text_mime_types order by label Index: openacs-4/packages/glossary/www/term.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/term.tcl 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/www/term.tcl 27 Oct 2001 00:11:04 -0000 1.2 @@ -93,16 +93,16 @@ set term_create_p [ad_permission_p $glossary_item_id glossary_term_create] -set return_url [ad_conn url] +set return_url "[ad_conn url]?item_id=$item_id&glossary_item_id=$glossary_item_id" if [ad_permission_p $item_id glossary_term_comment_on] { - set comment_link [general_comments::create_link $item_id $term $return_url "comment on $term"] + set comment_link [general_comments_create_link -object_name $term -link_text "comment on $term" $item_id $return_url] } else { set comment_link "" } if [ad_permission_p $item_id glossary_term_comment_read] { - set comments [general_comments::get_comments $item_id $return_url] + set comments [general_comments_get_comments -print_content_p 1 $item_id $return_url] } else { set comments "" }