Index: openacs-4/packages/acs-tcl/tcl/navigation-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/navigation-procs-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/navigation-procs-oracle.xql 6 Jul 2001 00:15:41 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs-oracle.xql 25 Oct 2001 01:52:19 -0000 1.3 @@ -10,7 +10,7 @@ from site_nodes start with node_id = :node_id connect by prior parent_id = node_id - order by level asc + order by level desc Index: openacs-4/packages/glossary/glossary.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/glossary.info,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/glossary.info 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/glossary.info 25 Oct 2001 01:52:19 -0000 1.2 @@ -1,9 +1,10 @@ - + Glossary Glossaries + f f @@ -15,11 +16,11 @@ Users can create glossaries which contain terms and their definitions. 2001-02-06 ArsDigita Corporation - The Glossary Package is based on the ACS 3.x glossary module which was simply a repository for a site's terms and their definitions. - -In the process of migrating the glossary to an ACS 4.0 package, we will expand it's feature set to support multiple contexts. A site, subsite, group, user, or -even document (a this point the document must exist in the database as an ACS object) may have one or more glossaries associated with it. Terms may -have illustrations (acs-content-repository). Each glossary can have its security set (acs-permissions), a workflow, and optionally except user comments. A + The Glossary Package is based on the ACS 3.x glossary module which was simply a repository for a site's terms and their definitions. + +In the process of migrating the glossary to an ACS 4.0 package, we will expand it's feature set to support multiple contexts. A site, subsite, group, user, or +even document (a this point the document must exist in the database as an ACS object) may have one or more glossaries associated with it. Terms may +have illustrations (acs-content-repository). Each glossary can have its security set (acs-permissions), a workflow, and optionally except user comments. A glossary's content will be stored in the content repository and its presentation will use the ArsDigita Templating System (ATS). @@ -32,37 +33,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/glossary/sql/oracle/glossary-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/oracle/glossary-drop.sql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/glossary/sql/oracle/glossary-drop.sql 24 Oct 2001 02:14:36 -0000 1.2 +++ openacs-4/packages/glossary/sql/oracle/glossary-drop.sql 25 Oct 2001 01:52:19 -0000 1.3 @@ -153,6 +153,29 @@ / show errors +-- drop workflows + +drop table full_term_publish_proces_cases; +begin + workflow.drop_workflow('full_term_publish_process_wf'); +end; +/ +show errors + +drop table term_submission_process_cases; +begin + workflow.drop_workflow('term_submission_process_wf'); +end; +/ +show errors + +drop table term_go_live_process_cases; +begin + workflow.drop_workflow('term_go_live_wf'); +end; +/ +show errors + -- finish up drop view glossary_terms_latest; drop view glossary_terms_live_definition; Index: openacs-4/packages/glossary/tcl/glossary-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/tcl/glossary-init.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/tcl/glossary-init.tcl 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/tcl/glossary-init.tcl 25 Oct 2001 01:52:19 -0000 1.2 @@ -56,7 +56,7 @@ $term: " - set definition [db_string definition_display { + set definition [db_string definition_display_1 { select content from cr_revisions where title = :term @@ -68,7 +68,7 @@ # Try again, case insensitively. set caseless_term [string tolower $term] - set definition [db_string definition_display { + set definition [db_string definition_display_2 { select content from cr_revisions where lower(title) = :caseless_term Index: openacs-4/packages/glossary/tcl/glossary-init.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/tcl/glossary-init.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/tcl/glossary-init.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,26 @@ + + + + + + + select content + from cr_revisions cr, glossary_terms gt + where cr.title = :term + and cr.revision_id = gt.term_id + + + + + + + + select content + from cr_revisions cr, glossary_terms gt + where lower(cr.title) = :caseless_term + and cr.revision_id = gt.term_id + + + + + Index: openacs-4/packages/glossary/www/disable-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/disable-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/disable-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,41 @@ + + + + oracle8.1.6 + + + + + select title + from cr_revisions + where item_id = :item_id + and revision_id = content_item.get_live_revision(:item_id) + + + + + + + + begin + content_item.unset_live_revision(:item_id); + end; + + + + + + + + + update acs_objects + set last_modified = sysdate, + modifying_user = :user_id, + modifying_ip = :peeraddr + where object_id = :item_id + + + + + + Index: openacs-4/packages/glossary/www/disable-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/disable-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/disable-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,40 @@ + + + + postgresql7.1 + + + + + select title + from cr_revisions + where item_id = :item_id + and revision_id = content_item__get_live_revision(:item_id) + + + + + + + + + select content_item__unset_live_revision(:item_id); + + + + + + + + + update acs_objects + set last_modified = current_timestamp, + modifying_user = :user_id, + modifying_ip = :peeraddr + where object_id = :item_id + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/glossary-add-edit-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,67 @@ + + + + oracle8.1.6 + + + + + select case when count(*) = 0 then 0 else 1 end + from glossary_termsx + where ( acs_permission.permission_p(item_id, :user_id, 'glossary_term_modify') = 't' or acs_permission.permission_p(item_id, :user_id, 'glossary_term_illustration_add') = 't' or acs_permission.permission_p(item_id, :user_id, 'glossary_term_illustration_modify') = 't') + + + + + + + + + select g.title, i.name, g.description, g.owner_id, i.publish_status, + decode(acs_permission.permission_p(i.item_id, + :user_id, + 'glossary_admin'), + 't', 1, + 'f', 0) as glossary_admin_p + from glossariesx g, cr_items i + where i.item_id = :item_id + and i.publish_status = 'live' + and i.content_type = 'glossary' + and i.live_revision = g.revision_id + + + + + + + + + select acs_object_id_seq.nextval from dual + + + + + + + + + begin + :1 := glossary.new ( + owner_id => :owner_id, + name => :name, + title => :title, + description => :description, + package_id => :package_id, + creation_user => :user_id, + creation_ip => :peeraddr, + context_id => :context_id, + is_live => :is_live + ); + acs_permission.grant_permission(:1,:owner_id, 'glossary_admin'); + end; + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/glossary-add-edit-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,64 @@ + + + + postgresql7.1 + + + + + select case when count(*) = 0 then 0 else 1 end + from glossary_termsx + where ( acs_permission__permission_p(item_id, :user_id, 'glossary_term_modify') = 't' or acs_permission__permission_p(item_id, :user_id, 'glossary_term_illustration_add') = 't' or acs_permission__permission_p(item_id, :user_id, 'glossary_term_illustration_modify') = 't') + + + + + + + + + select g.title, i.name, g.description, g.owner_id, i.publish_status, + case acs_permission__permission_p(i.item_id, :user_id, 'glossary_admin') + when 't' then 1 + when 'f' then 0 + end as glossary_admin_p + from glossariesx g, cr_items i + where i.item_id = :item_id + and i.publish_status = 'live' + and i.content_type = 'glossary' + and i.live_revision = g.revision_id + + + + + + + + + select acs_object_id_seq.nextval + + + + + + + + + select glossary__new ( + :owner_id, + :name, + :title, + :description, + :package_id, + :user_id, + :peeraddr, + :context_id, + :is_live, + 'glossary_admin' + ); + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/glossary-add-edit.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,43 @@ + + + + + + + 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 + ) values ( + :item_id, :revision_id, :title, :description, :context_id, :user_id, :peeraddr, :package_id + ) + + + + + + + + + update cr_items + set live_revision = :revision_id, + name = :name, + publish_status = 'live' + where item_id = :item_id + + + + + + Index: openacs-4/packages/glossary/www/glossary-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/glossary-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/glossary-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,51 @@ + + + + oracle8.1.6 + + + + + select i.item_id as glossary_item_id, title as glossary_title, + description as glossary_description, + decode(acs_permission.permission_p(i.item_id, + :user_id, + 'glossary_modify'), + 't', 1, + 'f', 0) as glossary_edit_p + from glossariesx g, cr_items i + where g.item_id = :item_id + and g.item_id = i.item_id + and i.publish_status = 'live' + and i.content_type = 'glossary' + and publish_date < sysdate + and i.live_revision = g.revision_id + + + + + + + + + select i.item_id as glossary_term_item_id , title as term, + decode(acs_permission.permission_p(i.item_id, + :user_id, + 'glossary_term_modify'), + 't', 1, + 'f', 0) as term_edit_p + from glossary_termsx gt, cr_items i, cr_child_rels ch + where ch.parent_id = :item_id + and ch.child_id = gt.item_id + and i.publish_status = 'live' + and i.content_type = 'glossary_term' + and i.live_revision = gt.revision_id + and publish_date > sysdate -1 + and acs_permission.permission_p(i.item_id, :user_id, 'read') = 't' + order by term + + + + + + Index: openacs-4/packages/glossary/www/glossary-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/glossary-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/glossary-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,49 @@ + + + + postgresql7.1 + + + + + select i.item_id as glossary_item_id, title as glossary_title, + description as glossary_description, + case acs_permission__permission_p(i.item_id, :user_id, 'glossary_modify') + when 't' then 1 + when 'f' then 0 + end as glossary_edit_p + from glossariesx g, cr_items i + where g.item_id = :item_id + and g.item_id = i.item_id + and i.publish_status = 'live' + and i.content_type = 'glossary' + and publish_date < current_timestamp + and i.live_revision = g.revision_id + + + + + + + + + select i.item_id as glossary_term_item_id , title as term, + case acs_permission__permission_p(i.item_id, :user_id, 'glossary_term_modify') + when 't' then 1 + when 'f' then 0 + end as term_edit_p + from glossary_termsx gt, cr_items i, cr_child_rels ch + where ch.parent_id = :item_id + and ch.child_id = gt.item_id + and i.publish_status = 'live' + and i.content_type = 'glossary_term' + and i.live_revision = gt.revision_id + and publish_date > current_timestamp - interval '1 day' + and acs_permission__permission_p(i.item_id, :user_id, 'read') = 't' + order by term + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-add-edit-2-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,92 @@ + + + + oracle8.1.6 + + + + + select acs_object_id_seq.nextval from dual + + + + + + + + + update cr_revisions + set mime_type = :mime_type, + content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + + + + begin + :1 := content_item.new ( + name => :name, + content_type => 'image', + context_id => :term_item_id, + creation_user => :user_id, + creation_ip => :peeraddr + ); + end; + + + + + + + + + begin + :1 := content_revision.new( + item_id => :new_item_id, + title => :title, + description => :description, + creation_user => :user_id, + creation_ip => :peeraddr + ); + end; + + + + + + + + + update cr_revisions + set mime_type = :mime_type, + content = empty_blob() + where revision_id = :new_revision_id + returning content into :1 + + + + + + + + + begin + :1 := content_revision.new( + item_id => :new_item_id, + title => :title, + description => :description, + creation_user => :user_id, + creation_ip => :peeraddr + ); + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-add-edit-2-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,100 @@ + + + + postgresql7.1 + + + + + select acs_object_id_seq.nextval + + + + + + + + FIX ME LOB + + update cr_revisions + set mime_type = :mime_type, + content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + + + 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; + + + + + + + + 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; + + + + + + + + FIX ME LOB + + update cr_revisions + set mime_type = :mime_type, + content = empty_blob() + where revision_id = :new_revision_id + returning content into :1 + + + + + + + + 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; + + + + + + 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.1 -r1.2 --- openacs-4/packages/glossary/www/illustration-add-edit-2.tcl 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/www/illustration-add-edit-2.tcl 25 Oct 2001 01:52:19 -0000 1.2 @@ -82,7 +82,7 @@ # note that this is bad because it doesn't ensure that # text is stored in the db as UTF-8. - db_dml image_blob_update { + db_dml image_blob_update_1 { update cr_revisions set mime_type = :mime_type, content = empty_blob() @@ -92,7 +92,7 @@ # update the images with the file details - db_dml set_revision_live { + db_dml set_revision_live_1 { update images set width =:original_width, height = :original_height @@ -102,7 +102,7 @@ # for right now we are setting things live right away # later this may be dependant on workflow - db_dml set_revision_live { + db_dml set_revision_live_2 { update cr_items set live_revision = :revision_id, name = :name, @@ -187,7 +187,7 @@ # note that this is bad because it doesn't ensure that # text is stored in the db as UTF-8. - db_dml image_blob_update { + db_dml image_blob_update_2 { update cr_revisions set mime_type = :mime_type, content = empty_blob() @@ -196,7 +196,7 @@ } -blob_files [list $tmp_filename] # update the images with the file details - db_dml set_revision_live { + db_dml set_revision_live_3 { update images set width =:original_width, height = :original_height @@ -213,7 +213,7 @@ # for right now we are setting things live right away # display of illustration is inline with term # see term-add-edit.tcl for publish status handling - db_dml set_revision_live { + db_dml set_revision_live_4 { update cr_items set live_revision = :new_revision_id, name = :name, 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-add-edit-2.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,94 @@ + + + + + + + insert into imagesi ( + item_id, revision_id, title, desciption, context_id, + creation_user, creation_ip + ) values ( + :item_id, :revision_id,:title, :description, + :term_item_id, :user_id, :peeraddr + ) + + + + + + + + + update images + set width =:original_width, + height = :original_height + where image_id = :revision_id + + + + + + + + + update cr_items + set live_revision = :revision_id, + name = :name, + publish_status = 'live' + where item_id = :item_id + + + + + + + + + insert into images( + image_id + ) values ( + :new_revision_id + ) + + + + + + + + + update images + set width =:original_width, + height = :original_height + where image_id = :new_revision_id + + + + + + + + update cr_items + set live_revision = :new_revision_id, + name = :name, + publish_status = 'live' + where item_id = :new_item_id + + + + + + + + + insert into cr_child_rels ( + rel_id, parent_id, child_id, relation_tag + ) values ( + :rel_id, :term_item_id, :new_item_id, 'illustration' + ) + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-add-edit-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,19 @@ + + + + oracle8.1.6 + + + + + select title, description, name + from imagesx im, cr_items i + where im.item_id = :item_id + and im.item_id = i.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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-add-edit-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,19 @@ + + + + postgresql7.1 + + + + + select title, description, name + from imagesx im, cr_items i + where im.item_id = :item_id + and im.item_id = i.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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-bits-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,15 @@ + + + + oracle8.1.6 + + + + select content +from cr_revisions +where revision_id = :revision_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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-bits-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,16 @@ + + + + postgresql7.1 + + + + FIX ME LOB +select content +from cr_revisions +where revision_id = :revision_id + + + + + Index: openacs-4/packages/glossary/www/illustration-bits.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/Attic/illustration-bits.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/illustration-bits.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + select mime_type +from cr_revisions +where revision_id = :revision_id + + + + + Index: openacs-4/packages/glossary/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/index-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/index-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,53 @@ + + + + oracle8.1.6 + + + + + select decode(count(*), 0, 0, 1) + from wf_user_tasks t, wf_cases c, cr_items i + where t.user_id = :user_id + and t.state in ('enabled','started') + and i.content_type = 'glossary_term' + and i.item_id = c.object_id + and t.case_id = c.case_id + + + + + + + + select package_key, acs_object.name(package_id) package_title + from apm_packages + where package_id = :package_id + + + + + + + + + select i.item_id, title, party.name(owner_id) as owner_name, + decode(acs_permission.permission_p(i.item_id, + :user_id, + 'glossary_admin'), + 't', 1, + 'f', 0) as admin_p + from glossariesx g, cr_items i + where i.publish_status = 'live' + and i.content_type = 'glossary' + and i.live_revision = g.revision_id + and publish_date < sysdate + and acs_permission.permission_p(i.item_id, :user_id, 'read') = 't' + and g.package_id = :package_id + order by title + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/index-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,52 @@ + + + + postgresql7.1 + + + + + select case 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') + and i.content_type = 'glossary_term' + and i.item_id = c.object_id + and t.case_id = c.case_id + + + + + + + + select package_key, acs_object__name(package_id) as package_title + from apm_packages + where package_id = :package_id + + + + + + + + + select i.item_id, title, party__name(owner_id) as owner_name, + case acs_permission__permission_p(i.item_id, :user_id, 'glossary_admin') + when 't' then 1 + when 'f' then 0 + end as admin_p + from glossariesx g, cr_items i + where i.publish_status = 'live' + and i.content_type = 'glossary' + and i.live_revision = g.revision_id + and publish_date < current_timestamp + and acs_permission__permission_p(i.item_id, :user_id, 'read') = 't' + and g.package_id = :package_id + order by title + + + + + + Index: openacs-4/packages/glossary/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/index.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/www/index.tcl 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/www/index.tcl 25 Oct 2001 01:52:19 -0000 1.2 @@ -43,7 +43,7 @@ }] if {$admin_p} { - set workflow_p [db_string get_workflow_p { + set workflow_p [db_string get_workflow_p_1 { select decode(count(*), 0, 0, 1) from wf_user_tasks t, wf_cases c, cr_items i where t.state in ('enabled','started') @@ -52,7 +52,7 @@ and t.case_id = c.case_id }] } else { - set workflow_p [db_string get_workflow_p { + set workflow_p [db_string get_workflow_p_2 { select decode(count(*), 0, 0, 1) from wf_user_tasks t, wf_cases c, cr_items i where t.user_id = :user_id Index: openacs-4/packages/glossary/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/index.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/index.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,44 @@ + + + + + + + select case when count(*) = 0 then 0 else 1 end + from acs_permissions p, cr_items i + where grantee_id = :user_id + and i.content_type = 'glossary' + and item_id = object_id + + + + + + + + + select case when count(*) = 0 then 0 else 1 end + from wf_user_tasks t, wf_cases c, cr_items i + where t.state in ('enabled','started') + and i.content_type = 'glossary_term' + and i.item_id = c.object_id + and t.case_id = c.case_id + + + + + + + + select s1.name + from site_nodes s1, site_nodes s2, apm_packages p + where package_key = 'acs-workflow' + and s1.object_id = package_id + and s1.parent_id = s2.parent_id + and s2.node_id = :node_id + + + + + + Index: openacs-4/packages/glossary/www/package-administer-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/package-administer-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/package-administer-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,22 @@ + + + + oracle8.1.6 + + + + + select i.item_id, title, party.name(owner_id) as owner_name, publish_date, publish_status, live_revision + from glossariesx g, cr_items i + where i.content_type = 'glossary' + and i.item_id = g.item_id + and acs_permission.permission_p(i.item_id, :user_id, 'glossary_admin') = 't' + and g.package_id = :package_id + and g.revision_id = content_item.get_latest_revision(i.item_id) + order by title + + + + + + Index: openacs-4/packages/glossary/www/package-administer-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/package-administer-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/package-administer-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,22 @@ + + + + postgresql7.1 + + + + + select i.item_id, title, party__name(owner_id) as owner_name, publish_date, publish_status, live_revision + from glossariesx g, cr_items i + where i.content_type = 'glossary' + and i.item_id = g.item_id + and acs_permission__permission_p(i.item_id, :user_id, 'glossary_admin') = 't' + and g.package_id = :package_id + and g.revision_id = content_item__get_latest_revision(i.item_id) + order by title + + + + + + Index: openacs-4/packages/glossary/www/publish-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/publish-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/publish-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,42 @@ + + + + oracle8.1.6 + + + + + select title, revision_id + from cr_revisions + where item_id = :item_id + and revision_id = content_item.get_latest_revision(:item_id) + + + + + + + + + begin + content_item.set_live_revision(:revision_id, 'live'); + end; + + + + + + + + + update acs_objects + set last_modified = sysdate, + modifying_user = :user_id, + modifying_ip = :peeraddr + where object_id = :item_id + + + + + + Index: openacs-4/packages/glossary/www/publish-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/publish-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/publish-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,38 @@ + + + + postgresql7.1 + + + + + select title, revision_id + from cr_revisions + where item_id = :item_id + and revision_id = content_item__get_latest_revision(:item_id) + + + + + + + + select content_item__set_live_revision(:revision_id, 'live'); + + + + + + + + update acs_objects + set last_modified = current_timestamp, + modifying_user = :user_id, + modifying_ip = :peeraddr + where object_id = :item_id + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/term-add-edit-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,127 @@ + + + + oracle8.1.6 + + + + + 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 g, cr_child_rels ch + where g.item_id = ch.parent_id + and ch.child_id = :item_id + and revision_id = content_item.get_live_revision(g.item_id) + + + + + + + + + select term, definition, publish_status, + live_revision, latest_revision, name, mime_type, + decode(acs_permission.permission_p(item_id, + :user_id, + 'glossary_term_add_illustration'), + 't', 1, + 'f', 0) as illustration_add_p + from glossary_terms_latest + where item_id = :item_id + + + + + + + + + select acs_object_id_seq.nextval from dual + + + + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + + + + begin + :1 := content_item.new ( + name => :name, + content_type => 'glossary_term', + context_id => :glossary_item_id, + creation_user => :user_id, + creation_ip => :peeraddr + ); + end; + + + + + + + + + begin + :1 := content_revision.new( + item_id => :new_item_id, + title => :term, + creation_user => :user_id, + creation_ip => :peeraddr + ); + end; + + + + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :new_revision_id + returning content into :1 + + + + + + + + + begin + :1 := acs_object.new( + object_type => 'cr_item_child_rel', + context_id => :glossary_item_id + ); + end; + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/term-add-edit-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,141 @@ + + + + postgresql7.1 + + + + + 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 g, cr_child_rels ch + where g.item_id = ch.parent_id + and ch.child_id = :item_id + and revision_id = content_item__get_live_revision(g.item_id) + + + + + + + + + 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 'f' then 0 + end as illustration_add_p + from glossary_terms_latest + where item_id = :item_id + + + + + + + + + select acs_object_id_seq.nextval + + + + + + + + FIX ME LOB + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + + + + select content_item__new ( + :name, + NULL, + NULL, + NULL, + current_timestamp, + :user_id, + :glossary_item_id, + :peeraddr, + 'content_item', + 'glossary_term', + NULL, + NULL, + 'text/plain', + NULL, + NULL + ); + + + + + + + + + select content_revision__new( + :term, + NULL, + current_timestamp, + 'text/plain', + NULL, + NULL, + :new_item_id, + NULL, + current_timestamp, + :user_id, + :peeraddr + ); + + + + + + + + FIX ME LOB + + update cr_revisions + set content = empty_blob() + where revision_id = :new_revision_id + returning content into :1 + + + + + + + + select acs_object__new( + NULL, + 'cr_item_child_rel', + current_timestamp, + NULL, + NULL, + :glossary_item_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.1 -r1.2 --- openacs-4/packages/glossary/www/term-add-edit.tcl 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/www/term-add-edit.tcl 25 Oct 2001 01:52:19 -0000 1.2 @@ -71,13 +71,13 @@ # find out what the workflow is for the parent glossry of this term if {[info exists glossary_item_id] && ![empty_string_p $glossary_item_id]} { - set glossary_workflow [db_string get_glossary_workflow { + set glossary_workflow [db_string get_glossary_workflow_1 { select workflow_key from glossariesx where item_id = :glossary_item_id and revision_id = content_item.get_live_revision(:glossary_item_id) }] } else { - set glossary_workflow [db_string get_glossary_workflow { + set glossary_workflow [db_string get_glossary_workflow_2 { select workflow_key from glossariesx g, cr_child_rels ch where g.item_id = ch.parent_id @@ -137,7 +137,7 @@ -value $definition db_with_handle db { - template::query mime_types multilist { + template::query get_mime_types mime_types multilist { select label, mime_type from cr_mime_types order by label @@ -188,7 +188,7 @@ -datatype text db_with_handle db { - template::query mime_types multilist { + template::query get_mime_types mime_types multilist { select label, mime_type from cr_mime_types order by label @@ -246,15 +246,15 @@ } if {![empty_string_p $definition]} { - db_dml term_definition_update { + db_dml term_definition_update_1 { update cr_revisions set content = empty_blob() where revision_id = :revision_id returning content into :1 } -blobs [list $definition] } - db_dml set_revision_live { + db_dml set_revision_live_1 { update cr_items set live_revision = :revision_id, name = :name, @@ -278,7 +278,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, @@ -298,15 +298,15 @@ } if {![empty_string_p $definition]} { - db_dml term_definition_update { + db_dml term_definition_update_2 { update cr_revisions set content = empty_blob() where revision_id = :new_revision_id returning content into :1 } -blobs [list $definition] } - db_dml set_revision_live { + db_dml set_revision_live_2 { update cr_items set live_revision = :new_revision_id, name = :name, @@ -315,7 +315,7 @@ } # we associate the term with its parent glossary - 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/term-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-add-edit.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/term-add-edit.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,97 @@ + + + + + + select label, mime_type + from cr_mime_types + order by label + + + + + + + select child_id as illustration_item_id from cr_child_rels + where relation_tag = 'illustration' and parent_id = :item_id + + + + + + + + select parent_id from cr_child_rels + where child_id = :item_id and relation_tag = 'parent glossary' + + + + + + + + insert into glossary_termsi ( + item_id, revision_id, title, context_id, + creation_user, creation_ip + ) values ( + :item_id, :revision_id, + :term, :glossary_item_id, :user_id, :peeraddr + ) + + + + + + + + + update cr_items + set live_revision = :revision_id, + name = :name, + publish_status = :publish_status + where item_id = :item_id + + + + + + + + + insert into glossary_terms ( + term_id + ) values ( + :new_revision_id + ) + + + + + + + + + update cr_items + set live_revision = :new_revision_id, + name = :name, + publish_status = :publish_status + where item_id = :new_item_id + + + + + + + + + insert into cr_child_rels ( + rel_id, parent_id, child_id, relation_tag + ) values ( + :rel_id, :glossary_item_id, :new_item_id, 'parent glossary' + ) + + + + + + Index: openacs-4/packages/glossary/www/term-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/term-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,33 @@ + + + + oracle8.1.6 + + + + + select term, definition, + revision_id, item_id, name, mime_type, + decode(acs_permission.permission_p(item_id, + :user_id, + 'glossary_term_modify'), + 't', 1, + 'f', 0) as term_modify_p + from glossary_terms_live_definition + where item_id = :item_id + + + + + + + + +select title from glossariesx +where revision_id = content_item.get_live_revision(:glossary_item_id) + + + + + + Index: openacs-4/packages/glossary/www/term-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/term-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,32 @@ + + + + postgresql7.1 + + + + + select term, definition, + revision_id, item_id, name, mime_type, + case acs_permission__permission_p(item_id, :user_id, 'glossary_term_modify') + when 't' then 1 + when 'f' then 0 + end as term_modify_p + from glossary_terms_live_definition + where item_id = :item_id + + + + + + + + +select title from glossariesx +where revision_id = content_item__get_live_revision(:glossary_item_id) + + + + + + Index: openacs-4/packages/glossary/www/term.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/term.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/term.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,44 @@ + + + + + + + select i.item_id as illustration_item_id, + live_revision as illustration_revision_id + from cr_child_rels ch, cr_items i + where relation_tag = 'illustration' + and ch.parent_id = :item_id + and ch.child_id = i.item_id + and publish_status = 'live' + + + + + + + + select i.width, i.height, cr.title as ill_title, + cr.description as ill_description, cr.publish_date + from images i, cr_revisions cr + where i.image_id = cr.revision_id + and image_id = :illustration_revision_id + + + + + + + + + select ch.parent_id as glossary_item_id + from cr_child_rels ch, cr_items i + where child_id = :item_id + and relation_tag = 'parent glossary' + and ch.parent_id = item_id + and live_revision is not null + + + + + Index: openacs-4/packages/glossary/www/terms-pending-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/terms-pending-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/terms-pending-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,43 @@ + + + + oracle8.1.6 + + + + + select i.item_id as glossary_item_id, title as glossary_title, + description as glossary_description, i.publish_status as glossary_status, + decode(acs_permission.permission_p(i.item_id, + :user_id, + 'glossary_modify'), + 't', 1, + 'f', 0) as glossary_edit_p + from glossariesx g, cr_items i + where g.item_id = :item_id + and g.item_id = i.item_id + and i.content_type = 'glossary' + and i.live_revision = g.revision_id + + + + + + + + + select i.item_id as glossary_term_item_id , title as term, publish_status as term_status + from glossary_termsx gt, cr_items i, cr_child_rels ch + where ch.parent_id = :item_id + and ch.child_id = gt.item_id + and i.publish_status != 'live' + and i.content_type = 'glossary_term' + and i.live_revision = gt.revision_id + and acs_permission.permission_p(i.item_id, :user_id, 'glossary_term_modify') = 't' + order by term + + + + + + Index: openacs-4/packages/glossary/www/terms-pending-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/terms-pending-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/terms-pending-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,42 @@ + + + + postgresql7.1 + + + + + select i.item_id as glossary_item_id, title as glossary_title, + description as glossary_description, i.publish_status as glossary_status, + case acs_permission__permission_p(i.item_id, :user_id, 'glossary_modify') + when 't' then 1 + when 'f' then 0 + end as glossary_edit_p + from glossariesx g, cr_items i + where g.item_id = :item_id + and g.item_id = i.item_id + and i.content_type = 'glossary' + and i.live_revision = g.revision_id + + + + + + + + + select i.item_id as glossary_term_item_id , title as term, publish_status as term_status + from glossary_termsx gt, cr_items i, cr_child_rels ch + where ch.parent_id = :item_id + and ch.child_id = gt.item_id + and i.publish_status != 'live' + and i.content_type = 'glossary_term' + and i.live_revision = gt.revision_id + and acs_permission__permission_p(i.item_id, :user_id, 'glossary_term_modify') = 't' + order by term + + + + + + Index: openacs-4/packages/glossary/www/workflow-add-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/workflow-add-edit-oracle.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/workflow-add-edit-oracle.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,31 @@ + + + + oracle8.1.6 + + + + + select g.title as glossary_title, g.revision_id + from glossariesx g + where g.item_id = :item_id + and g.revision_id = content_item.get_latest_revision(:item_id) + + + + + + + + + update acs_objects + set last_modified = sysdate, + modifying_user = :user_id, + modifying_ip = :peeraddr + where object_id = :item_id + + + + + + Index: openacs-4/packages/glossary/www/workflow-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/workflow-add-edit-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/workflow-add-edit-postgresql.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,31 @@ + + + + postgresql7.1 + + + + + select g.title as glossary_title, g.revision_id + from glossariesx g + where g.item_id = :item_id + and g.revision_id = content_item__get_latest_revision(:item_id) + + + + + + + + + update acs_objects + set last_modified = current_timestamp, + modifying_user = :user_id, + modifying_ip = :peeraddr + where object_id = :item_id + + + + + + Index: openacs-4/packages/glossary/www/workflow-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/www/workflow-add-edit.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/www/workflow-add-edit.xql 25 Oct 2001 01:52:19 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + + select wf.workflow_key as possible_workflow_key, + wf.description as possible_description, pretty_name as possible_workflow_name + from wf_workflows wf, acs_object_types ot + where workflow_key like '%term%' + and wf.workflow_key = ot.object_type + + + + + + + + + update glossaries + set workflow_key = :new_workflow_key + where glossary_id = :revision_id + + + + + +