Index: openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql 29 Oct 2001 03:59:02 -0000 1.15
+++ openacs-4/packages/bookmarks/sql/postgresql/bookmarks-create.sql 29 Nov 2001 02:04:15 -0000 1.16
@@ -513,6 +513,7 @@
DECLARE
p_bookmark_id ALIAS FOR $1; -- in bm_bookmarks.bookmark_id%TYPE,
p_browsing_user_id ALIAS FOR $2; -- in bm_bookmarks.owner_id%TYPE
+ v_parent_ids RECORD;
BEGIN
-- Update the in_closed_p flag of bookmarks and folders that lie under
@@ -531,8 +532,9 @@
order by tree_sortkey
)
AND in_closed_p_id = p_browsing_user_id;
+
-- then set all in_closed_p flags to t that lie under a closed folder
- FOR c_parent_ids IN
+ FOR v_parent_ids IN
select bm.bookmark_id from
bm_bookmarks bm, bm_in_closed_p bip
where bm.bookmark_id = bip.bookmark_id
@@ -548,7 +550,7 @@
(
select tree_sortkey || ''%''
from bm_bookmarks
- where bookmark_id = c_parent_ids.bookmark_id
+ where bookmark_id = v_parent_ids.bookmark_id
)
INTERSECT
select bookmark_id from bm_bookmarks
Index: openacs-4/packages/bookmarks/www/bookmark-edit-2-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmark-edit-2-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bookmarks/www/bookmark-edit-2-oracle.xql 19 Jul 2001 15:15:26 -0000 1.1
+++ openacs-4/packages/bookmarks/www/bookmark-edit-2-oracle.xql 29 Nov 2001 02:04:15 -0000 1.2
@@ -17,9 +17,8 @@
end;
-
-
+
begin
@@ -31,5 +30,5 @@
-
+
Index: openacs-4/packages/bookmarks/www/bookmark-edit-2-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmark-edit-2-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bookmarks/www/bookmark-edit-2-postgresql.xql 19 Jul 2001 15:15:26 -0000 1.1
+++ openacs-4/packages/bookmarks/www/bookmark-edit-2-postgresql.xql 29 Nov 2001 02:04:15 -0000 1.2
@@ -24,17 +24,11 @@
-
+
-begin
+ select bookmark__update_in_closed_p_all_users(:bookmark_id, :parent_id)
-perform bookmark__update_in_closed_p_all_users (
- :bookmark_id,
- :parent_id
-);
-return 0;
-end;
Index: openacs-4/packages/bookmarks/www/bookmark-edit-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmark-edit-2.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bookmarks/www/bookmark-edit-2.tcl 20 Apr 2001 20:51:09 -0000 1.1
+++ openacs-4/packages/bookmarks/www/bookmark-edit-2.tcl 29 Nov 2001 02:04:15 -0000 1.2
@@ -59,7 +59,7 @@
);
end;"]
- set url_clause ", url_id = :url_id"
+ set url_clause [db_map url_clause]
} else {
set url_clause ""
}
@@ -74,7 +74,7 @@
# Since the bookmark may have been moved we need to update its
# in_closed_p status for all users viewing the bookmark tree
-db_exec_plsql update_in_closed_p "
+db_exec_plsql update_in_closed_p_all_users "
begin
bookmark.update_in_closed_p_all_users (
bookmark_id => :bookmark_id,
Index: openacs-4/packages/bookmarks/www/bookmark-edit-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmark-edit-2.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/bookmarks/www/bookmark-edit-2.xql 19 Jul 2001 15:15:26 -0000 1.1
+++ openacs-4/packages/bookmarks/www/bookmark-edit-2.xql 29 Nov 2001 02:04:15 -0000 1.2
@@ -16,5 +16,10 @@
+
+
+ , url_id = :url_id
+
+
Index: openacs-4/packages/bookmarks/www/index-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/index-oracle.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/bookmarks/www/index-oracle.xql 18 Oct 2001 19:38:41 -0000 1.4
+++ openacs-4/packages/bookmarks/www/index-oracle.xql 29 Nov 2001 02:04:15 -0000 1.5
@@ -31,71 +31,77 @@
- select b.bookmark_id,
-b.url_id,
-b.local_title as bookmark_title,
-u.complete_url,
-u.last_live_date,
-u.last_checked_date,
-b.folder_p,
-bm_in_closed_p.closed_p,
-nvl(admin_view.object_id, 0) as admin_p,
-nvl(delete_view.object_id,0) as delete_p,
-b.lev as indentation
-$private_select
-
-from bm_urls u,
-(select $index_order bookmark_id, url_id, local_title, folder_p, level lev, parent_id, rownum ord_num
-from bm_bookmarks start with bookmark_id = :root_folder_id connect by prior bookmark_id = parent_id) b,
-bm_in_closed_p,
-(select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'admin') admin_view,
-(select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'delete') delete_view
-where b.url_id = u.url_id (+)
-and bm_in_closed_p.bookmark_id = b.bookmark_id
-and bm_in_closed_p.in_closed_p = 'f'
-and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
-and exists (select 1 from bm_bookmarks where exists (select 1 from acs_object_party_privilege_map where object_id = bookmark_id and party_id in (:browsing_user_id, -1) and privilege = 'read') start with bookmark_id = b.bookmark_id connect by prior bookmark_id = parent_id)
-and b.bookmark_id <> :root_folder_id
-and b.bookmark_id = admin_view.object_id(+)
-and b.bookmark_id = delete_view.object_id(+)
-order by ord_num
+ select b.bookmark_id, b.url_id, b.local_title as bookmark_title, b.folder_p,
+ u.complete_url, u.last_live_date, u.last_checked_date,
+ bm_in_closed_p.closed_p,
+ nvl(admin_view.object_id, 0) as admin_p,
+ nvl(delete_view.object_id,0) as delete_p,
+ b.lev as indentation
+ $private_select
+ from bm_urls u,
+ (select $index_order bookmark_id, url_id, local_title, folder_p, level lev, parent_id, rownum ord_num
+ from bm_bookmarks start with bookmark_id = :root_folder_id connect by prior bookmark_id = parent_id) b,
+ bm_in_closed_p,
+ (select distinct object_id
+ from all_object_party_privilege_map
+ where party_id = :browsing_user_id and privilege = 'admin') admin_view,
+ (select distinct object_id
+ from all_object_party_privilege_map
+ where party_id = :browsing_user_id and privilege = 'delete') delete_view
+ where b.url_id = u.url_id (+)
+ and bm_in_closed_p.bookmark_id = b.bookmark_id
+ and bm_in_closed_p.in_closed_p = 'f'
+ and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
+ and exists (select 1
+ from bm_bookmarks
+ where exists (select 1
+ from all_object_party_privilege_map
+ where object_id = bookmark_id and party_id = :browsing_user_id
+ and privilege = 'read')
+ start with bookmark_id = b.bookmark_id connect by prior bookmark_id = parent_id)
+ and b.bookmark_id <> :root_folder_id
+ and b.bookmark_id = admin_view.object_id(+)
+ and b.bookmark_id = delete_view.object_id(+)
+ order by ord_num
- select b.bookmark_id,
-b.url_id,
-b.local_title as bookmark_title,
-u.complete_url,
-u.last_live_date,
-u.last_checked_date,
-b.folder_p,
-bm_in_closed_p.closed_p,
-nvl(admin_view.object_id, 0) as admin_p,
-nvl(delete_view.object_id,0) as delete_p,
-b.lev as indentation
-$private_select
-
-from bm_urls u,
-(select $index_order bookmark_id, url_id, local_title, folder_p, level lev, parent_id, rownum ord_num
-from bm_bookmarks start with bookmark_id = :root_folder_id connect by prior bookmark_id = parent_id) b,
-bm_in_closed_p,
-(select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'admin') admin_view,
-(select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'delete') delete_view
-where b.url_id = u.url_id (+)
-and bm_in_closed_p.bookmark_id = b.bookmark_id
-and bm_in_closed_p.in_closed_p = 'f'
-and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
-and exists (select 1 from bm_bookmarks where exists (select 1 from acs_object_party_privilege_map where object_id = bookmark_id and party_id in (:browsing_user_id, -1) and privilege = 'read') start with bookmark_id = b.bookmark_id connect by prior bookmark_id = parent_id)
-and b.bookmark_id <> :root_folder_id
-and b.bookmark_id = admin_view.object_id(+)
-and b.bookmark_id = delete_view.object_id(+)
-order by ord_num
+ select b.bookmark_id, b.url_id, b.local_title as bookmark_title,
+ u.complete_url, u.last_live_date, u.last_checked_date,
+ b.folder_p,
+ bm_in_closed_p.closed_p,
+ nvl(admin_view.object_id, 0) as admin_p,
+ nvl(delete_view.object_id,0) as delete_p,
+ b.lev as indentation
+ $private_select
+ from bm_urls u,
+ (select $index_order bookmark_id, url_id, local_title, folder_p, level lev, parent_id, rownum ord_num
+ from bm_bookmarks
+ start with bookmark_id = :root_folder_id connect by prior bookmark_id = parent_id) b,
+ bm_in_closed_p,
+ (select distinct object_id
+ from all_object_party_privilege_map
+ where party_id = :browsing_user_id and privilege = 'admin') admin_view,
+ (select distinct object_id
+ from all_object_party_privilege_map
+ where party_id = :browsing_user_id and privilege = 'delete') delete_view
+ where b.url_id = u.url_id (+)
+ and bm_in_closed_p.bookmark_id = b.bookmark_id
+ and bm_in_closed_p.in_closed_p = 'f'
+ and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
+ and exists (select 1
+ from bm_bookmarks
+ where exists (select 1
+ from all_object_party_privilege_map
+ where object_id = bookmark_id and party_id = :browsing_user_id
+ and privilege = 'read')
+ start with bookmark_id = b.bookmark_id connect by prior bookmark_id = parent_id)
+ and b.bookmark_id <> :root_folder_id
+ and b.bookmark_id = admin_view.object_id(+)
+ and b.bookmark_id = delete_view.object_id(+)
+ order by ord_num
Index: openacs-4/packages/bookmarks/www/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/index-postgresql.xql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/bookmarks/www/index-postgresql.xql 12 Oct 2001 23:42:23 -0000 1.6
+++ openacs-4/packages/bookmarks/www/index-postgresql.xql 29 Nov 2001 02:04:15 -0000 1.7
@@ -31,98 +31,71 @@
-select b.bookmark_id,
-b.url_id,
-b.local_title as bookmark_title,
-u.complete_url,
-u.last_live_date,
-u.last_checked_date,
-b.folder_p,
-bm_in_closed_p.closed_p,
-coalesce(admin_view.object_id, 0) as admin_p,
-coalesce(delete_view.object_id,0) as delete_p,
-b.lev as indentation
-$private_select
-from
-bm_in_closed_p cross join
-((( bm_urls u right join (
- select $index_order bookmark_id, url_id, local_title, folder_p,
- tree_level(tree_sortkey) as lev, parent_id, tree_sortkey
- from bm_bookmarks
- where tree_sortkey like
- (
- select tree_sortkey || '%'
- from bm_bookmarks
- where bookmark_id = :root_folder_id
- )
- order by tree_sortkey
-)
-b on (u.url_id=b.url_id)) left join
-(
- select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'admin'
-) admin_view on (admin_view.object_id=b.bookmark_id)) left join
-(
- select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'delete'
-) delete_view on (delete_view.object_id = b.bookmark_id))
-where bm_in_closed_p.bookmark_id = b.bookmark_id
-and bm_in_closed_p.in_closed_p = 'f'
-and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
-and exists
-(
- select 1 from bm_bookmarks where exists
- (
- select 1 from acs_object_party_privilege_map
- where object_id = bookmark_id and party_id in
- (:browsing_user_id, -1)
- and privilege = 'read'
- )
- and tree_sortkey like
- (
- select tree_sortkey || '%'
- from bm_bookmarks
- where bookmark_id = b.bookmark_id
- )
- order by tree_sortkey
-)
-and b.bookmark_id <> :root_folder_id
-order by b.tree_sortkey
+ select b.bookmark_id, b.url_id, b.local_title as bookmark_title,
+ u.complete_url, u.last_live_date, u.last_checked_date,
+ b.folder_p,
+ bm_in_closed_p.closed_p,
+ coalesce(admin_view.object_id, 0) as admin_p,
+ coalesce(delete_view.object_id,0) as delete_p,
+ b.lev as indentation
+ $private_select
+ from
+ bm_in_closed_p cross join
+ ((( bm_urls u right join (
+ select $index_order bookmark_id, url_id, local_title, folder_p,
+ tree_level(tree_sortkey) as lev, parent_id, tree_sortkey
+ from bm_bookmarks
+ where tree_sortkey like (select tree_sortkey || '%'
+ from bm_bookmarks
+ where bookmark_id = :root_folder_id)
+ ) b on (u.url_id=b.url_id)) left join (
+ select distinct object_id
+ from all_object_party_privilege_map
+ where party_id = :browsing_user_id and privilege = 'admin'
+ ) admin_view on (admin_view.object_id=b.bookmark_id)) left join (
+ select distinct object_id
+ from all_object_party_privilege_map
+ where party_id = :browsing_user_id and privilege = 'delete'
+ ) delete_view on (delete_view.object_id = b.bookmark_id))
+ where bm_in_closed_p.bookmark_id = b.bookmark_id
+ and bm_in_closed_p.in_closed_p = 'f'
+ and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
+ and exists (select 1
+ from bm_bookmarks
+ where exists (select 1
+ from all_object_party_privilege_map
+ where object_id = bookmark_id
+ and party_id = :browsing_user_id
+ and privilege = 'read')
+ and tree_sortkey like (select tree_sortkey || '%'
+ from bm_bookmarks
+ where bookmark_id = b.bookmark_id))
+ and b.bookmark_id <> :root_folder_id
+ order by b.tree_sortkey
-select
- b.bookmark_id, b.url_id, b.local_title as bookmark_title,
- u.complete_url, u.last_live_date, u.last_checked_date,
- b.folder_p, bm_in_closed_p.closed_p,
- b.bookmark_id as admin_p, b.bookmark_id as delete_p,
- b.lev as indentation
- $private_select
-from
- bm_in_closed_p
-cross join (
- bm_urls u
- right join (
- select
- $index_order bookmark_id, url_id, local_title, folder_p,
- tree_level(tree_sortkey) as lev, parent_id, tree_sortkey
- from bm_bookmarks
- where
- tree_sortkey like (
- select tree_sortkey || '%'
- from bm_bookmarks
- where bookmark_id = :root_folder_id
- )
- )
- b on (u.url_id=b.url_id)
-)
-where bm_in_closed_p.bookmark_id = b.bookmark_id
-and bm_in_closed_p.in_closed_p = 'f'
-and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
-and b.bookmark_id <> :root_folder_id
-order by b.tree_sortkey
+ select
+ b.bookmark_id, b.url_id, b.local_title as bookmark_title,
+ u.complete_url, u.last_live_date, u.last_checked_date,
+ b.folder_p, bm_in_closed_p.closed_p,
+ b.bookmark_id as admin_p, b.bookmark_id as delete_p,
+ b.lev as indentation
+ $private_select
+ from bm_in_closed_p cross join (
+ bm_urls u right join (select $index_order bookmark_id, url_id, local_title, folder_p,
+ tree_level(tree_sortkey) as lev, parent_id, tree_sortkey
+ from bm_bookmarks
+ where tree_sortkey like (select tree_sortkey || '%'
+ from bm_bookmarks
+ where bookmark_id = :root_folder_id)) b on (u.url_id=b.url_id))
+ where bm_in_closed_p.bookmark_id = b.bookmark_id
+ and bm_in_closed_p.in_closed_p = 'f'
+ and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
+ and b.bookmark_id <> :root_folder_id
+ order by b.tree_sortkey