Index: openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 9 Nov 2001 20:33:25 -0000 1.3
+++ openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 19 Jan 2002 21:14:19 -0000 1.4
@@ -22,9 +22,13 @@
+
+
+
+
Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql 19 Jan 2002 21:14:19 -0000 1.1
@@ -0,0 +1,197 @@
+--
+-- packages/dotlrn-portlet/sql/oracle/dotlrn-portlets-create.sql
+--
+
+-- Creates dotlrn admin datasource
+
+-- Copyright (C) 2001 OpenForce, Inc.
+-- @author Arjun Sanyal (arjun@openforce.net)
+-- @author Ben Adida (ben@openforce.net)
+-- @creation-date 2002-01-19
+
+-- $Id: dotlrn-admin-portlet-create.sql,v 1.1 2002/01/19 21:14:19 ben 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_admin_portlet',
+ description => 'Displays the dotlrn community admin 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 => '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 => 'f'
+);
+
+ -- 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_admin_portlet',
+ 'dotlrn_admin_portlet'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+
+ -- add all the hooks
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'MyName',
+ 'dotlrn_admin_portlet::my_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'GetPrettyName',
+ 'dotlrn_admin_portlet::get_pretty_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'Link',
+ 'dotlrn_admin_portlet::link',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'AddSelfToPage',
+ 'dotlrn_admin_portlet::add_self_to_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'Show',
+ 'dotlrn_admin_portlet::show',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'Edit',
+ 'dotlrn_admin_portlet::edit',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'RemoveSelfFromPage',
+ 'dotlrn_admin_portlet::remove_self_from_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'MakeSelfAvailable',
+ 'dotlrn_admin_portlet::make_self_available',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'dotlrn_admin_portlet',
+ 'MakeSelfUnavailable',
+ 'dotlrn_admin_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_admin_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.8 -r1.9
--- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 17 Jan 2002 22:01:28 -0000 1.8
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 19 Jan 2002 21:14:19 -0000 1.9
@@ -194,3 +194,4 @@
/
show errors
+@dotlrn-admin-portlet-create.sql
Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 19 Jan 2002 21:14:19 -0000 1.1
@@ -0,0 +1,137 @@
+# /packages/dotlrn-portlets/tcl/dotlrn-portlets-procs.tcl
+ad_library {
+
+Procedures to supports dotlrn admin portlets
+
+Copyright Openforce, Inc.
+Licensed under GNU GPL v2
+
+@creation-date September 30 2001
+@author arjun@openforce.net
+@author ben@openforce.net
+@cvs-id $Id: dotlrn-admin-portlet-procs.tcl,v 1.1 2002/01/19 21:14:19 ben Exp $
+
+}
+
+namespace eval dotlrn_portlet {
+
+ ad_proc -private my_name {
+ } {
+ return "dotlrn_portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "Group Information"
+ }
+
+ ad_proc -public my_package_key {
+ } {
+ return "dotlrn-portlet"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+
+ ad_proc -public add_self_to_page {
+ portal_id
+ community_id
+ } {
+ Adds a dotlrn PE to the given page with the community_id as
+ opaque data in the portal configuration.
+
+ @return element_id The new element's id
+ @param portal_id The page to add self to
+ @param community_id The dotlrn community to show info about
+ @author arjun@openforce.net
+ @creation-date Sept 2001
+ } {
+ # Tell portal to add this element to the page
+ set element_id [portal::add_element_to_region $portal_id [my_name] 2]
+
+ # The default param must be configured
+ set key "community_id"
+ # set value [portal::get_element_param $element_id $key]
+
+ portal::set_element_param $element_id $key $community_id
+
+ return $element_id
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ Display the PE
+
+ @return HTML string
+ @param cf A config array
+ @author arjun@openforce.net
+ @creation-date Sept 2001
+ } {
+ # no return call required with the helper proc
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "dotlrn-admin-portlet"
+ }
+
+ ad_proc -public remove_self_from_page {
+ portal_id
+ community_id
+ } {
+ Removes a dotlrn PE from the given page
+
+ @param portal_id The page to remove self from
+ @param community_id
+ @author arjun@openforce.net
+ @creation-date Sept 2001
+ } {
+ # 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 for the portal:: proc
+
+ @param portal_id
+ @author arjun@openforce.net
+ @creation-date Nov 2001
+ } {
+ portal::make_datasource_available \
+ $portal_id [portal::get_datasource_id [my_name]]
+ }
+
+ ad_proc -public make_self_unavailable {
+ portal_id
+ } {
+ Wrapper for the portal:: proc
+
+ @param portal_id
+ @author arjun@openforce.net
+ @creation-date Nov 2001
+ } {
+ portal::make_datasource_unavailable \
+ $portal_id [portal::get_datasource_id [my_name]]
+ }
+}
+
+
+
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp 19 Jan 2002 21:14:19 -0000 1.1
@@ -0,0 +1,2 @@
+
+FOOBAR!! (Replace this with Yon's admin page)
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl 19 Jan 2002 21:14:19 -0000 1.1
@@ -0,0 +1,16 @@
+
+# www/news-portlet.tcl
+ad_page_contract {
+ The display logic for the dotlrn admin portlet
+
+ @author Arjun Sanyal (arjun@openforce.net)
+ @author Ben Adida (ben@openforce)
+ @cvs_id $Id: dotlrn-admin-portlet.tcl,v 1.1 2002/01/19 21:14:19 ben Exp $
+} -properties {
+
+}
+
+array set config $cf
+
+ad_return_template
+