Index: openacs-4/packages/dotlrn-forums/dotlrn-forums.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/dotlrn-forums.info,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/dotlrn-forums/dotlrn-forums.info 21 Jul 2002 21:26:28 -0000 1.6 +++ openacs-4/packages/dotlrn-forums/dotlrn-forums.info 17 Oct 2002 10:52:27 -0000 1.6.2.1 @@ -20,9 +20,15 @@ + + + + + + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-admin-portlet-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-create.sql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-create.sql 9 Aug 2002 18:39:28 -0000 1.3 +++ openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-create.sql 17 Oct 2002 10:52:27 -0000 1.3.2.1 @@ -14,120 +14,143 @@ -- details. -- + -- -- The forums applet for dotLRN +-- copyright 2001, OpenForce +-- distributed under GPL v2.0 -- +-- -- @author Ben Adida (ben@openforce.net) -- @creation-date 2002-05-29 -- @version $Id$ -- +-- 10/05/2001 +-- redone for Forums by Ben 05/29/2002 +-- + declare - foo integer; + foo integer; begin + -- create the implementation + foo := acs_sc_impl.new ( + 'dotlrn_applet', + 'dotlrn_forums', + 'dotlrn_forums' + ); - foo := acs_sc_impl.new( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_owner_name => 'dotlrn_forums' - ); + -- add all the hooks - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'GetPrettyName', - impl_alias => 'dotlrn_forums::get_pretty_name', - impl_pl => 'TCL' - ); + -- GetPrettyName + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'GetPrettyName', + 'dotlrn_forums::get_pretty_name', + 'TCL' + ); - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'AddApplet', - impl_alias => 'dotlrn_forums::add_applet', - impl_pl => 'TCL' - ); + -- AddApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'AddApplet', + 'dotlrn_forums::add_applet', + 'TCL' + ); - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'RemoveApplet', - impl_alias => 'dotlrn_forums::remove_applet', - impl_pl => 'TCL' - ); + -- RemoveApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'RemoveApplet', + 'dotlrn_forums::remove_applet', + 'TCL' + ); - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'AddAppletToCommunity', - impl_alias => 'dotlrn_forums::add_applet_to_community', - impl_pl => 'TCL' - ); + -- AddAppletToCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'AddAppletToCommunity', + 'dotlrn_forums::add_applet_to_community', + 'TCL' + ); - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'RemoveAppletFromCommunity', - impl_alias => 'dotlrn_forums::remove_applet_from_community', - impl_pl => 'TCL' - ); + -- RemoveAppletFromCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'RemoveAppletFromCommunity', + 'dotlrn_forums::remove_applet_from_community', + 'TCL' + ); + -- AddUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'AddUser', + 'dotlrn_forums::add_user', + 'TCL' + ); - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'AddUser', - impl_alias => 'dotlrn_forums::add_user', - impl_pl => 'TCL' - ); + -- RemoveUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'RemoveUser', + 'dotlrn_forums::remove_user', + 'TCL' + ); - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'RemoveUser', - impl_alias => 'dotlrn_forums::remove_user', - impl_pl => 'TCL' - ); + -- AddUserToCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'AddUserToCommunity', + 'dotlrn_forums::add_user_to_community', + 'TCL' + ); - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', - impl_operation_name => 'AddUserToCommunity', - impl_alias => 'dotlrn_forums::add_user_to_community', - impl_pl => 'TCL' - ); + -- RemoveUserFromCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_forums', + 'RemoveUserFromCommunity', + 'dotlrn_forums::remove_user_from_community', + 'TCL' + ); - foo := acs_sc_impl.new_alias( + -- AddPortlet + foo := acs_sc_impl.new_alias ( impl_contract_name => 'dotlrn_applet', impl_name => 'dotlrn_forums', - impl_operation_name => 'RemoveUserFromCommunity', - impl_alias => 'dotlrn_forums::remove_user_from_community', - impl_pl => 'TCL' - ); - - foo := acs_sc_impl.new_alias( - impl_contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums', impl_operation_name => 'AddPortlet', impl_alias => 'dotlrn_forums::add_portlet', impl_pl => 'TCL' ); - foo := acs_sc_impl.new_alias( + -- RemovePortlet + foo := acs_sc_impl.new_alias ( impl_contract_name => 'dotlrn_applet', impl_name => 'dotlrn_forums', impl_operation_name => 'RemovePortlet', impl_alias => 'dotlrn_forums::remove_portlet', impl_pl => 'TCL' ); - foo := acs_sc_impl.new_alias( + -- Clone + foo := acs_sc_impl.new_alias ( impl_contract_name => 'dotlrn_applet', impl_name => 'dotlrn_forums', impl_operation_name => 'Clone', impl_alias => 'dotlrn_forums::clone', impl_pl => 'TCL' ); + -- Change Event Handler + foo := acs_sc_impl.new_alias( impl_contract_name => 'dotlrn_applet', impl_name => 'dotlrn_forums', @@ -136,11 +159,32 @@ impl_pl => 'TCL' ); - acs_sc_binding.new( - contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_forums' - ); + -- Add the binding + acs_sc_binding.new ( + contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_forums' + ); end; / -show errors +show errors; + +-- DRB: This is a bit of a hack but I can't really think of any reason why the dotlrn forums +-- applet should be forbidden from altering the forums table to track whether or not the +-- forum is an autosubscribe forum. We don't want to modify the forums package itself +-- because autosubscription is very much a dotLRN feature inherited from SSV1. + +-- An alternative would be to create an acs relationship to track which forums users should +-- be autosubscribed to, but each relationship is an object. This is a heavyweight way to +-- accomplish something simple. + +alter table forums_forums add ( + autosubscribe_p char(1) + default 'f' + constraint forums_autosubscribe_p_nn + not null + constraint forums_autosubscribe_p_ck + check (autosubscribe_p in ('t','f')) +); + +@dotlrn-forums-admin-portlet-create Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-admin-portlet-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-create.sql,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-create.sql 9 Aug 2002 18:39:28 -0000 1.3 +++ openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-create.sql 17 Oct 2002 10:52:27 -0000 1.3.2.1 @@ -27,113 +27,111 @@ create function inline_0() returns integer as ' -declare - foo integer; begin - foo := acs_sc_impl__new ( + perform acs_sc_impl__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''dotlrn_forums'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''GetPrettyName'', ''dotlrn_forums::get_pretty_name'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''AddApplet'', ''dotlrn_forums::add_applet'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''RemoveApplet'', ''dotlrn_forums::remove_applet'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''AddAppletToCommunity'', ''dotlrn_forums::add_applet_to_community'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''RemoveAppletFromCommunity'', ''dotlrn_forums::remove_applet_from_community'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''AddUser'', ''dotlrn_forums::add_user'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''RemoveUser'', ''dotlrn_forums::remove_user'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''AddUserToCommunity'', ''dotlrn_forums::add_user_to_community'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''RemoveUserFromCommunity'', ''dotlrn_forums::remove_user_from_community'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''AddPortlet'', ''dotlrn_forums::add_portlet'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''RemovePortlet'', ''dotlrn_forums::remove_portlet'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''Clone'', ''dotlrn_forums::clone'', ''TCL'' ); - foo := acs_sc_impl_alias__new ( + perform acs_sc_impl_alias__new ( ''dotlrn_applet'', ''dotlrn_forums'', ''ChangeEventHandler'', @@ -152,3 +150,5 @@ select inline_0(); drop function inline_0(); + +\i dotlrn-forums-admin-portlet-create.sql Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-admin-portlet-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl,v diff -u -r1.9 -r1.9.2.1 --- openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl 9 Aug 2002 18:39:28 -0000 1.9 +++ openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl 17 Oct 2002 10:52:27 -0000 1.9.2.1 @@ -97,12 +97,17 @@ ] # mount attachments under forums, if available - # attachments requires that dotlrn-fs is already mounted - if {[apm_package_registered_p attachments] && [dotlrn_community::applet_active_p -community_id $community_id -applet_key [dotlrn_fs::applet_key]]} { + # attachments requires that dotlrn-fs is already mounted + if {[apm_package_registered_p attachments] + && [dotlrn_community::applet_active_p \ + -community_id $community_id \ + -applet_key [dotlrn_fs::applet_key]]} { set attachments_node_id [site_node::new \ -name [attachments::get_url] \ - -parent_id [site_node::get_node_id_from_object_id -object_id $package_id] + -parent_id [site_node::get_node_id_from_object_id \ + -object_id $package_id + ] ] site_node::mount \ @@ -111,16 +116,18 @@ set fs_package_id [dotlrn_community::get_applet_package_id \ -community_id $community_id \ - -applet_key [dotlrn_fs::applet_key] \ + -applet_key [dotlrn_fs::applet_key] ] - + # map the fs root folder to the package_id of the new forums pkg attachments::map_root_folder \ -package_id $package_id \ - -folder_id [fs::get_root_folder -package_id $fs_package_id] - + -folder_id [fs::get_root_folder -package_id $fs_package_id] + + } else { + ns_log Warning "DOTLRN-FORUMS: Warning attachments or dotlrn-fs not found!" } - + set auto_create_forum_p [parameter::get_from_package_key \ -package_key [my_package_key] \ -parameter auto_create_forum_p \ @@ -151,7 +158,7 @@ -community_id $community_id \ ] - forums_admin_portlet::add_self_to_page \ + dotlrn_forums_admin_portlet::add_self_to_page \ -portal_id $admin_portal_id \ -package_id $package_id @@ -216,17 +223,17 @@ dotlrn_forums::add_portlet_helper $portal_id $args - # Set up notifications for all the forums - foreach forum [forum::list_forums -package_id $package_id] { - set forum_id [ns_set get $forum forum_id] + # Set up notifications for all the forums that have set for autosubscription + db_foreach select_forums {} { notification::request::new \ -type_id [notification::type::get_type_id -short_name forums_forum_notif] \ -user_id $user_id \ -object_id $forum_id \ -interval_id [notification::get_interval_id -name instant] \ -delivery_method_id [notification::get_delivery_method_id -name email] } + } ad_proc -public remove_user_from_community { Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.tcl'. Fisheye: No comparison available. Pass `N' to diff?