Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,194 @@
+--
+-- Creates dotlrn datasource for showing members of a community
+--
+-- Copyright (C) 2001 OpenForce, Inc.
+-- @author Arjun Sanyal (arjun@openforce.net)
+-- @creation-date 2001-30-09
+
+-- $Id: dotlrn-members-portlet-create.sql,v 1.1 2002/03/06 23:21:16 arjun 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_members_portlet',
+ description => 'Displays the members of this community '
+ );
+
+
+
+ -- 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 => 't'
+);
+
+ -- 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'
+);
+
+ -- portlet-specific procs
+
+ -- community_id must be configured!
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 'f',
+ key => 'community_id',
+ value => ''
+);
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- create the implementation
+ foo := acs_sc_impl.new (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'dotlrn_members_portlet'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+
+ -- add all the hooks
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'MyName',
+ 'dotlrn_members_portlet::my_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'GetPrettyName',
+ 'dotlrn_members_portlet::get_pretty_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'Link',
+ 'dotlrn_members_portlet::link',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'AddSelfToPage',
+ 'dotlrn_members_portlet::add_self_to_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'Show',
+ 'dotlrn_members_portlet::show',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'Edit',
+ 'dotlrn_members_portlet::edit',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'RemoveSelfFromPage',
+ 'dotlrn_members_portlet::remove_self_from_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'MakeSelfAvailable',
+ 'dotlrn_members_portlet::make_self_available',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_portlet',
+ 'MakeSelfUnavailable',
+ 'dotlrn_members_portlet::make_self_unavailable',
+ 'TCL'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+
+ -- Add the binding
+ acs_sc_binding.new (
+ contract_name => 'portal_datasource',
+ impl_name => 'dotlrn_members_portlet'
+ );
+end;
+/
+show errors
+
+
Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,194 @@
+--
+
+-- Creates dotlrn datasource for showing staff members for a comunity
+
+-- Copyright (C) 2001 OpenForce, Inc.
+-- @author Arjun Sanyal (arjun@openforce.net)
+-- @creation-date 2001-30-09
+
+-- $Id: dotlrn-members-staff-portlet-create.sql,v 1.1 2002/03/06 23:21:16 arjun 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_members_staff_portlet',
+ description => 'Displays the dotlrn community info '
+ );
+
+
+
+ -- 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 => 't'
+);
+
+ -- 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'
+);
+
+ -- portlet-specific procs
+
+ -- community_id must be configured!
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 'f',
+ key => 'community_id',
+ value => ''
+);
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- create the implementation
+ foo := acs_sc_impl.new (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'dotlrn_members_staff_portlet'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+
+ -- add all the hooks
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'MyName',
+ 'dotlrn_members_staff_portlet::my_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'GetPrettyName',
+ 'dotlrn_members_staff_portlet::get_pretty_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'Link',
+ 'dotlrn_members_staff_portlet::link',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'AddSelfToPage',
+ 'dotlrn_members_staff_portlet::add_self_to_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'Show',
+ 'dotlrn_members_staff_portlet::show',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'Edit',
+ 'dotlrn_members_staff_portlet::edit',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'RemoveSelfFromPage',
+ 'dotlrn_members_staff_portlet::remove_self_from_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'MakeSelfAvailable',
+ 'dotlrn_members_staff_portlet::make_self_available',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_members_staff_portlet',
+ 'MakeSelfUnavailable',
+ 'dotlrn_members_staff_portlet::make_self_unavailable',
+ 'TCL'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+
+ -- Add the binding
+ acs_sc_binding.new (
+ contract_name => 'portal_datasource',
+ impl_name => 'dotlrn_members_staff_portlet'
+ );
+end;
+/
+show errors
+
Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 19 Jan 2002 21:14:19 -0000 1.9
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 6 Mar 2002 23:21:16 -0000 1.10
@@ -195,3 +195,5 @@
show errors
@dotlrn-admin-portlet-create.sql
+@dotlrn-members-portlet-create.sql
+@dotlrn-members-staff-portlet-create.sql
Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,107 @@
+ad_library {
+
+ Procedures to supports the dotlrn "members" portlet
+
+ Copyright Openforce, Inc.
+ Licensed under GNU GPL v2
+
+ @author arjun@openforce.net
+ @cvs-id $Id: dotlrn-members-portlet-procs.tcl,v 1.1 2002/03/06 23:21:16 arjun Exp $
+
+}
+
+namespace eval dotlrn_members_portlet {
+
+ ad_proc -private my_name {
+ } {
+ return "dotlrn_members_portlet"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "dotlrn-portlet"
+ }
+
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "Members"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-page_id ""}
+ portal_id
+ community_id
+ } {
+
+ } {
+ return [portal::add_element_or_append_id \
+ -portal_id $portal_id \
+ -page_id $page_id \
+ -portlet_name [my_name] \
+ -value_id $community_id \
+ -key community_id ]
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ Call the template to display
+
+ @param cf A config array
+ } {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "dotlrn-members-portlet"
+ }
+
+ ad_proc -public remove_self_from_page {
+ portal_id
+ community_id
+ } {
+ Removes the PE from the given page
+ } {
+ # get the element IDs (could be more than one!)
+ set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]]
+
+ # remove all elements
+ db_transaction {
+ foreach element_id $element_ids {
+ portal::remove_element $element_id
+ }
+ }
+ }
+
+ ad_proc -public edit {
+ nothing here, move along
+ } {
+ return ""
+ }
+
+ ad_proc -public make_self_available {
+ portal_id
+ } {
+ wrapper
+ } {
+ portal::make_datasource_available \
+ $portal_id [portal::get_datasource_id [my_name]]
+ }
+
+ ad_proc -public make_self_unavailable {
+ portal_id
+ } {
+ wrapper
+ } {
+ portal::make_datasource_unavailable \
+ $portal_id [portal::get_datasource_id [my_name]]
+ }
+}
+
+
+
Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,106 @@
+ad_library {
+
+ Procedures to supports the dotlrn "members staff" portlet
+
+ Copyright Openforce, Inc.
+ Licensed under GNU GPL v2
+
+ @author arjun@openforce.net
+ @cvs-id $Id: dotlrn-members-staff-portlet-procs.tcl,v 1.1 2002/03/06 23:21:16 arjun Exp $
+
+}
+
+namespace eval dotlrn_members_staff_portlet {
+
+ ad_proc -private my_name {
+ } {
+ return "dotlrn_members_staff_portlet"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "dotlrn-portlet"
+ }
+
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "Staff List"
+ }
+
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+
+ ad_proc -public add_self_to_page {
+ portal_id
+ community_id
+ } {
+
+ } {
+ return [portal::add_element_or_append_id -portal_id $portal_id \
+ -portlet_name [my_name] \
+ -value_id $community_id \
+ -key community_id]
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ Call the template to display
+
+ @param cf A config array
+ } {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "dotlrn-members-staff-portlet"
+ }
+
+ ad_proc -public remove_self_from_page {
+ portal_id
+ community_id
+ } {
+ Removes the PE from the given page
+ } {
+ # get the element IDs (could be more than one!)
+ set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]]
+
+ # remove all elements
+ db_transaction {
+ foreach element_id $element_ids {
+ portal::remove_element $element_id
+ }
+ }
+ }
+
+ ad_proc -public edit {
+ nothing here, move along
+ } {
+ return ""
+ }
+
+ ad_proc -public make_self_available {
+ portal_id
+ } {
+ wrapper
+ } {
+ portal::make_datasource_available \
+ $portal_id [portal::get_datasource_id [my_name]]
+ }
+
+ ad_proc -public make_self_unavailable {
+ portal_id
+ } {
+ wrapper
+ } {
+ portal::make_datasource_unavailable \
+ $portal_id [portal::get_datasource_id [my_name]]
+ }
+}
+
+
+
Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl,v
diff -u -r1.21 -r1.22
--- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 14 Feb 2002 19:47:44 -0000 1.21
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 6 Mar 2002 23:21:16 -0000 1.22
@@ -27,7 +27,7 @@
ad_proc -public get_pretty_name {
} {
- return "Group Information"
+ return "FIXME name Information"
}
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.adp 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,8 @@
+
+
+@member_data@
+
+
+
+
+
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,19 @@
+ad_page_contract {
+ The display logic for the dotrn members portlet
+
+ @author Arjun Sanyal (arjun@openforce.net)
+ @cvs_id $Id: dotlrn-members-portlet.tcl,v 1.1 2002/03/06 23:21:16 arjun Exp $
+} -properties {
+
+}
+
+array set config $cf
+set community_id $config(community_id)
+
+if {[dotlrn::user_can_read_private_data_p]} {
+ set member_data "FIXME: here's where the list of members will gorole, first name, last name, email
+List of Members"
+} else {
+ set member_data ""
+}
+
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.adp 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,12 @@
+
+
+ @staff_data@
+
+
+
+ @student_list_link@
+
+
+
+
+
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-staff-portlet.tcl 6 Mar 2002 23:21:16 -0000 1.1
@@ -0,0 +1,24 @@
+ad_page_contract {
+ The display logic for the dotrn "staff list" PE
+
+ @author Arjun Sanyal (arjun@openforce.net)
+ @cvs_id $Id: dotlrn-members-staff-portlet.tcl,v 1.1 2002/03/06 23:21:16 arjun Exp $
+} -properties {
+
+}
+
+array set config $cf
+set community_id $config(community_id)
+
+set staff_data "FIXME: here's where the staff data will go:
+profs
+ta's
+ca's
+"
+
+if {[dotlrn::user_can_read_private_data_p]} {
+ set student_list_link "show student list
+
List of Members"
+} else {
+ set student_list_link ""
+}
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.adp 18 Feb 2002 05:53:29 -0000 1.2
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.adp 6 Mar 2002 23:21:16 -0000 1.3
@@ -4,10 +4,6 @@
- @member_link@
-
-
-
@subcomm_data@
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.tcl 14 Feb 2002 19:47:44 -0000 1.1
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-portlet.tcl 6 Mar 2002 23:21:16 -0000 1.2
@@ -14,11 +14,12 @@
set pretty_name [dotlrn_community::get_community_name $community_id]
set description [dotlrn_community::get_community_description $community_id]
-if {[dotlrn::user_can_read_private_data_p]} {
- set member_link "
List of Members"
-} else {
- set member_link ""
-}
+# aks move to "members" portlets
+#if {[dotlrn::user_can_read_private_data_p]} {
+# set member_link "
List of Members"
+#} else {
+# set member_link ""
+#}
set subcomm_list [dotlrn_community::get_subcomm_list -community_id $community_id]