Index: openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql 11 May 2001 04:43:39 -0000 1.2 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql 25 Aug 2001 14:22:32 -0000 1.3 @@ -305,15 +305,15 @@ -- get the publishing workflows associated with this content item -- there should only be 1 if CMS exists, otherwise 0 - cursor c_pub_wf is - select - case_id, state - from - wf_cases - where - workflow_key = 'publishing_wf' - and - object_id = is_publishable.item_id; + -- cursor c_pub_wf is + -- select + -- case_id, state + -- from + -- wf_cases + -- where + -- workflow_key = 'publishing_wf' + -- and + -- object_id = is_publishable.item_id; begin @@ -373,12 +373,15 @@ -- that is a little problematic because more than one workflow may be -- open on an item. In addition, this should be moved to CMS. - for v_pub_wf in c_pub_wf loop - if v_pub_wf.state ^= 'finished' then - return 'f'; - end if; - end loop; + -- Removed this as having workflow stuff in the CR is just plain wrong. + -- DanW, Aug 25th, 2001. + -- for v_pub_wf in c_pub_wf loop + -- if v_pub_wf.state ^= 'finished' then + -- return 'f'; + -- end if; + -- end loop; + return 't'; exception when NO_DATA_FOUND then @@ -451,13 +454,13 @@ item_id in cr_items.item_id%TYPE ) is - cursor c_wf_cases_cur is - select - case_id - from - wf_cases - where - object_id = item_id; +-- cursor c_wf_cases_cur is +-- select +-- case_id +-- from +-- wf_cases +-- where +-- object_id = item_id; cursor c_symlink_cur is select @@ -512,11 +515,14 @@ begin - dbms_output.put_line('Deleting associated workflows...'); + -- Removed this as having workflow stuff in the CR is just plain wrong. + -- DanW, Aug 25th, 2001. + + -- dbms_output.put_line('Deleting associated workflows...'); -- 1) delete all workflow cases associated with this item - for v_wf_cases_val in c_wf_cases_cur loop - workflow_case.delete(v_wf_cases_val.case_id); - end loop; + -- for v_wf_cases_val in c_wf_cases_cur loop + -- workflow_case.delete(v_wf_cases_val.case_id); + -- end loop; dbms_output.put_line('Deleting symlinks...'); -- 2) delete all symlinks to this item @@ -610,10 +616,12 @@ fetch exists_cur into exists_id; if exists_cur%NOTFOUND then + close exists_cur; update cr_items set name = rename.name where item_id = rename.item_id; else + close exists_cur; if exists_id <> rename.item_id then raise_application_error(-20000, 'An item with the name ' || rename.name || @@ -792,6 +800,7 @@ v_path := v_path || '../'; fetch c_rel_cur into v_rel_parent_id, v_rel_tree_level; end loop; + close c_rel_cur; -- an item relative to itself is '../item' if v_resolved_root_id = item_id then @@ -821,6 +830,7 @@ v_path := v_path || '/'; end loop; + close c_abs_cur; return v_path; @@ -989,6 +999,7 @@ and m.is_default = 't'; end if; + close item_cur; return v_template_id; @@ -1358,6 +1369,7 @@ open c_revision_cur; fetch c_revision_cur into v_revision_id; if c_revision_cur%NOTFOUND then + close c_revision_cur; return null; end if; close c_revision_cur; Index: openacs-4/packages/acs-content-repository/sql/oracle/content-perms.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/Attic/content-perms.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/sql/oracle/content-perms.sql 24 Mar 2001 22:00:48 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-perms.sql 25 Aug 2001 14:22:32 -0000 1.2 @@ -162,6 +162,7 @@ if c_perm_cur%NOTFOUND then v_ret := 'f'; end if; + close c_perm_cur; return v_ret; end has_revoke_authority; @@ -320,6 +321,7 @@ exit when is_recursive = 'f'; end loop; + close c_object_cur; end revoke_permission; Index: openacs-4/packages/acs-content-repository/sql/oracle/content-test.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-test.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/sql/oracle/content-test.sql 24 Mar 2001 22:00:48 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-test.sql 25 Aug 2001 14:22:32 -0000 1.2 @@ -1,4 +1,4 @@ -set serveroutput on +set serveroutput on size 1000000 format wrapped declare folder_id cr_folders.folder_id%TYPE; @@ -24,8 +24,8 @@ -- create folders and an item -folder_id := content_folder.new('grandpa', 'Grandpa', NULL, -1); -folder_b_id := content_folder.new('grandma', 'Grandma', NULL, -1); +folder_id := content_folder.new('grandpa', 'Grandpa', NULL, -100); +folder_b_id := content_folder.new('grandma', 'Grandma', NULL, -100); sub_folder_id := content_folder.new('pa', 'Pa', NULL, folder_id); sub_sub_folder_id := content_folder.new('me', 'Me', NULL, sub_folder_id); item_id := content_item.new('puppy', sub_sub_folder_id); @@ -210,7 +210,7 @@ --dbms_output.put_line('Path for ' || item_id || ' is ' || --content_item.get_path(item_id)); --dbms_output.put_line('Moving grandpa to pa - this should''nt work'); -content_folder.move(folder_id, sub_folder_id); +-- content_folder.move(folder_id, sub_folder_id); --dbms_output.put_line('Path for ' || item_id || ' is ' || -- content_item.get_path(item_id)); --dbms_output.put_line('Renaming puppy to kitty...'); Index: openacs-4/packages/acs-content-repository/sql/oracle/doc-package.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/doc-package.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/sql/oracle/doc-package.sql 24 Mar 2001 22:00:48 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/doc-package.sql 25 Aug 2001 14:22:32 -0000 1.2 @@ -67,6 +67,7 @@ end if; end if; end loop; + close v_package_cur; -- Return unfinished result return v_result; @@ -117,6 +118,7 @@ v_result := v_result || v_text; end if; end loop; + close v_package_cur; -- Return unfinished result return v_result; Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql,v diff -u -r1.25 -r1.26 --- openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 23 Aug 2001 22:50:44 -0000 1.25 +++ openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 25 Aug 2001 14:22:32 -0000 1.26 @@ -618,7 +618,7 @@ v_template_id cr_templates.template_id%TYPE; v_child_type record; v_rel_type record; - v_pub_wf record; + -- v_pub_wf record; begin -- validate children @@ -688,26 +688,29 @@ -- KG: logic is wrong here. Only the latest workflow matters, and even -- that is a little problematic because more than one workflow may be -- open on an item. In addition, this should be moved to CMS. + + -- Removed this as having workflow stuff in the CR is just plain wrong. + -- DanW, Aug 25th, 2001. - for v_pub_wf in select - case_id, state - from - wf_cases - where - workflow_key = ''publishing_wf'' - and - object_id = is_publishable__item_id + -- for v_pub_wf in select + -- case_id, state + -- from + -- wf_cases + -- where + -- workflow_key = ''publishing_wf'' + -- and + -- object_id = is_publishable__item_id + -- + -- LOOP + -- if v_pub_wf.state != ''finished'' then + -- return ''f''; + -- end if; + -- end loop; - LOOP - if v_pub_wf.state != ''finished'' then - return ''f''; - end if; - end loop; + -- if NOT FOUND then + -- return ''f''; + -- end if; - if NOT FOUND then - return ''f''; - end if; - return ''t''; end;' language 'plpgsql'; @@ -781,23 +784,26 @@ returns integer as ' declare delete__item_id alias for $1; - v_wf_cases_val record; + -- v_wf_cases_val record; v_symlink_val record; v_revision_val record; v_rel_val record; begin - raise NOTICE ''Deleting associated workflows...''; + -- Removed this as having workflow stuff in the CR is just plain wrong. + -- DanW, Aug 25th, 2001. + + -- raise NOTICE ''Deleting associated workflows...''; -- 1) delete all workflow cases associated with this item - for v_wf_cases_val in select - case_id - from - wf_cases - where - object_id = delete__item_id - LOOP - PERFORM workflow_case__delete(v_wf_cases_val.case_id); - end loop; + -- for v_wf_cases_val in select + -- case_id + -- from + -- wf_cases + -- where + -- object_id = delete__item_id + -- LOOP + -- PERFORM workflow_case__delete(v_wf_cases_val.case_id); + -- end loop; raise NOTICE ''Deleting symlinks...''; -- 2) delete all symlinks to this item