Index: openacs-4/packages/dotlrn/tcl/community-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v
diff -u -r1.53 -r1.54
--- openacs-4/packages/dotlrn/tcl/community-procs.xql 30 Apr 2002 21:23:30 -0000 1.53
+++ openacs-4/packages/dotlrn/tcl/community-procs.xql 1 May 2002 01:19:47 -0000 1.54
@@ -20,100 +20,111 @@
-
-
-declare
-begin
-end;
-
-
+
+
+ update dotlrn_community_types set portal_template_id= :template_id where community_type= :community_type
+
+
-
-
-update dotlrn_community_types set portal_template_id= :template_id where community_type= :community_type
-
-
+
+
+ update dotlrn_community_types set package_id= :package_id where community_type= :community_type
+
+
-
-
-update dotlrn_community_types set package_id= :package_id where community_type= :community_type
-
-
+
+
+ update dotlrn_communities set package_id= :package_id where community_id= :community_id
+
+
-
-
-update dotlrn_communities set package_id= :package_id where community_id= :community_id
-
-
+
+
+ select dotlrn_communities.parent_community_id
+ from dotlrn_communities
+ where dotlrn_communities.community_id = :community_id
+
+
-
-
-select dotlrn_communities.parent_community_id
-from dotlrn_communities
-where dotlrn_communities.community_id = :community_id
-
-
+
+
+ select 1
+ from dotlrn_communities
+ where :parent_community_id in (select dc.parent_community_id
+ from dotlrn_communities dc
+ where dc.community_key = :community_key)
+
+
-
-
-select 1 from dotlrn_communities where :parent_community_id in (select parent_community_id from dotlrn_communities where dotlrn_communities.community_key = :community_key)
-
-
+
+
+ select node_id
+ from site_nodes
+ where object_id = (select package_id
+ from dotlrn_community_types
+ where community_type = :community_type)
+
+
-
-
-select node_id from site_nodes where object_id= (select package_id from dotlrn_community_types where community_type= :community_type)
-
-
+
+
+ select node_id
+ from site_nodes
+ where object_id = (select package_id
+ from dotlrn_communities
+ where community_id = :community_id)
+
+
-
-
-select node_id from site_nodes where object_id= (select package_id from dotlrn_communities where community_id= :community_id)
-
-
+
+
+ update dotlrn_communities
+ set portal_template_id = :portal_template_id,
+ portal_id = :portal_id,
+ admin_portal_id= :admin_portal_id
+ where community_id = :community_id
+
+
-
-
-update dotlrn_communities set portal_template_id = :portal_template_id, portal_id = :portal_id, admin_portal_id= :admin_portal_id where community_id = :community_id
-
-
+
+
+ select pretty_name
+ from acs_rel_roles
+ where role = :role
+
+
-
-
- select pretty_name
- from acs_rel_roles
- where role = :role
-
-
+
+
+ select pretty_name
+ from acs_rel_roles
+ where role = (select role_two
+ from acs_rel_types
+ where rel_type = :rel_type)
+
+
-
-
- select pretty_name
- from acs_rel_roles
- where role = (select role_two
- from acs_rel_types
- where rel_type = :rel_type)
-
-
+
+
+ select pretty_name
+ from acs_rel_roles
+ where role = (select acs_rel_types.role_two
+ from acs_rel_types,
+ acs_rels
+ where acs_rel_types.rel_type = acs_rels.rel_type
+ and acs_rels.rel_id = :rel_id)
+
+
-
-
- select pretty_name
- from acs_rel_roles
- where role = (select acs_rel_types.role_two
- from acs_rel_types,
- acs_rels
- where acs_rel_types.rel_type = acs_rels.rel_type
- and acs_rels.rel_id = :rel_id)
-
-
+
+
+ select segment_id
+ from rel_segments
+ where group_id = :community_id
+ and rel_type= :rel_type
+
+
-
-
-select segment_id from rel_segments where group_id= :community_id and rel_type= :rel_type
-
-
-
select dotlrn_member_rels_approved.rel_id,
@@ -193,251 +204,295 @@
-
-
-select rel_id, portal_id from dotlrn_member_rels_full where community_id= :community_id and user_id= :user_id
-
-
+
+
+ select rel_id,
+ portal_id
+ from dotlrn_member_rels_full
+ where community_id = :community_id
+ and user_id= :user_id
+
+
-
-
-select portal_id from dotlrn_member_rels_full where community_id= :community_id and user_id= :user_id
-
-
+
+
+ select portal_id
+ from dotlrn_member_rels_full
+ where community_id = :community_id
+ and user_id = :user_id
+
+
-
-
-select portal_id from dotlrn_communities where community_id= :community_id
-
-
+
+
+ select portal_id
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
-select admin_portal_id from dotlrn_communities where community_id= :community_id
-
-
+
+
+ select admin_portal_id
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
- select dotlrn_communities_full.community_id,
- dotlrn_communities_full.community_type,
- dotlrn_communities_full.community_key,
- dotlrn_communities_full.pretty_name,
- dotlrn_communities_full.package_id,
- dotlrn_communities_full.url
- from dotlrn_communities_full,
- dotlrn_member_rels_approved
- where dotlrn_communities_full.community_id = dotlrn_member_rels_approved.community_id
- and dotlrn_member_rels_approved.user_id = :user_id
-
-
+
+
+ select dotlrn_communities_full.*
+ from dotlrn_communities_full,
+ dotlrn_member_rels_approved
+ where dotlrn_communities_full.community_id = dotlrn_member_rels_approved.community_id
+ and dotlrn_member_rels_approved.user_id = :user_id
+
+
-
-
-select dotlrn_communities.community_id as community_id, community_type, pretty_name, description, package_id
-from dotlrn_communities, dotlrn_member_rels_full
-where community_type= :community_type
-and user_id= :user_id
-and dotlrn_communities.community_id = dotlrn_member_rels_full.community_id
-
-
+
+
+ select dotlrn_communities.*
+ from dotlrn_communities,
+ dotlrn_member_rels_full
+ where dotlrn_communities.community_type = :community_type
+ and dotlrn_member_rels_full.user_id = :user_id
+ and dotlrn_communities.community_id = dotlrn_member_rels_full.community_id
+
+
-
-
-select community_id, community_type, pretty_name, description, package_id, community_key
-from dotlrn_communities
-where community_type= :community_type
-
-
+
+
+ select dotlrn_communities.*
+ from dotlrn_communities
+ where community_type = :community_type
+
+
-
-
-select community_type from dotlrn_community_types where package_id= :package_id
-
-
+
+
+ select community_type
+ from dotlrn_community_types
+ where package_id = :package_id
+
+
-
-
-select community_type from dotlrn_communities where community_id=:community_id
-
-
+
+
+ select community_type
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
-select 1 from dual where exists (select 1 from dotlrn_communities where parent_community_id = :community_id)
-
-
+
+
+ select 1
+ from dual
+ where exists (select 1
+ from dotlrn_communities
+ where parent_community_id = :community_id)
+
+
-
-
-select community_id as subcomm_id from dotlrn_communities where parent_community_id = :community_id
-
-
+
+
+ select community_id as subcomm_id
+ from dotlrn_communities
+ where parent_community_id = :community_id
+
+
-
-
- select
- community_id,
- community_key,
- pretty_name,
- url
- from dotlrn_communities_full
- where parent_community_id= :community_id
- order by pretty_name
-
-
+
+
+ select community_id,
+ community_key,
+ pretty_name,
+ url
+ from dotlrn_communities_full
+ where parent_community_id = :community_id
+ order by pretty_name
+
+
-
-
-select package_id from dotlrn_community_types where community_type= :community_type
-
-
+
+
+ select package_id
+ from dotlrn_community_types
+ where community_type = :community_type
+
+
-
-
-select package_id from dotlrn_communities where community_id= :community_id
-
-
+
+
+ select package_id
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
-select package_id
-from dotlrn_community_applets dca, dotlrn_applets da
-where community_id= :community_id
-and applet_key= :applet_key
-and dca.applet_id = da.applet_id
-
-
+
+
+ select package_id
+ from dotlrn_community_applets dca,
+ dotlrn_applets da
+ where community_id = :community_id
+ and applet_key = :applet_key
+ and dca.applet_id = da.applet_id
+
+
-
-
-select pretty_name from dotlrn_community_types where community_type= :community_type
-
-
+
+
+ select pretty_name
+ from dotlrn_community_types
+ where community_type = :community_type
+
+
-
-
-update dotlrn_communities set pretty_name = :pretty_name where community_id= :community_id
-
-
+
+
+ update dotlrn_communities
+ set pretty_name = :pretty_name
+ where community_id = :community_id
+
+
-
-
-select pretty_name from dotlrn_communities where community_id= :community_id
-
-
+
+
+ select pretty_name
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
-select description from dotlrn_communities where community_id= :community_id
-
-
+
+
+ select description
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
-select community_key from dotlrn_communities where community_id= :community_id
-
-
+
+
+ select community_key
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
-select 1 from dotlrn_active_comms_not_closed where community_id= :community_id
-
-
+
+
+ select 1
+ from dotlrn_active_comms_not_closed
+ where community_id = :community_id
+
+
-
-
-select 1 from dotlrn_active_comms_not_closed where community_id= :community_id and join_policy = 'open'
-
-
+
+
+ select 1
+ from dotlrn_active_comms_not_closed
+ where community_id = :community_id
+ and join_policy = 'open'
+
+
-
-
-select 1 from dotlrn_active_comms_not_closed where community_id= :community_id and join_policy = 'needs approval'
-
-
+
+
+ select 1
+ from dotlrn_active_comms_not_closed
+ where community_id = :community_id
+ and join_policy = 'needs approval'
+
+
-
-
-select portal_template_id from dotlrn_communities where community_id= :community_id
-
-
+
+
+ select portal_template_id
+ from dotlrn_communities
+ where community_id = :community_id
+
+
-
-
-insert into dotlrn_community_applets
-(community_id, applet_id, package_id, active_p)
-values
-(:community_id, :applet_id, :package_id, :active_p)
-
-
+
+
+ insert into dotlrn_community_applets
+ (community_id, applet_id, package_id, active_p)
+ values
+ (:community_id, :applet_id, :package_id, :active_p)
+
+
-
-
-delete from dotlrn_community_applets
-where community_id= :community_id and applet_id = :applet_id
-
-
+
+
+ delete from dotlrn_community_applets
+ where community_id = :community_id
+ and applet_id = :applet_id
+
+
-
-
- select impl_name
- from acs_sc_impls, acs_sc_bindings, acs_sc_contracts
- where acs_sc_impls.impl_id = acs_sc_bindings.impl_id
- and acs_sc_contracts.contract_id = acs_sc_bindings.contract_id
- and acs_sc_contracts.contract_name = 'dotlrn_applet'
-
-
+
+
+ select impl_name
+ from acs_sc_impls,
+ acs_sc_bindings,
+ acs_sc_contracts
+ where acs_sc_impls.impl_id = acs_sc_bindings.impl_id
+ and acs_sc_contracts.contract_id = acs_sc_bindings.contract_id
+ and acs_sc_contracts.contract_name = 'dotlrn_applet'
+
+
-
-
- select applet_key
- from dotlrn_community_applets dca,
- dotlrn_applets da
- where community_id = :community_id
- and dca.applet_id = da.applet_id
-
-
+
+
+ select applet_key
+ from dotlrn_community_applets dca,
+ dotlrn_applets da
+ where community_id = :community_id
+ and dca.applet_id = da.applet_id
+
+
-
-
- select applet_key
- from dotlrn_applets
- where status = 'active'
-
-
+
+
+ select applet_key
+ from dotlrn_applets
+ where status = 'active'
+
+
-
-
- select applet_key
- from dotlrn_community_applets dca,
- dotlrn_applets da
- where community_id = :community_id
- and active_p = 't'
- and dca.applet_id = da.applet_id
- and status = 'active'
-
-
+
+
+ select applet_key
+ from dotlrn_community_applets dca,
+ dotlrn_applets da
+ where community_id = :community_id
+ and active_p = 't'
+ and dca.applet_id = da.applet_id
+ and status = 'active'
+
+
-
-
- select 1
- from dotlrn_community_applets dca,
- dotlrn_applets da
- where community_id = :community_id
- and da.applet_key = :applet_key
- and active_p = 't'
- and dca.applet_id = da.applet_id
- and status = 'active'
-
-
+
+
+ select 1
+ from dotlrn_community_applets dca,
+ dotlrn_applets da
+ where community_id = :community_id
+ and da.applet_key = :applet_key
+ and active_p = 't'
+ and dca.applet_id = da.applet_id
+ and status = 'active'
+
+
-
-
- select count(*)
- from dotlrn_community_types
- where supertype = :community_type
-
-
+
+
+ select count(*)
+ from dotlrn_community_types
+ where supertype = :community_type
+
+