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 -N -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 @@ + + + + + + Index: openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-admin-portlet-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-forums/sql/oracle/dotlrn-forums-admin-portlet-create.sql 17 Oct 2002 10:52:27 -0000 1.1.2.1 @@ -0,0 +1,199 @@ +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- packages/dotlrn-forums/sql/dotlrn-forums-portlets-create.sql +-- + +-- Creates the dotlrn forums admin datasources for portal portlets + +-- This is a modified version of the standard forums admin portlet which includes +-- some admin UI options tied to dotlrn specific features. The particular feature +-- that triggered the creation of this custom portlet is the optional autosubscribing +-- of dotlrn community members to a forum. + +-- @author Don Baccus (arjun@openforce.net) +-- @creation-date 2002-29-08 + +-- $Id: dotlrn-forums-admin-portlet-create.sql,v 1.1.2.1 2002/10/17 10:52:27 jeffd Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License version 2 or higher. Full text of the license is available +-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource.new( + name => 'dotlrn_forums_admin_portlet', + description => 'Displays the dotlrn_forums_admin' + ); + + -- 4 defaults procs + + -- shadeable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 'f' +); + + -- shaded_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_p', + value => 'f' +); + + -- hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'hideable_p', + value => 't' +); + + -- user_editable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'user_editable_p', + value => 'f' +); + + -- link_hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'link_hideable_p', + value => 't' +); + + + -- forums_admin-specific procs + + -- package_id must be configured + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'package_id', + value => '' +); + + +end; +/ +show errors + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'dotlrn_forums_admin_portlet' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- add all the hooks + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'GetMyName', + 'dotlrn_forums_admin_portlet::get_my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'GetPrettyName', + 'dotlrn_forums_admin_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'Link', + 'dotlrn_forums_admin_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'AddSelfToPage', + 'dotlrn_forums_admin_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'Show', + 'dotlrn_forums_admin_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'Edit', + 'dotlrn_forums_admin_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_forums_admin_portlet', + 'RemoveSelfFromPage', + 'dotlrn_forums_admin_portlet::remove_self_from_page', + 'TCL' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'portal_datasource', + impl_name => 'dotlrn_forums_admin_portlet' + ); +end; +/ +show errors + 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 -N -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 Index: openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-admin-portlet-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-forums/sql/postgresql/dotlrn-forums-admin-portlet-create.sql 17 Oct 2002 10:52:27 -0000 1.1.2.1 @@ -0,0 +1,215 @@ +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- packages/dotlrn-forums/sql/dotlrn-forums-portlets-create.sql +-- + +-- Creates the dotlrn forums admin datasources for portal portlets + +-- This is a modified version of the standard forums admin portlet which includes +-- some admin UI options tied to dotlrn specific features. The particular feature +-- that triggered the creation of this custom portlet is the optional autosubscribing +-- of dotlrn community members to a forum. + +-- @author Don Baccus (arjun@openforce.net) +-- @creation-date 2002-08-29 + +-- $Id: dotlrn-forums-admin-portlet-create.sql,v 1.1.2.1 2002/10/17 10:52:27 jeffd Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License version 2 or higher. Full text of the license is available +-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html + +create function inline_0() +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource__new( + ''dotlrn_forums_admin_portlet'', -- name + ''Displays the dotlrn_forums_admin'' -- description + ); + + -- 4 defaults procs + + -- shadeable_p + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''t'', -- configured_p + ''shadeable_p'', -- key + ''f'' -- value + ); + + -- shaded_p + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''t'', -- configured_p + ''shaded_p'', -- key + ''f'' -- value + ); + + -- hideable_p + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''t'', -- configured_p + ''hideable_p'', -- key + ''t'' -- value + ); + + -- user_editable_p + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''t'', -- configured_p + ''user_editable_p'', -- key + ''f'' -- value + ); + + -- link_hideable_p + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''t'', -- configured_p + ''link_hideable_p'', -- key + ''t'' -- value + ); + + + -- forums_admin-specific procs + + -- package_id must be configured + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''f'', -- configured_p + ''package_id'', -- key + '''' -- value + ); + + return 0; + +end;' language 'plpgsql'; +select inline_0(); +drop function inline_0(); + + +create function inline_0() +returns integer as ' +declare + foo integer; +begin + -- create the implementation + perform acs_sc_impl__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''dotlrn_forums_admin_portlet'' + ); + return 0; + +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + +create function inline_0() +returns integer as ' +declare + foo integer; +begin + + -- add all the hooks + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''GetMyName'', + ''dotlrn_forums_admin_portlet::get_my_name'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''GetPrettyName'', + ''dotlrn_forums_admin_portlet::get_pretty_name'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''Link'', + ''dotlrn_forums_admin_portlet::link'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''AddSelfToPage'', + ''dotlrn_forums_admin_portlet::add_self_to_page'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''Show'', + ''dotlrn_forums_admin_portlet::show'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''Edit'', + ''dotlrn_forums_admin_portlet::edit'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''dotlrn_forums_admin_portlet'', + ''RemoveSelfFromPage'', + ''dotlrn_forums_admin_portlet::remove_self_from_page'', + ''TCL'' + ); + + return 0; + +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + +create function inline_0() +returns integer as ' +declare + foo integer; +begin + + -- Add the binding + perform acs_sc_binding__new ( + ''portal_datasource'', -- contract_name + ''dotlrn_forums_admin_portlet'' -- impl_name + ); + return 0; + +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); 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 -N -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 Index: openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-admin-portlet-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-admin-portlet-procs.tcl 17 Oct 2002 10:52:27 -0000 1.1.2.1 @@ -0,0 +1,89 @@ +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_library { + + Procedures to supports forums admin portlets + + @creation-date September 30 2001 + @author arjun@openforce.net + @version $Id: dotlrn-forums-admin-portlet-procs.tcl,v 1.1.2.1 2002/10/17 10:52:27 jeffd Exp $ +} + +namespace eval dotlrn_forums_admin_portlet { + + ad_proc -private get_my_name { + } { + return "dotlrn_forums_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "Forums Administration" + } + + ad_proc -private my_package_key { + } { + return "dotlrn-forums" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + } { + Adds a forums admin PE to the admin portal + + @return new element_id + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -key package_id \ + -value $package_id + ] + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + } { + Removes the forums admin PE from the portal + } { + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "dotlrn-forums-admin-portlet" + } + + ad_proc -public edit { + cf + } { + } { + return "" + } + +} 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 -N -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 { Index: openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.xql 17 Oct 2002 10:52:27 -0000 1.1.2.1 @@ -0,0 +1,11 @@ + + + + + select forum_id + from forums_forums + where package_id = :package_id + and autosubscribe_p = 't' + + + Index: openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.adp 17 Oct 2002 10:52:27 -0000 1.1.2.1 @@ -0,0 +1,34 @@ +<% + + # + # Copyright (C) 2001, 2002 OpenForce, Inc. + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # + +%> + + Index: openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-forums/www/dotlrn-forums-admin-portlet.tcl 17 Oct 2002 10:52:27 -0000 1.1.2.1 @@ -0,0 +1,59 @@ +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +# This version of the forums-admin-portlet has been customized for dotLRN + +ad_page_contract { + The display logic for the forums admin portlet + + @author Ben Adida (ben@openforce) + @cvs_id $Id: dotlrn-forums-admin-portlet.tcl,v 1.1.2.1 2002/10/17 10:52:27 jeffd Exp $ +} -properties { + +} + +array set config $cf + +set list_of_package_ids $config(package_id) + +if {[llength $list_of_package_ids] > 1} { + # We have a problem! + return -code error "There should be only one instance of forums for admin purposes" +} + +set package_id [lindex $list_of_package_ids 0] +set return_url "[ad_conn url]?[ad_conn query]" +set community_id [dotlrn_community::get_community_id] + +db_multirow -extend {query_vars} forums select_forums { + select forum_id, name, enabled_p, autosubscribe_p + from forums_forums + where package_id = :package_id +} { + set query_vars [export_vars {return_url community_id forum_id}] +} + +set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0] +set dotlrn_url [dotlrn::get_url] + +set package_id [ad_conn package_id] +set default_name [db_string select_package_name { + select instance_name from apm_packages where package_id= :package_id +}] + +append default_name " Forum" + +set encoded_default_name [ns_urlencode $default_name] + +ad_return_template