Index: openacs-4/packages/cms/tcl/content-method-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/content-method-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/content-method-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + select count(*) + from cr_content_mime_type_map + where mime_type like ('%text/%') + and content_type = :content_type + + + Index: openacs-4/packages/cms/tcl/item-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/item-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/item-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,76 @@ + + + + oracle8.1.6 + + + + + select content_item.get_best_revision(:item_id) from dual + + + + + + + + + select content_item.get_path(:item_id) from dual + + + + + + + + + select content_item.get_template(:item_id, :context) as template_id + from dual + + + + + + + + select content_item.is_publishable(:item_id) from dual + + + + + + + + + select content_item.get_title(:item_id) from dual + + + + + + + select content_item.get_id(:url + + + + + + , :root_folder + + + + + + ) from dual + + + + + + + , content.blob_to_string(content) as text + + + + + Index: openacs-4/packages/cms/tcl/item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/item-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/item-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,76 @@ + + + + postgresql7.1 + + + + + select content_item__get_best_revision(:item_id) + + + + + + + + + select content_item__get_path(:item_id) + + + + + + + + + select content_item__get_template(:item_id, :context) as template_id + + + + + + + + + select content_item__is_publishable(:item_id) + + + + + + + + + select content_item__get_title(:item_id) + + + + + + + select content_item__get_id(:url + + + + + + , :root_folder + + + + + + ) + + + + + + + , content__blob_to_string(content) as text + + + + + Index: openacs-4/packages/cms/tcl/item-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/item-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/item-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,104 @@ + + + + + + + select live_revision from cr_items + where item_id = :item_id + + + + + + + + select item_id from cr_revisions where revision_id = :revision_id + + + + + + + + + select + m.mime_type, m.file_extension + from + cr_mime_types m, cr_revisions r + where + r.mime_type = m.mime_type + and + r.revision_id = :revision_id + + + + + + + + + select content_type from cr_items where + item_id = :item_id + + + + + + + + + select 't' from cr_revisions + where revision_id = :revision_id + and content is not null + + + + + + + + select mime_type from cr_content_mime_type_map + where content_type = :content_type + and lower(mime_type) like 'text/%' + + + + + + + + + select table_name from acs_object_types + where object_type = :content_type + + + + + + + + select + x.*, + :item_id as item_id $text_sql, + :content_type as content_type + from + cr_revisions r, ${table_name}x x + where + r.revision_id = :revision_id + and + x.revision_id = r.revision_id + + + + + + + + + select publish_status from cr_items where item_id = :item_id + + + + + \ No newline at end of file Index: openacs-4/packages/cms/tcl/module-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/module-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,207 @@ + + + + oracle8.1.6 + + + + select + item_id, + content_item.get_path(item_id, :sorted_paths_root_id) as item_path, + content_type as item_type + from + cr_items + where + item_id in ($sql_id_list) + order by item_path + + + + + + + + select + :mount_point as mount_point, + r.name, + r.item_id, + '' as children, + nvl((select 't' from dual where exists + (select 1 from cr_folders f_child, cr_resolved_items r_child + where r_child.parent_id = r.resolved_id + and f_child.folder_id = r_child.resolved_id)), 'f') expandable, + r.is_symlink symlink, + 0 update_time + from + cr_folders f, cr_resolved_items r + where + r.parent_id = :id + and + r.resolved_id = f.folder_id + order by + name + + + + + + + + select content_template.get_root_folder() from dual + + + + + + + + select content_item.get_root_folder() from dual + + + + + + + + select + lpad(' ', level, '-') || pretty_name as label, + object_type as value + from + acs_object_types t + connect by + supertype = prior object_type + start with + object_type = 'content_revision' + + + + + + + + + select + :mount_point as mount_point, + r.name, + r.item_id, + '' as children, + nvl((select 't' from dual where exists + (select 1 from cr_folders f_child, cr_resolved_items r_child + where r_child.parent_id = r.resolved_id + and f_child.folder_id = r_child.resolved_id)), 'f') expandable, + r.is_symlink symlink, + 0 update_time + from + cr_folders f, cr_resolved_items r + where + r.parent_id = :id + and + r.resolved_id = f.folder_id + order by + name + + + + + + + + select + :module_name as mount_point, + content_keyword.get_heading(keyword_id) as name, + keyword_id, + '' as children, + NVL( (select 't' from dual + where exists ( + select 1 from cr_keywords k2 + where k2.parent_id = k.keyword_id + and content_keyword.is_leaf(k2.keyword_id) = 'f')), + 'f') as expandable, + 'f' as symlink, + 0 as update_time + from + cr_keywords k + where + $where_clause + and + content_keyword.is_leaf(keyword_id) = 'f' + order by + name + + + + + + + + select + :mount_point as mount_point, + r.name, + r.item_id, + '' as children, + nvl((select 't' from dual where exists + (select 1 from cr_folders f_child, cr_resolved_items r_child + where r_child.parent_id = r.resolved_id + and f_child.folder_id = r_child.resolved_id)), 'f') expandable, + r.is_symlink symlink, + 0 update_time + from + cr_folders f, cr_resolved_items r + where + r.parent_id = :id + and + r.resolved_id = f.folder_id + order by + name + + + + + + select + item_id, + content_item.get_path(item_id, :sorted_paths_root_id) as item_path, + content_type as item_type + from + cr_items + where + item_id in ($sql_id_list) + order by item_path + + + + + + + select + keyword_id as item_id, + content_keyword.get_path(keyword_id) as item_path, + 'content_keyword' as item_type + from + cr_keywords + where + keyword_id in ($sql_id_list) + + + + + + + + select + o.object_id as item_id, + o.object_type || ': ' || acs_object.name(o.object_id) as item_path, + o.object_type as item_type + from + acs_objects o, parties p + where + o.object_id = p.party_id + and + o.object_id in ($sql_id_list) + order by + item_path + + + + + Index: openacs-4/packages/cms/tcl/module-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/module-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,210 @@ + + + + postgresql7.1 + + + + select + item_id, + content_item__get_path(item_id, :sorted_paths_root_id) as item_path, + content_type as item_type + from + cr_items + where + item_id in ($sql_id_list) + order by item_path + + + + + + + + select + :mount_point as mount_point, + r.name, + r.item_id, + '' as children, + coalesce((select 't' where exists + (select 1 from cr_folders f_child, cr_resolved_items r_child + where r_child.parent_id = r.resolved_id + and f_child.folder_id = r_child.resolved_id)), 'f') expandable, + r.is_symlink symlink, + 0 update_time + from + cr_folders f, cr_resolved_items r + where + r.parent_id = :id + and + r.resolved_id = f.folder_id + order by + name + + + + + + + + select content_template__get_root_folder() + + + + + + + + select content_item__get_root_folder() + + + + + + + FIX ME CONNECT BY + + select + lpad(' ', level, '-') || pretty_name as label, + object_type as value + from + acs_object_types t + connect by + supertype = prior object_type + start with + object_type = 'content_revision' + + + + + + + + + select + :mount_point as mount_point, + r.name, + r.item_id, + '' as children, + coalesce((select 't' where exists + (select 1 from cr_folders f_child, cr_resolved_items r_child + where r_child.parent_id = r.resolved_id + and f_child.folder_id = r_child.resolved_id)), 'f') expandable, + r.is_symlink symlink, + 0 update_time + from + cr_folders f, cr_resolved_items r + where + r.parent_id = :id + and + r.resolved_id = f.folder_id + order by + name + + + + + + + + select + :module_name as mount_point, + content_keyword__get_heading(keyword_id) as name, + keyword_id, + '' as children, + coalesce( (select 't' + where exists ( + select 1 from cr_keywords k2 + where k2.parent_id = k.keyword_id + and content_keyword__is_leaf(k2.keyword_id) = 'f')), + 'f') as expandable, + 'f' as symlink, + 0 as update_time + from + cr_keywords k + where + $where_clause + and + content_keyword__is_leaf(keyword_id) = 'f' + order by + name + + + + + + + + select + :mount_point as mount_point, + r.name, + r.item_id, + '' as children, + coalesce((select 't' where exists + (select 1 from cr_folders f_child, cr_resolved_items r_child + where r_child.parent_id = r.resolved_id + and f_child.folder_id = r_child.resolved_id)), 'f') expandable, + r.is_symlink symlink, + 0 update_time + from + cr_folders f, cr_resolved_items r + where + r.parent_id = :id + and + r.resolved_id = f.folder_id + order by + name + + + + + + + select + item_id, + content_item__get_path(item_id, :sorted_paths_root_id) as item_path, + content_type as item_type + from + cr_items + where + item_id in ($sql_id_list) + order by item_path + + + + + + + + select + keyword_id as item_id, + content_keyword__get_path(keyword_id) as item_path, + 'content_keyword' as item_type + from + cr_keywords + where + keyword_id in ($sql_id_list) + + + + + + + + select + o.object_id as item_id, + o.object_type || ': ' || acs_object__name(o.object_id) as item_path, + o.object_type as item_type + from + acs_objects o, parties p + where + o.object_id = p.party_id + and + o.object_id in ($sql_id_list) + order by + item_path + + + + + Index: openacs-4/packages/cms/tcl/module-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/module-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,41 @@ + + + + + + + select module_id from cm_modules + where key = :module_name + + + + + + + + + select + key, name, '' as id, + '' as children, 't' as expandable, 'f' as symlink, + 0 as update_time + from cm_modules + order by sort_key + + + + + + + + select + :module_name as mount_point, + name, key, '' as children, + 'f' as expandable, + 'f' as symlink, + 0 as update_type + from cm_modules order by sort_key + + + + + Index: openacs-4/packages/cms/tcl/pagination-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/pagination-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/pagination-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,21 @@ + + + + + + + select * + from + ( + select + x.*, rownum as row_id + from + ($sql) x + ) ordered_sql_query_with_row_id + where + row_id between $start_row and $start_row + $rows_per_page - 1 + + + + + Index: openacs-4/packages/cms/tcl/pagination-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/pagination-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/pagination-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,21 @@ + + + + + + + select * + from + ( + $sql + ) ordered_sql_query_with_row_id + LIMIT + $rows_per_page + OFFSET + $start_row + + + + + + Index: openacs-4/packages/cms/tcl/pagination-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/pagination-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/pagination-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + + + select + ceil(count(*) / [pagination::get_rows_per_page] ) + from + ($sql) + + + + + + Index: openacs-4/packages/cms/tcl/perm-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/perm-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/perm-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,220 @@ + + + + oracle8.1.6 + + + + + set is_request [form is_request $perm_form_name] + + + + set permission_options [list] + set permission_values [list] + + template::query permission_boxes multirow $__sql " + select + t.child_privilege as privilege, + lpad(' ', t.tree_level * 24, ' ') || + NVL(p.pretty_name, t.child_privilege) as label, + cms_permission.permission_p( + :object_id, :grantee_id, t.child_privilege + ) as permission_p, + cms_permission.permission_p ( + :object_id, :grantee_id, t.privilege + ) as parent_permission_p + from ( + select privilege, child_privilege, level as tree_level + from acs_privilege_hierarchy + connect by privilege = prior child_privilege + start with privilege = 'cm_root' + ) t, acs_privileges p + where + p.privilege = t.child_privilege + and ( + cms_permission.has_grant_authority ( + :object_id, :user_id, t.child_privilege + ) = 't' + or + cms_permission.has_revoke_authority ( + :object_id, :user_id, t.child_privilege, :grantee_id + ) = 't' + ) + " -eval { + if { [string equal $row(parent_permission_p) f] } { + lappend permission_options [list $row(label) $row(privilege)] + if { [string equal $row(permission_p) t] && $is_request } { + lappend permission_values $row(privilege) + } + } + } + + + + + + element create $perm_form_name object_id -label "Object ID" \ + -datatype integer -widget hidden -param + + element create $perm_form_name grantee_id -label "Grantee ID" \ + -datatype integer -widget hidden -param + + element create $perm_form_name pf_boxes -label "Permissions" \ + -datatype text -widget checkbox -options $permission_options \ + -values $permission_values -optional + + element create $perm_form_name pf_is_recursive \ + -label "Apply changes to child items and subfolders ?" \ + -datatype text \ + -widget radio -options { {Yes t} {No f} } -values { f } + + + + + + + + + + if { [form is_valid $perm_form_name] } { + + set user_id [User::getID] + + form get_values $perm_form_name object_id grantee_id pf_is_recursive + set permission_values [element get_values $perm_form_name pf_boxes] + + db_transaction { + + + foreach pair $permission_options { + set privilege [lindex $pair 1] + if { [lsearch $permission_values $privilege] >= 0 } { + template::query pfp_grant_permission grant_permission dml $__sql_grant " + begin + cms_permission.grant_permission ( + item_id => :object_id, + holder_id => :user_id, + privilege => :privilege, + recepient_id => :grantee_id, + is_recursive => :pf_is_recursive + ); + end;" + } else { + template::query pfp_revoke_permission revoke_permission dml $__sql_revoke" + begin + cms_permission.revoke_permission ( + item_id => :object_id, + holder_id => :user_id, + privilege => :privilege, + revokee_id => :grantee_id, + is_recursive => :pf_is_recursive + ); + end;" + } + } + + } + + + content::check_access $object_id "cm_read" \ + -user_id $user_id -refresh + + } + + + + + + + + + select + p.privilege, + cms_permission.permission_p ( + :object_id, :user_id, p.privilege + ) as is_granted + from + acs_privileges p + + + + + + + + select + acs_object.name(:object_id) as obj_name, + pretty_name as perm_name + from + acs_privileges + where + privilege = :privilege + + + + + + + select + t.child_privilege as privilege, + lpad(' ', t.tree_level * 24, ' ') || + NVL(p.pretty_name, t.child_privilege) as label, + cms_permission.permission_p( + :object_id, :grantee_id, t.child_privilege + ) as permission_p, + cms_permission.permission_p ( + :object_id, :grantee_id, t.privilege + ) as parent_permission_p + from ( + select privilege, child_privilege, level as tree_level + from acs_privilege_hierarchy + connect by privilege = prior child_privilege + start with privilege = 'cm_root' + ) t, acs_privileges p + where + p.privilege = t.child_privilege + and ( + cms_permission.has_grant_authority ( + :object_id, :user_id, t.child_privilege + ) = 't' + or + cms_permission.has_revoke_authority ( + :object_id, :user_id, t.child_privilege, :grantee_id + ) = 't' + ) + + + + + + + begin + cms_permission.grant_permission ( + item_id => :object_id, + holder_id => :user_id, + privilege => :privilege, + recepient_id => :grantee_id, + is_recursive => :pf_is_recursive + ); + end; + + + + + + + begin + cms_permission.revoke_permission ( + item_id => :object_id, + holder_id => :user_id, + privilege => :privilege, + revokee_id => :grantee_id, + is_recursive => :pf_is_recursive + ); + end; + + + + + Index: openacs-4/packages/cms/tcl/perm-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/perm-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/perm-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,212 @@ + + + + postgresql7.1 + + + + FIX ME CONNECT BY + + set is_request [form is_request $perm_form_name] + + + + set permission_options [list] + set permission_values [list] + + template::query permission_boxes multirow $__sql " + select + t.child_privilege as privilege, + lpad(' ', t.tree_level * 24, ' ') || + NVL(p.pretty_name, t.child_privilege) as label, + cms_permission__permission_p( + :object_id, :grantee_id, t.child_privilege + ) as permission_p, + cms_permission__permission_p ( + :object_id, :grantee_id, t.privilege + ) as parent_permission_p + from ( + select privilege, child_privilege, level as tree_level + from acs_privilege_hierarchy + connect by privilege = prior child_privilege + start with privilege = 'cm_root' + ) t, acs_privileges p + where + p.privilege = t.child_privilege + and ( + cms_permission__has_grant_authority ( + :object_id, :user_id, t.child_privilege + ) = 't' + or + cms_permission__has_revoke_authority ( + :object_id, :user_id, t.child_privilege, :grantee_id + ) = 't' + ) + " -eval { + if { [string equal $row(parent_permission_p) f] } { + lappend permission_options [list $row(label) $row(privilege)] + if { [string equal $row(permission_p) t] && $is_request } { + lappend permission_values $row(privilege) + } + } + } + + + + + + element create $perm_form_name object_id -label "Object ID" \ + -datatype integer -widget hidden -param + + element create $perm_form_name grantee_id -label "Grantee ID" \ + -datatype integer -widget hidden -param + + element create $perm_form_name pf_boxes -label "Permissions" \ + -datatype text -widget checkbox -options $permission_options \ + -values $permission_values -optional + + element create $perm_form_name pf_is_recursive \ + -label "Apply changes to child items and subfolders ?" \ + -datatype text \ + -widget radio -options { {Yes t} {No f} } -values { f } + + + + + + + + FIX ME PLSQL + + + if { [form is_valid $perm_form_name] } { + + set user_id [User::getID] + + form get_values $perm_form_name object_id grantee_id pf_is_recursive + set permission_values [element get_values $perm_form_name pf_boxes] + + db_transaction { + + + foreach pair $permission_options { + set privilege [lindex $pair 1] + if { [lsearch $permission_values $privilege] >= 0 } { + template::query pfp_grant_permission grant_permission dml $__sql_grant " + begin + cms_permission__grant_permission ( + item_id => :object_id, + holder_id => :user_id, + privilege => :privilege, + recepient_id => :grantee_id, + is_recursive => :pf_is_recursive + ); + end;" + } else { + template::query pfp_revoke_permission revoke_permission dml $__sql_revoke" + begin + cms_permission__revoke_permission ( + item_id => :object_id, + holder_id => :user_id, + privilege => :privilege, + revokee_id => :grantee_id, + is_recursive => :pf_is_recursive + ); + end;" + } + } + + } + + + content::check_access $object_id "cm_read" \ + -user_id $user_id -refresh + + } + + + + + + + + + select + p.privilege, + cms_permission__permission_p ( + :object_id, :user_id, p.privilege + ) as is_granted + from + acs_privileges p + + + + + + + + select + acs_object__name(:object_id) as obj_name, + pretty_name as perm_name + from + acs_privileges + where + privilege = :privilege + + + + + + +-- RBM: I thought about using Dan's simpler suggestion as per his comments in +-- acs-kernel/sql/postgresql/acs-permissions-create.sql but the query does some +-- indenting with the tree_level. + + select + t.child_privilege as privilege, + lpad(' ', t.tree_level * 24, ' ') || coalesce(p.pretty_name, t.child_privilege) as label, + cms_permission__permission_p(:object_id, :grantee_id, t.child_privilege) as permission_p, + cms_permission__permission_p (:object_id, :grantee_id, t.privilege) as parent_permission_p + from ( + select h2.privilege, h2.child_privilege, tree_level(h2.tree_sortkey) as tree_level + from acs_privilege_hierarchy_index h1, + acs_privilege_hierarchy_index h2 + where h1.child_privilege = 'cm_root' + and h1.tree_sortkey like (h2.tree_sortkey || '%') + and h2.tree_sortkey < h1.tree_sortkey + ) t, acs_privileges p + where + p.privilege = t.child_privilege + and ( + cms_permission__has_grant_authority ( + :object_id, :user_id, t.child_privilege + ) = 't' + or + cms_permission__has_revoke_authority ( + :object_id, :user_id, t.child_privilege, :grantee_id + ) = 't' + ) + + + + + + + + + select cms_permission__grant_permission (:object_id, :user_id, :privilege, :grantee_id, :pf_is_recursive) + + + + + + + + + select cms_permission__revoke_permission (:object_id, :user_id, :privilege, :grantee_id, :pf_is_recursive) + + + + + + Index: openacs-4/packages/cms/tcl/perm-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/perm-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/perm-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + + select screen_name from users where user_id = :user_id + + + + + + Index: openacs-4/packages/cms/tcl/publish-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/publish-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,58 @@ + + + + oracle8.1.6 + + + + + select content from cr_revisions where revision_id = $revision_id + + + + + + + + + select + distinct i.item_id, i.live_revision + from + cr_items i, cr_release_periods p + where + i.publish_status = 'ready' + and + i.live_revision is not null + and + i.item_id = p.item_id + and + (sysdate between p.start_when and p.end_when) + + + + + + + + + select + distinct i.item_id + from + cr_items i, cr_release_periods p + where + i.publish_status = 'live' + and + i.live_revision is not null + and + i.item_id = p.item_id + and + not exists (select 1 from cr_release_periods p2 + where p2.item_id = i.item_id + and (sysdate between p2.start_when and p2.end_when) + ) + + + + + + Index: openacs-4/packages/cms/tcl/publish-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/publish-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,58 @@ + + + + postgresql7.1 + + + + + select content from cr_revisions where revision_id = $revision_id + + + + + + + + + select + distinct i.item_id, i.live_revision + from + cr_items i, cr_release_periods p + where + i.publish_status = 'ready' + and + i.live_revision is not null + and + i.item_id = p.item_id + and + (current_timestamp between p.start_when and p.end_when) + + + + + + + + + select + distinct i.item_id + from + cr_items i, cr_release_periods p + where + i.publish_status = 'live' + and + i.live_revision is not null + and + i.item_id = p.item_id + and + not exists (select 1 from cr_release_periods p2 + where p2.item_id = i.item_id + and (current_timestamp between p2.start_when and p2.end_when) + ) + + + + + + Index: openacs-4/packages/cms/tcl/publish-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/publish-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,66 @@ + + + + + + update cr_items set publish_status = :new_status + where item_id = :item_id + + + + + + + + select + child_id + from + cr_child_rels r, cr_items i + where + r.parent_id = :main_item_id + and + r.relation_tag = :relation_tag + and + i.item_id = r.child_id + order by + order_n + + + + + + + + select + related_object_id + from + cr_item_rels r, cr_items i + where + r.item_id = :main_item_id + and + r.relation_tag = :relation_tag + and + i.item_id = r.related_object_id + order by + r.order_n + + + + + + + + select + im.width, im.height, r.title as image_alt + from + images im, cr_revisions r + where + im.image_id = :revision_id + and + r.revision_id = :revision_id + + + + + + Index: openacs-4/packages/cms/tcl/rel-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/rel-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/rel-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,36 @@ + + + + + + + select + rel_id + from + cr_item_rels + where + item_id = :item_id + order by + order_n, rel_id + + + + + + + + + select + rel_id + from + cr_child_rels + where + parent_id = :item_id + order by + order_n, rel_id + + + + + + Index: openacs-4/packages/cms/tcl/user-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/user-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/user-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,14 @@ + + + + oracle8.1.6 + + + + + select content_permission.cm_admin_exists from dual + + + + + Index: openacs-4/packages/cms/tcl/user-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/user-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/user-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,14 @@ + + + + postgresql7.1 + + + + + select content_permission__cm_admin_exists + + + + + Index: openacs-4/packages/cms/tcl/user-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/user-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/user-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + + select + $col + from + persons + where + person_id = [getID] + + + + + Index: openacs-4/packages/cms/tcl/widget-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/widget-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/widget-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,23 @@ + + + + oracle8.1.6 + + + + + begin + cm_form_widget.set_attribute_param_value ( + content_type => :content_type, + attribute_name => :attribute_name, + param => :param_$order, + param_type => :param_type_$order, + param_source => :param_source_$order, + value => :param_value_$order + ); + end; + + + + + Index: openacs-4/packages/cms/tcl/widget-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/widget-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/widget-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + + select cm_form_widget__set_attribute_param_value (:content_type, :attribute_name, :param_$order, :param_value_$order, :param_type_$order, :param_source_$order) + + + + + + Index: openacs-4/packages/cms/tcl/workflow-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/workflow-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/workflow-procs-oracle.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,129 @@ + + + + oracle8.1.6 + + + + + select + transition_name, party_id, + content_item.get_title(i.item_id) title, + to_char(cd.deadline,'Month DD, YYYY') deadline_pretty, + nvl(party.name(party_id),person.name(party_id)) name + from + wf_transitions t, cr_items i, + wf_cases c, wf_case_assignments ca, wf_case_deadlines cd + where + c.workflow_key = 'publishing_wf' + and + c.workflow_key = t.workflow_key + and + ca.transition_key = t.transition_key + and + ca.transition_key = cd.transition_key + and + c.case_id = ca.case_id + and + c.case_id = cd.case_id + and + c.case_id = :case_id + and + c.state = 'active' + and + c.object_id = i.item_id + + + + + + + + + select + o.creation_user as admin_id, transition_name, party_id, + content_item.get_title(i.item_id) title, + to_char(deadline,'Month DD, YYYY') deadline_pretty, + nvl(party.name(party_id),person.name(party_id)) name, + nvl(party.name(admin_id),person.name(admin_id)) admin_name + from + wf_cases c, wf_case_assignments ca, wf_case_deadlines cd, + wf_transitions t, cr_items i, acs_objects o + where + c.workflow_key = 'publishing_wf' + and + c.workflow_key = t.workflow_key + and + c.case_id = ca.case_id + and + c.case_id = cd.case_id + and + c.case_id = :case_id + and + ca.transition_key = t.transition_key + and + ca.transition_key = cd.transition_key + and + t.transition_key = :transition_key + and + c.state = 'active' + and + c.object_id = i.item_id + and + c.case_id = o.object_id + + + + + + + + + select person.name( :user_id ) from dual + + + + + + + + + select + transition_name, + content_item.get_title(i.item_id) as title, + o.creation_user as admin_id, + person.name( o.creation_user ) as admin_name, + to_char(sysdate,'Mon DD, YYYY') as today + from + wf_tasks t, wf_transitions tr, wf_cases c, + cr_items i, acs_objects o + where + tr.transition_key = t.transition_key + and + tr.workflow_key = t.workflow_key + and + t.case_id = c.case_id + and + c.object_id = i.item_id + and + i.item_id = o.object_id + and + t.task_id = :task_id + + + + + + + + + select + content_workflow.can_touch( :item_id, :user_id ) + from + dual + + + + + + Index: openacs-4/packages/cms/tcl/workflow-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/workflow-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/workflow-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 @@ -0,0 +1,129 @@ + + + + postgresql7.1 + + + + + select + transition_name, party_id, + content_item__get_title(i.item_id) title, + to_char(cd.deadline,'Month DD, YYYY') deadline_pretty, + coalesce(party__name(party_id),person__name(party_id)) name + from + wf_transitions t, cr_items i, + wf_cases c, wf_case_assignments ca, wf_case_deadlines cd + where + c.workflow_key = 'publishing_wf' + and + c.workflow_key = t.workflow_key + and + ca.transition_key = t.transition_key + and + ca.transition_key = cd.transition_key + and + c.case_id = ca.case_id + and + c.case_id = cd.case_id + and + c.case_id = :case_id + and + c.state = 'active' + and + c.object_id = i.item_id + + + + + + + + + select + o.creation_user as admin_id, transition_name, party_id, + content_item__get_title(i.item_id) title, + to_char(deadline,'Month DD, YYYY') deadline_pretty, + coalesce(party__name(party_id),person__name(party_id)) name, + coalesce(party__name(admin_id),person__name(admin_id)) admin_name + from + wf_cases c, wf_case_assignments ca, wf_case_deadlines cd, + wf_transitions t, cr_items i, acs_objects o + where + c.workflow_key = 'publishing_wf' + and + c.workflow_key = t.workflow_key + and + c.case_id = ca.case_id + and + c.case_id = cd.case_id + and + c.case_id = :case_id + and + ca.transition_key = t.transition_key + and + ca.transition_key = cd.transition_key + and + t.transition_key = :transition_key + and + c.state = 'active' + and + c.object_id = i.item_id + and + c.case_id = o.object_id + + + + + + + + + select person__name( :user_id ) + + + + + + + + + select + transition_name, + content_item__get_title(i.item_id) as title, + o.creation_user as admin_id, + person__name( o.creation_user ) as admin_name, + to_char(current_timestamp,'Mon DD, YYYY') as today + from + wf_tasks t, wf_transitions tr, wf_cases c, + cr_items i, acs_objects o + where + tr.transition_key = t.transition_key + and + tr.workflow_key = t.workflow_key + and + t.case_id = c.case_id + and + c.object_id = i.item_id + and + i.item_id = o.object_id + and + t.task_id = :task_id + + + + + + + + + select + content_workflow__can_touch( :item_id, :user_id ) + from + dual + + + + + +