Index: openacs-4/packages/bboard-portlet/bboard-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/bboard-portlet.info,v
diff -u -N -r1.7 -r1.8
--- openacs-4/packages/bboard-portlet/bboard-portlet.info 20 Jan 2002 19:19:23 -0000 1.7
+++ openacs-4/packages/bboard-portlet/bboard-portlet.info 9 May 2002 23:59:51 -0000 1.8
@@ -32,7 +32,7 @@
-
+
Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql 29 Mar 2002 19:51:43 -0000 1.2
+++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3
@@ -125,8 +125,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'bboard_admin_portlet',
- 'MyName',
- 'bboard_admin_portlet::my_name',
+ 'GetMyName',
+ 'bboard_admin_portlet::get_my_name',
'TCL'
);
@@ -178,22 +178,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'bboard_admin_portlet',
- 'MakeSelfAvailable',
- 'bboard_admin_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'bboard_admin_portlet',
- 'MakeSelfUnavailable',
- 'bboard_admin_portlet::make_self_unavailable',
- 'TCL'
- );
-
end;
/
show errors
Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql,v
diff -u -N -r1.17 -r1.18
--- openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql 29 Mar 2002 19:51:43 -0000 1.17
+++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql 9 May 2002 23:59:51 -0000 1.18
@@ -136,8 +136,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'bboard_portlet',
- 'MyName',
- 'bboard_portlet::my_name',
+ 'GetMyName',
+ 'bboard_portlet::get_my_name',
'TCL'
);
@@ -189,22 +189,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'bboard_portlet',
- 'MakeSelfAvailable',
- 'bboard_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'bboard_portlet',
- 'MakeSelfUnavailable',
- 'bboard_portlet::make_self_unavailable',
- 'TCL'
- );
-
end;
/
show errors
Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql 29 Mar 2002 19:51:43 -0000 1.3
+++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-drop.sql 9 May 2002 23:59:51 -0000 1.4
@@ -60,7 +60,7 @@
foo := acs_sc_impl.delete_alias (
'portal_datasource',
'bboard_portlet',
- 'MyName'
+ 'GetMyName'
);
foo := acs_sc_impl.delete_alias (
@@ -100,18 +100,6 @@
'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'bboard_portlet',
- 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'bboard_portlet',
- 'MakeSelfUnavailable'
- );
-
-- Drop the binding
acs_sc_binding.delete (
contract_name => 'portal_datasource',
Index: openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 29 Mar 2002 19:51:43 -0000 1.4
+++ openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.5
@@ -14,23 +14,18 @@
# details.
#
-# /packages/bboard-portlets/tcl/bboard-portlets-procs.tcl
ad_library {
-Procedures to supports bboard admin portlets
-
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
-
-@creation-date September 30 2001
-@author arjun@openforce.net
-@cvs-id $Id$
-
+ Procedures to supports bboard admin portlets
+
+ @creation-date September 30 2001
+ @author arjun@openforce.net
+ @version $Id$
}
namespace eval bboard_admin_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "bboard_admin_portlet"
}
@@ -47,127 +42,57 @@
ad_proc -public link {
} {
- return "bboards"
+ return ""
}
ad_proc -public add_self_to_page {
portal_id
- instance_id
- args
+ instance_id
} {
- Adds a bboard PE to the given page with the instance key being
- opaque data in the portal configuration.
-
- @return element_id The new element's id
- @param portal_id The page to add self to
- @param instance_id The bboard instace to show
- @param args an arg string not used
- @author arjun@openforce.net
- @creation-date Sept 2001
+ Adds a bboard admin PE to the admin portal
+
+ @return new element_id
} {
- # Add some smarts to only add one portlet for now when it's added multiple times (ben)
- # Find out if bboard already exists
- set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]]
+ # we use "portal::add_element" here since there is no
+ # configuration necessary for this portlet (no params)
+ set element_id [portal::add_element \
+ -pretty_name [get_pretty_name] \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ ]
- if {[llength $element_id_list] == 0} {
- # Tell portal to add this element to the page
- set element_id [portal::add_element $portal_id [my_name]]
- # There is already a value for the param which must be overwritten
- portal::set_element_param $element_id instance_id $instance_id
- set package_id_list [list]
- } else {
- set element_id [lindex $element_id_list 0]
- # There are existing values which should NOT be overwritten
- portal::add_element_param_value -element_id $element_id -key instance_id -value $instance_id
- }
-
- return $element_id
+ # XXX AKS1 needs instance_id params???
+ portal::set_element_param $element_id "instance_id" $instance_id
+ return $element_id
}
+ ad_proc -public remove_self_from_page {
+ portal_id
+ } {
+ Removes the bboard admin PE from the portal
+ } {
+ portal::remove_element \
+ -portal_id $portal_id \
+ -datasource_name [get_my_name]
+ }
+
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 "bboard-admin-portlet"
}
ad_proc -public edit {
- element_id
+ cf
} {
- Display the PE's edit page
-
- @return HTML string
- @param cf A config array
- @author arjun@openforce.net
- @creation-date Nov 2001
} {
return ""
}
-
- ad_proc -public remove_self_from_page {
- portal_id
- instance_id
- } {
- Removes a bboard PE from the given page
-
- @param portal_id The page to remove self from
- @param instance_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 {
- # Highly simplified (ben)
- portal::remove_element_param_value -element_id $element_id -key instance_id -value $instance_id
-
- # Check if we should really remove the element
- if {[llength [portal::get_element_param_list -element_id $element_id -key instance_id]] == 0} {
- portal::remove_element $element_id
- }
- }
- }
- }
-
- 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/bboard-portlet/tcl/bboard-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl,v
diff -u -N -r1.40 -r1.41
--- openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.40
+++ openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.41
@@ -14,23 +14,19 @@
# details.
#
-# /packages/bboard-portlets/tcl/bboard-portlets-procs.tcl
ad_library {
-Procedures to supports bboard portlets
+ Procedures to supports bboard portlets
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
+ @creation-date September 30 2001
+ @author arjun@openforce.net
+ @version $Id$
-@creation-date September 30 2001
-@author arjun@openforce.net
-@cvs-id $Id$
-
}
namespace eval bboard_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "bboard_portlet"
}
@@ -47,52 +43,42 @@
ad_proc -public link {
} {
- return "bboards"
+ return ""
}
ad_proc -public add_self_to_page {
portal_id
- instance_id
- args
+ bboard_instance_id
} {
- Adds a bboard PE to the given page with the instance key being
- opaque data in the portal configuration.
-
- @return element_id The new element's id
- @param portal_id The page to add self to
- @param instance_id The bboard instace to show
- @param args an arg string not used
- @author arjun@openforce.net
- @creation-date Sept 2001
+ Adds a bboard PE to the given portal or appends the given bboard instance_id
+ to the bboard PE that already on the portal
} {
- # Add some smarts to only add one portlet for now when it's added multiple times (ben)
- # Find out if bboard already exists
- set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]]
- if {[llength $element_id_list] == 0} {
- # Tell portal to add this element to the page
- set element_id [portal::add_element -pretty_name "Bboards" -force_region 1 $portal_id [my_name]]
- # There is already a value for the param which must be overwritten
- portal::set_element_param $element_id instance_id $instance_id
- set package_id_list [list]
- } else {
- set element_id [lindex $element_id_list 0]
- # There are existing values which should NOT be overwritten
- portal::add_element_param_value -element_id $element_id -key instance_id -value $instance_id
- }
-
- return $element_id
+ return [portal::add_element_or_append_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -pretty_name [get_pretty_name] \
+ -value_id $bboard_instance_id \
+ -force_region [ad_parameter "bboard_portlet_region" [my_package_key]]
+ ]
}
+
+ ad_proc -public remove_self_from_page {
+ portal_id
+ bboard_instance_id
+ } {
+ Removes a bboard PE from the given page or just the given bboard's instance_id
+ } {
+ portal::remove_element_or_remove_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value_id $bboard_instance_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 \
@@ -101,73 +87,6 @@
-template_src "bboard-portlet"
}
- ad_proc -public edit {
- element_id
- } {
- Display the PE's edit page
-
- @return HTML string
- @param cf A config array
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- return ""
- }
-
-
- ad_proc -public remove_self_from_page {
- portal_id
- instance_id
- } {
- Removes a bboard PE from the given page
-
- @param portal_id The page to remove self from
- @param instance_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 {
- # Highly simplified (ben)
- portal::remove_element_param_value -element_id $element_id -key instance_id -value $instance_id
-
- # Check if we should really remove the element
- if {[llength [portal::get_element_param_list -element_id $element_id -key instance_id]] == 0} {
- portal::remove_element $element_id
- }
- }
- }
- }
-
- 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/calendar-portlet/calendar-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/calendar-portlet.info,v
diff -u -N -r1.7 -r1.8
--- openacs-4/packages/calendar-portlet/calendar-portlet.info 17 Apr 2002 16:06:59 -0000 1.7
+++ openacs-4/packages/calendar-portlet/calendar-portlet.info 9 May 2002 23:59:51 -0000 1.8
@@ -40,6 +40,7 @@
+
Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql 29 Mar 2002 18:52:51 -0000 1.2
+++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-admin-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3
@@ -148,8 +148,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'calendar_admin_portlet',
- 'MyName',
- 'calendar_admin_portlet::my_name',
+ 'GetMyName',
+ 'calendar_admin_portlet::get_my_name',
'TCL'
);
@@ -201,22 +201,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'calendar_admin_portlet',
- 'MakeSelfAvailable',
- 'calendar_admin_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'calendar_admin_portlet',
- 'MakeSelfUnavailable',
- 'calendar_admin_portlet::make_self_unavailable',
- 'TCL'
- );
-
end;
/
show errors
Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql 29 Mar 2002 18:52:51 -0000 1.2
+++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-full-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3
@@ -148,8 +148,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'calendar_full_portlet',
- 'MyName',
- 'calendar_full_portlet::my_name',
+ 'GetMyName',
+ 'calendar_full_portlet::get_my_name',
'TCL'
);
@@ -201,22 +201,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'calendar_full_portlet',
- 'MakeSelfAvailable',
- 'calendar_full_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'calendar_full_portlet',
- 'MakeSelfUnavailable',
- 'calendar_full_portlet::make_self_unavailable',
- 'TCL'
- );
-
end;
/
show errors
Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql,v
diff -u -N -r1.17 -r1.18
--- openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql 29 Mar 2002 18:52:51 -0000 1.17
+++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-create.sql 9 May 2002 23:59:51 -0000 1.18
@@ -147,8 +147,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'calendar_portlet',
- 'MyName',
- 'calendar_portlet::my_name',
+ 'GetMyName',
+ 'calendar_portlet::get_my_name',
'TCL'
);
@@ -200,22 +200,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'calendar_portlet',
- 'MakeSelfAvailable',
- 'calendar_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'calendar_portlet',
- 'MakeSelfUnavailable',
- 'calendar_portlet::make_self_unavailable',
- 'TCL'
- );
-
end;
/
show errors
Index: openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql 29 Mar 2002 18:52:51 -0000 1.4
+++ openacs-4/packages/calendar-portlet/sql/oracle/calendar-portlet-drop.sql 9 May 2002 23:59:51 -0000 1.5
@@ -58,7 +58,7 @@
foo := acs_sc_impl.delete_alias (
'portal_datasource',
'calendar_portlet',
- 'MyName'
+ 'GetMyName'
);
foo := acs_sc_impl.delete_alias (
@@ -98,18 +98,6 @@
'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'calendar_portlet',
- 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'calendar_portlet',
- 'MakeSelfUnavailable'
- );
-
-- Drop the binding
acs_sc_binding.delete (
contract_name => 'portal_datasource',
Index: openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl 25 Apr 2002 04:25:29 -0000 1.5
+++ openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.6
@@ -14,20 +14,14 @@
# details.
#
-# calendar-portlet/tcl/calendar-portlet-procs.tcl
-
ad_library {
+
+ Procedures to support the calendar admin portlet
-Procedures to support the calendar admin portlet
-
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
-
-@creation-date Jan 2002
-@author arjun@openforce.net
-@author ben@openforce.net
-@cvs-id $Id$
-
+ @creation-date Jan 2002
+ @author arjun@openforce.net
+ @author ben@openforce.net
+ @cvs-id $Id$
}
namespace eval calendar_admin_portlet {
@@ -37,194 +31,59 @@
return "calendar-portlet"
}
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "calendar_admin_portlet"
}
ad_proc -public get_pretty_name {
} {
- # name hard wired for administration purposes (ben)
return "Calendar Administration"
}
ad_proc -public link {
} {
- return "calendar"
+ return ""
}
ad_proc -public add_self_to_page {
portal_id
calendar_id
} {
- Adds a calendar PE to the given page with the community_id.
+ Adds a admin calendar PE to the given portal
- @return element_id The new element's id
@param portal_id The page to add self to
@param calendar_id The new calendar_id to add
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @return element_id The new element's id
} {
- return [portal::add_element_or_append_id -portal_id $portal_id \
- -portlet_name [my_name] \
- -value_id $calendar_id \
- -key calendar_id]
- }
+ set element_id [portal::add_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ ]
+ portal::set_element_param $element_id "calendar_id" $calendar_id
+
+ return $element_id
+ }
+
ad_proc -public remove_self_from_page {
portal_id
- community_id
} {
- Removes a calendar 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
+ Removes a calendar admin PE
} {
- # it's more simple not to use portal::remove_element_or_remove_id here
-
- # 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 {
-
- set calendar_id \
- [portal::get_element_param $element_id "calendar_id"]
-
- set g_cal_id \
- [portal::get_element_param $element_id "calendar_id"]
-
- # don't delete the public calendar!
- if {[calendar_public_p $calendar_id] == "f"} {
-
- ns_log notice "aks15 in calendar_portlet remove_self_from_page $calendar_id/$element_id/$g_cal_id"
-
- # delete the personal calendar associated with this element
- db_exec_plsql delete_calendar {
- begin
- calendar.delete(
- calendar_id => :calendar_id
- );
- end;
- }
- }
- # get rid of this portal element
- portal::remove_element $element_id
- }
- }
-
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
}
-
- ad_proc -public make_self_available {
- page_id
- } {
- Wrapper for the portal:: proc
-
- @param page_id
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- portal::make_datasource_available \
- $page_id [portal::get_datasource_id [my_name]]
- }
-
- ad_proc -public make_self_unavailable {
- page_id
- } {
- Wrapper for the portal:: proc
-
- @param page_id
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- portal::make_datasource_unavailable \
- $page_id [portal::get_datasource_id [my_name]]
- }
-
-
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 "calendar-admin-portlet"
}
- ad_proc -public edit {
- element_id
- } {
- Display the PE's edit page
-
- @return HTML string
- @param cf A config array
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
-
- set calendar_id [portal::get_element_param $element_id "calendar_id"]
- set current_view [portal::get_element_param $element_id "default_view"]
-
- switch $current_view {
- "day" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
- }
- "week" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
- }
- "month" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
-
- }
- "list" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
- }
-
- return $html
- }
- }
-
-
-
}
Index: openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl 29 Mar 2002 18:52:51 -0000 1.3
+++ openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.4
@@ -14,19 +14,16 @@
# details.
#
-# calendar-portlet/tcl/calendar-portlet-procs.tcl
-
ad_library {
-Procedures to support the calendar portlet
+ Procedures to support the "full" calendar portlet. This is the
+ "wide" calendar with the navigation widget and helpful links. Not
+ to be confused with the (regular, narrow) calendar portlet that is titled
+ "Day Summary" by default.
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
-
-@creation-date Oct 26 2001
-@author arjun@openforce.net
-@cvs-id $Id$
-
+ @creation-date Oct 26 2001
+ @author arjun@openforce.net
+ @cvs-id $Id$
}
namespace eval calendar_full_portlet {
@@ -36,122 +33,62 @@
return "calendar-portlet"
}
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "calendar_full_portlet"
}
ad_proc -public get_pretty_name {
} {
- return [ad_parameter \
- -package_id [apm_package_id_from_key [my_package_key]] \
- "full_portlet_pretty_name"]
+ return [ad_parameter "full_portlet_pretty_name" [my_package_key]]
}
ad_proc -public link {
} {
- return "calendar"
+ return ""
}
ad_proc -public add_self_to_page {
{-page_id ""}
portal_id
calendar_id
} {
- Adds a calendar PE to the given page with the community_id.
+ Adds a "full" calendar PE to the given portal
- @return element_id The new element's id
@param portal_id The page to add self to
@param calendar_id The new calendar_id to add
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @return element_id The new element's id
} {
- return [portal::add_element_or_append_id -portal_id $portal_id \
+ return [portal::add_element_or_append_id \
+ -portal_id $portal_id \
-page_id $page_id \
- -portlet_name [my_name] \
+ -portlet_name [get_my_name] \
-pretty_name [get_pretty_name] \
-value_id $calendar_id \
-key calendar_id]
}
ad_proc -public remove_self_from_page {
portal_id
- package_id
+ calendar_id
} {
- Removes a calendar 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
+ Removes a "full" calendar PE from the given page or
+ a calendar_id from its params
} {
- ## YOWSA (ben)
- # calendar portlet should NOT be creating and deleting calendars!
- # I've taken out a chunk of code here that was removing calendars. No way! (ben).
-
- # get rid of this portal element
- # This automatically removes all element params
- portal::remove_element_or_remove_id -portal_id $portal_id -portlet_name [my_name] -key calendar_id -value_id $package_id
+ portal::remove_element_or_remove_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key calendar_id \
+ -value_id $package_id
}
-
-
- ad_proc -public make_self_available {
- page_id
- } {
- Wrapper for the portal:: proc
-
- @param page_id
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- portal::make_datasource_available \
- $page_id [portal::get_datasource_id [my_name]]
- }
-
- ad_proc -public make_self_unavailable {
- page_id
- } {
- Wrapper for the portal:: proc
-
- @param page_id
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- portal::make_datasource_unavailable \
- $page_id [portal::get_datasource_id [my_name]]
- }
-
-
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 "calendar-full-portlet"
}
- ad_proc -public edit {
- element_id
- } {
- Display the PE's edit page
-
- @return HTML string
- @param cf A config array
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- # We're going to have to replace this stuff with real templated stuff
- }
-
-
-
}
Index: openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl,v
diff -u -N -r1.25 -r1.26
--- openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 16 Apr 2002 05:16:28 -0000 1.25
+++ openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.26
@@ -14,19 +14,14 @@
# details.
#
-# calendar-portlet/tcl/calendar-portlet-procs.tcl
-
ad_library {
+
+ Procedures to support the (normal, narrow) calendar portlet a.k.a.
+ "Day Summary". Not to be confused with the "full" calendar portlet.
-Procedures to support the calendar portlet
+ @author arjun@openforce.net
+ @cvs-id $Id$
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
-
-@creation-date Oct 26 2001
-@author arjun@openforce.net
-@cvs-id $Id$
-
}
namespace eval calendar_portlet {
@@ -36,170 +31,68 @@
return "calendar-portlet"
}
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "calendar_portlet"
}
ad_proc -public get_pretty_name {
} {
- return [ad_parameter \
- -package_id [apm_package_id_from_key [my_package_key]] \
- "pretty_name"]
+ return [ad_parameter "pretty_name" [my_package_key]]
}
ad_proc -public link {
} {
- return [get_pretty_name]
+ return ""
}
ad_proc -public add_self_to_page {
{-page_id ""}
portal_id
calendar_id
} {
- Adds a calendar PE to the given page with the community_id.
+ Adds a (normal) calendar PE to the given page or appends a
+ calendar_id to the current calendar portlet
- @return element_id The new element's id
@param portal_id The page to add self to
@param calendar_id The new calendar_id to add
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @return element_id The new element's id
} {
- return [portal::add_element_or_append_id -portal_id $portal_id \
+ return [portal::add_element_or_append_id \
+ -portal_id $portal_id \
-page_id $page_id \
- -portlet_name [my_name] \
+ -portlet_name [get_my_name] \
-pretty_name [get_pretty_name] \
-value_id $calendar_id \
- -force_region 2 \
- -key calendar_id]
+ -force_region [ad_parameter "force_region" [my_package_key]] \
+ -key calendar_id
+ ]
}
ad_proc -public remove_self_from_page {
portal_id
calendar_id
} {
- Removes a calendar PE from the given page
+ Removes a calendar PE from the given page or just
+ the given calendar_id
@param portal_id The page to remove self from
- @param community_id
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @param calendar_id
} {
- ## YOWSA (ben)
- # calendar portlet should NOT be creating and deleting calendars!
- # I've taken out a chunk of code here that was removing calendars. No way! (ben).
-
- # get rid of this portal element
- # This automatically removes all element params
- portal::remove_element_or_remove_id -portal_id $portal_id -portlet_name [my_name] -key calendar_id -value_id $calendar_id
+ portal::remove_element_or_remove_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key calendar_id \
+ -value_id $calendar_id
}
-
- ad_proc -public make_self_available {
- page_id
- } {
- Wrapper for the portal:: proc
-
- @param page_id
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- portal::make_datasource_available \
- $page_id [portal::get_datasource_id [my_name]]
- }
-
- ad_proc -public make_self_unavailable {
- page_id
- } {
- Wrapper for the portal:: proc
-
- @param page_id
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
- portal::make_datasource_unavailable \
- $page_id [portal::get_datasource_id [my_name]]
- }
-
-
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
}
- ad_proc -public edit {
- element_id
- } {
- Display the PE's edit page
-
- @return HTML string
- @param cf A config array
- @author arjun@openforce.net
- @creation-date Nov 2001
- } {
-
- set calendar_id [portal::get_element_param $element_id "calendar_id"]
- set current_view [portal::get_element_param $element_id "default_view"]
-
- switch $current_view {
- "day" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
- }
- "week" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
- }
- "month" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
-
- }
- "list" {
- set html "Set default view to:
-
-
- day
- week
- month
- list
- "
- }
-
- return $html
- }
- }
-
-
-
}
Index: openacs-4/packages/dotlrn/dotlrn.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v
diff -u -N -r1.77 -r1.78
--- openacs-4/packages/dotlrn/dotlrn.info 8 May 2002 14:35:07 -0000 1.77
+++ openacs-4/packages/dotlrn/dotlrn.info 9 May 2002 23:59:51 -0000 1.78
@@ -407,6 +407,7 @@
+
Index: openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql 6 May 2002 23:55:01 -0000 1.1
+++ openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql 9 May 2002 23:59:51 -0000 1.2
@@ -99,20 +99,12 @@
'dotlrn_main_portlet'
);
-end;
-/
-show errors
-
-declare
- foo integer;
-begin
-
-- add all the hooks
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_main_portlet',
- 'MyName',
- 'dotlrn_main_portlet::my_name',
+ 'GetMyName',
+ 'dotlrn_main_portlet::get_my_name',
'TCL'
);
@@ -140,39 +132,31 @@
'TCL'
);
+
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_main_portlet',
- 'Show',
- 'dotlrn_main_portlet::show',
+ 'RemoveSelfFromPage',
+ 'dotlrn_main_portlet::remove_self_from_page',
'TCL'
);
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_main_portlet',
- 'Edit',
- 'dotlrn_main_portlet::edit',
+ 'Show',
+ 'dotlrn_main_portlet::show',
'TCL'
);
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_main_portlet',
- 'RemoveSelfFromPage',
- 'dotlrn_main_portlet::remove_self_from_page',
+ 'Edit',
+ 'dotlrn_main_portlet::edit',
'TCL'
);
-
-end;
-/
-show errors
-
-declare
- foo integer;
-begin
-
-- Add the binding
acs_sc_binding.new (
contract_name => 'portal_datasource',
Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-main-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/Attic/dotlrn-main-portlet-create.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-main-portlet-create.sql 29 Mar 2002 19:14:44 -0000 1.2
+++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-main-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3
@@ -79,8 +79,8 @@
select acs_sc_impl_alias__new (
''portal_datasource'',
''dotlrn_main_portlet'',
- ''MyName'',
- ''dotlrn_main_portlet::my_name'',
+ ''GetMyName'',
+ ''dotlrn_main_portlet::get_my_name'',
''TCL''
);
Index: openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl,v
diff -u -N -r1.20 -r1.21
--- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 29 Mar 2002 19:14:45 -0000 1.20
+++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.21
@@ -14,24 +14,21 @@
# details.
#
-# dotlrn/tcl/dotlrn-main-portlet-procs.tcl
-
ad_library {
- Procedures to supports dotlrn main portlet
+ The "dotlrn main" portlet shows a list of the classes and communities that
+ the user is a member of on the user's workspace portal. Not to be confused
+ with the "dotlrn" portlet that shows the subgroups of the current community
+ and is only on community portals.
- Copyright Openforce, Inc.
- Licensed under GNU GPL v2
-
- @creation-date November 4 2001
- @author ben@openforce.net
+ @author ben@openforce.net, arjun@openforce.net
@version $Id$
}
namespace eval dotlrn_main_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "dotlrn_main_portlet"
}
@@ -47,68 +44,37 @@
}
ad_proc -public add_self_to_page {
- {-page_id ""}
portal_id
- instance_id
} {
- Adds a dotLRN PE to the given page with the instance key being
- opaque data in the portal configuration.
-
- @return element_id The new element's id
- @param portal_id The page to add self to
- @param instance_id The bboard instace to show
- @author arjun@openforce.net
- @creation-date Nov 2001
+ @return new element_id
} {
+ # we use "portal::add_element" here since there is no
+ # configuration necessary for this portlet (no params)
+ return [portal::add_element \
+ -force_region [ad_parameter "dotlrn_main_portlet_region" dotlrn] \
+ -pretty_name [get_pretty_name] \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ ]
+ }
- # Tell portal to add this element to the page
- set element_id [portal::add_element -force_region 2 -page_id $page_id -pretty_name [get_pretty_name] $portal_id [my_name]]
-
- return $element_id
+ ad_proc -public remove_self_from_page {
+ portal_id
+ } {
+ Removes the dotlrn main PE from the portal
+ } {
+ portal::remove_element \
+ -portal_id $portal_id \
+ -datasource_name [get_my_name]
}
ad_proc -public show {
cf
} {
- Display the PE
-
- @return HTML string
- @param cf A config array
- @author ben@openforce.net
- @creation-date Nov 2001
} {
- # no return call required with the helper proc
portal::show_proc_helper \
-template_src "dotlrn-main-portlet" \
-package_key "dotlrn" \
-config_list $cf
}
-
- ad_proc -public edit {
- cf
- } {
- return ""
- }
-
- ad_proc -public remove_self_from_page {
- portal_id
- instance_id
- } {
- Removes a bboard PE from the given page
-
- @param portal_id The page to remove self from
- @param instance_id
- @author ben@openforce.net
- @creation-date Nov 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
- }
- }
- }
}
Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v
diff -u -N -r1.36 -r1.37
--- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 6 May 2002 23:55:02 -0000 1.36
+++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 9 May 2002 23:59:52 -0000 1.37
@@ -103,19 +103,19 @@
ns_set put $extra_vars access_level $access_level
ns_set put $extra_vars id $id
+ set template_id \
+ [dotlrn_community::get_type_portal_id -community_type "user_workspace"]
db_transaction {
set portal_id [portal::create \
- -template_id [dotlrn_community::get_type_portal_id -community_type "user_workspace"] \
+ -template_id $template_id \
-name "Your dotLRN Workspace" \
$user_id
]
ns_set put $extra_vars portal_id $portal_id
- set page_id [portal::get_page_id -portal_id $portal_id -sort_key 0]
- dotlrn_main_portlet::add_self_to_page -page_id $page_id $portal_id ""
-
- # Add the relation (no need to feed in anything for object_id_one, or two for that matter).
+ # Add the relation (no need to feed in anything for object_id_one,
+ # or two for that matter).
set rel_id [relation_add \
-extra_vars $extra_vars \
-member_state approved \
@@ -124,6 +124,9 @@
$user_id \
]
+ # add the "dotlrn main" portlet to the user's workspace
+ dotlrn_main_portlet::add_self_to_page $portal_id
+
dotlrn_community::applets_dispatch -op AddUser -list_args [list $user_id]
# if the user is a member of communities (from some previous
Index: openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl,v
diff -u -N -r1.33 -r1.34
--- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 7 May 2002 22:06:11 -0000 1.33
+++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 9 May 2002 23:59:52 -0000 1.34
@@ -14,23 +14,13 @@
# details.
#
-
-
-#
-# Procs for DOTLRN Bboard Applet
-# Copyright 2001 OpenForce, inc.
-# Distributed under the GNU GPL v2
-#
-# October 5th, 2001
-#
-
ad_library {
Procs to set up the dotLRN Bboard applet
@author ben@openforce.net,arjun@openforce.net
@creation-date 2001-10-05
-
+ @version $Id$
}
namespace eval dotlrn_bboard {
@@ -86,8 +76,6 @@
-community_id $community_id
]
- bboard_portlet::make_self_available $portal_id
-
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
bboard_portlet::add_self_to_page $portal_id 0
return
@@ -125,7 +113,6 @@
set admin_portal_id [dotlrn_community::get_admin_portal_id \
-community_id $community_id
]
- bboard_admin_portlet::make_self_available $admin_portal_id
bboard_admin_portlet::add_self_to_page $admin_portal_id $package_id
# Set up permissions for basic members (Admins inherit no problem)
Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v
diff -u -N -r1.46 -r1.47
--- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 7 May 2002 22:06:11 -0000 1.46
+++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 9 May 2002 23:59:52 -0000 1.47
@@ -59,10 +59,9 @@
ad_proc -public get_user_default_page {} {
return the user default page to add the portlet to
} {
- return [ad_parameter \
- -package_id [apm_package_id_from_key dotlrn-calendar] \
- user_default_page
- ]
+ # there shouldn't need to be a default here, but this
+ # call is not working for some reason
+ return [ad_parameter "user_default_page" dotlrn-calendar "Calendar"]
}
ad_proc -public add_applet {
@@ -99,13 +98,15 @@
} {
# add this element to the community portal
# do this directly, don't use calendar_portlet::add_self_to_page here
+
+ # aks: why direct??
set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- calendar_portlet::make_self_available $portal_id
+
set element_id [portal::add_element \
-pretty_name [get_pretty_name] \
-force_region 2 \
- $portal_id \
- [calendar_portlet::my_name]
+ -portal_id $portal_id \
+ -portlet_name [calendar_portlet::get_my_name]
]
# add the "full calendar" portlet to the commnuity's "calendar" page,
@@ -145,12 +146,11 @@
# Add the admin portlet, too
set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
- calendar_admin_portlet::make_self_available $admin_portal_id
+ set element_id [portal::add_element \
+ -portal_id $admin_portal_id \
+ -portlet_name [calendar_admin_portlet::get_my_name]
+ ]
- set element_id \
- [portal::add_element $admin_portal_id \
- [calendar_admin_portlet::my_name]]
-
# set the group_calendar_id parameter in the admin portal.
portal::set_element_param \
$element_id "calendar_id" $group_calendar_id
@@ -240,34 +240,27 @@
set admin_portal_id \
[dotlrn_community::get_admin_portal_id -community_id $community_id]
- calendar_admin_portlet::make_self_unavailable $admin_portal_id
-
set admin_element_id [portal::get_element_ids_by_ds \
$admin_portal_id \
- [calendar_admin_portlet::my_name]
+ [calendar_admin_portlet::get_my_name]
]
portal::remove_element $admin_element_id
-
# now for the "regular" calendar portlet from the comm's portal
set portal_id [dotlrn_community::get_portal_id \
-community_id $community_id
]
- calendar_portlet::make_self_unavailable $portal_id
-
portal::remove_element [portal::get_element_ids_by_ds \
$portal_id \
- [calendar_portlet::my_name]
+ [calendar_portlet::get_my_name]
]
# now for the "full calendar" portlet from the comm's portal
- calendar_full_portlet::make_self_unavailable $portal_id
-
portal::remove_element [portal::get_element_ids_by_ds \
$portal_id \
- [calendar_full_portlet::my_name]
+ [calendar_full_portlet::get_my_name]
]
# and finally kill the group calendar
@@ -311,9 +304,7 @@
}
set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id]
- calendar_portlet::make_self_available $workspace_portal_id
- calendar_full_portlet::make_self_available $workspace_portal_id
-
+
# add the "day summary" pe to the user's first workspace page
set element_id [calendar_portlet::add_self_to_page \
$workspace_portal_id \
@@ -343,10 +334,8 @@
set calendar_id [calendar_have_private_p -return_id 1 $user_id]
calendar_portlet::remove_self_from_page $workspace_portal_id $calendar_id
- calendar_portlet::make_self_unavailable $workspace_portal_id
calendar_full_portlet::remove_self_from_page $workspace_portal_id $calendar_id
- calendar_full_portlet::make_self_unavailable $workspace_portal_id
}
ad_proc -public add_user_to_community {
@@ -391,7 +380,7 @@
# get the calendar element for this community
set element_id [portal::get_element_ids_by_ds \
$portal_id \
- [calendar_portlet::my_name]
+ [calendar_portlet::get_my_name]
]
return [portal::get_element_param $element_id "calendar_id"]
Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl,v
diff -u -N -r1.21 -r1.22
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 6 May 2002 23:56:26 -0000 1.21
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 9 May 2002 23:59:52 -0000 1.22
@@ -69,7 +69,6 @@
Add the dotlrn applet to a specific community
} {
set pt_id [dotlrn_community::get_portal_id -community_id $community_id]
- dotlrn_portlet::make_self_available $pt_id
dotlrn_portlet::add_self_to_page $pt_id $community_id
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
@@ -78,7 +77,6 @@
# set up the DS for the admin page
set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
- dotlrn_admin_portlet::make_self_available $admin_portal_id
dotlrn_admin_portlet::add_self_to_page $admin_portal_id $community_id
return $community_id
Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 6 May 2002 23:56:26 -0000 1.5
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 9 May 2002 23:59:52 -0000 1.6
@@ -80,9 +80,6 @@
} {
# portal template stuff
set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
-
- dotlrn_members_portlet::make_self_available $portal_id
-
set community_type [dotlrn_community::get_community_type_from_community_id $community_id]
if {$community_type == "dotlrn_community"} {
Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 6 May 2002 23:56:26 -0000 1.3
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 9 May 2002 23:59:52 -0000 1.4
@@ -59,7 +59,6 @@
} {
set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- dotlrn_members_staff_portlet::make_self_available $portal_id
dotlrn_members_staff_portlet::add_self_to_page $portal_id $community_id
}
Index: openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl,v
diff -u -N -r1.27 -r1.28
--- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 7 May 2002 17:53:51 -0000 1.27
+++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 9 May 2002 23:59:52 -0000 1.28
@@ -73,8 +73,6 @@
set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
# set up the DS for the portal template
- faq_portlet::make_self_available $portal_id
-
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
faq_portlet::add_self_to_page $portal_id 0
return
@@ -87,13 +85,39 @@
# set up the DS for the admin page
set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
- faq_admin_portlet::make_self_available $admin_portal_id
faq_admin_portlet::add_self_to_page $admin_portal_id $package_id
# return the package_id
return $package_id
}
+ ad_proc -public remove_applet_from_community {
+ comminuty_id
+ } {
+ Drops the faq applet from the given community
+ } {
+ # remove the faq admin portlet from the comm's admin page
+ set admin_portal_id \
+ [dotlrn_community::get_admin_portal_id -community_id $community_id]
+ set admin_element_id [portal::get_element_ids_by_ds \
+ $admin_portal_id \
+ [faq_admin_portlet::get_my_name]
+ ]
+
+ portal::remove_element $admin_element_id
+
+ # remove the faq portlet from the comm's portal
+ set portal_id \
+ [dotlrn_community::get_portal_id -community_id $community_id]
+
+ portal::remove_element [portal::get_element_ids_by_ds \
+ $portal_id \
+ [faq_portlet::get_my_name]
+ ]
+
+
+ }
+
ad_proc -public add_user {
user_id
} {
Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v
diff -u -N -r1.54 -r1.55
--- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 6 May 2002 23:56:28 -0000 1.54
+++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 9 May 2002 23:59:52 -0000 1.55
@@ -139,8 +139,6 @@
# set up the DS for the portal template
# that's the private folder_id there
- fs_portlet::make_self_available $portal_id
-
# add the portlet to the "file storage" page for this comm
# aks - this should be made into a dotlrn-fs param
Index: openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl,v
diff -u -N -r1.17 -r1.18
--- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 6 May 2002 23:56:29 -0000 1.17
+++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 9 May 2002 23:59:52 -0000 1.18
@@ -74,8 +74,6 @@
} {
set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- news_portlet::make_self_available $portal_id
-
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
news_portlet::add_self_to_page $portal_id 0
return
@@ -93,7 +91,6 @@
# set up the DS for the admin portal
set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
- news_admin_portlet::make_self_available $admin_portal_id
news_admin_portlet::add_self_to_page $admin_portal_id $package_id
return $package_id
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 -N -r1.10 -r1.11
--- openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 3 Apr 2002 22:45:49 -0000 1.10
+++ openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 9 May 2002 23:59:52 -0000 1.11
@@ -43,7 +43,9 @@
-
+
+
+
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 -N -r1.2 -r1.3
--- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.2
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-admin-portlet-create.sql 9 May 2002 23:59:52 -0000 1.3
@@ -125,8 +125,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_admin_portlet',
- 'MyName',
- 'dotlrn_admin_portlet::my_name',
+ 'GetMyName',
+ 'dotlrn_admin_portlet::get_my_name',
'TCL'
);
@@ -178,22 +178,6 @@
'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
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 -N -r1.2 -r1.3
--- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.2
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-portlet-create.sql 9 May 2002 23:59:52 -0000 1.3
@@ -121,8 +121,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_members_portlet',
- 'MyName',
- 'dotlrn_members_portlet::my_name',
+ 'GetMyName',
+ 'dotlrn_members_portlet::get_my_name',
'TCL'
);
@@ -174,22 +174,6 @@
'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
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 -N -r1.2 -r1.3
--- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.2
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-members-staff-portlet-create.sql 9 May 2002 23:59:52 -0000 1.3
@@ -122,8 +122,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_members_staff_portlet',
- 'MyName',
- 'dotlrn_members_staff_portlet::my_name',
+ 'GetMyName',
+ 'dotlrn_members_staff_portlet::get_my_name',
'TCL'
);
@@ -175,22 +175,6 @@
'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
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 -N -r1.11 -r1.12
--- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 29 Mar 2002 19:20:49 -0000 1.11
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-create.sql 9 May 2002 23:59:52 -0000 1.12
@@ -124,8 +124,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'dotlrn_portlet',
- 'MyName',
- 'dotlrn_portlet::my_name',
+ 'GetMyName',
+ 'dotlrn_portlet::get_my_name',
'TCL'
);
@@ -177,22 +177,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'dotlrn_portlet',
- 'MakeSelfAvailable',
- 'dotlrn_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'dotlrn_portlet',
- 'MakeSelfUnavailable',
- 'dotlrn_portlet::make_self_unavailable',
- 'TCL'
- );
-
end;
/
show errors
Index: openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql 29 Mar 2002 19:20:49 -0000 1.4
+++ openacs-4/packages/dotlrn-portlet/sql/oracle/dotlrn-portlet-drop.sql 9 May 2002 23:59:52 -0000 1.5
@@ -58,7 +58,7 @@
foo := acs_sc_impl.delete_alias (
'portal_datasource',
'dotlrn_portlet',
- 'MyName'
+ 'GetMyName'
);
foo := acs_sc_impl.delete_alias (
@@ -98,18 +98,6 @@
'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'dotlrn_portlet',
- 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'dotlrn_portlet',
- 'MakeSelfUnavailable'
- );
-
-- Drop the binding
acs_sc_binding.delete (
contract_name => 'portal_datasource',
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 -N -r1.5 -r1.6
--- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.5
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.6
@@ -14,24 +14,20 @@
# details.
#
-# /packages/dotlrn-portlets/tcl/dotlrn-portlets-procs.tcl
ad_library {
-Procedures to supports dotlrn admin portlets
+ 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
+ @version $Id$
-@creation-date September 30 2001
-@author arjun@openforce.net
-@author ben@openforce.net
-@cvs-id $Id$
-
}
namespace eval dotlrn_admin_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "dotlrn_admin_portlet"
}
@@ -51,102 +47,49 @@
return ""
}
-
ad_proc -public add_self_to_page {
- portal_id
+ admin_portal_id
community_id
} {
- Adds a dotlrn PE to the given page with the community_id as
- opaque data in the portal configuration.
+ Adds the dotlrn admin PE to the given page with the community_id as
+ as parameter
- @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
+ @return element_id The new element's id
} {
- # Tell portal to add this element to the page
- set element_id [portal::add_element -force_region 1 $portal_id [my_name]]
-
- # The default param must be configured
- set key "community_id"
- # set value [portal::get_element_param $element_id $key]
+ set element_id [portal::add_element \
+ -portal_id $admin_portal_id \
+ -portlet_name [get_my_name] \
+ -force_region [ad_parameter "dotlrn_admin_portlet_force_region" [my_package_key]]
+ ]
- portal::set_element_param $element_id $key $community_id
+ # set the community_id param that this portlet needs
+ portal::set_element_param $element_id "community_id" $community_id
return $element_id
}
+ ad_proc -public remove_self_from_page {
+ portal_id
+ } {
+ Removes a dotlrn PE from the given portal
+ } {
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ }
+
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/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 -N -r1.5 -r1.6
--- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 29 Mar 2002 19:20:49 -0000 1.5
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.6
@@ -16,10 +16,7 @@
ad_library {
- Procedures to supports the dotlrn "members" portlet
-
- Copyright Openforce, Inc.
- Licensed under GNU GPL v2
+ Procedures to support the dotlrn "members" portlet
@author arjun@openforce.net
@cvs-id $Id$
@@ -28,7 +25,7 @@
namespace eval dotlrn_members_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "dotlrn_members_portlet"
}
@@ -54,23 +51,23 @@
portal_id
community_id
} {
-
+ Adds the dotlrn "members" portlet to the given portal.
+ Pass along the community_id
} {
- return [portal::add_element_or_append_id \
- -pretty_name [get_pretty_name] \
- -portal_id $portal_id \
- -page_id $page_id \
- -portlet_name [my_name] \
- -value_id $community_id \
- -key community_id ]
+ set element_id [portal::add_element \
+ -pretty_name [get_pretty_name] \
+ -portal_id $portal_id \
+ -page_id $page_id \
+ -portlet_name [get_my_name]
+ ]
+
+ portal::set_element_param $element_id "community_id" $community_id
+ return $element_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] \
@@ -80,45 +77,13 @@
ad_proc -public remove_self_from_page {
portal_id
- community_id
} {
- Removes the PE from the given page
+ Removes the dotlrn "memebers" PE from the given portal
} {
- # 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
- }
- }
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
}
-
- 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 -N -r1.4 -r1.5
--- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.4
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.5
@@ -16,19 +16,15 @@
ad_library {
- Procedures to supports the dotlrn "members staff" portlet
+ Procedures to supports the dotlrn "members staff" portlet aka "Staff List"
- Copyright Openforce, Inc.
- Licensed under GNU GPL v2
-
@author arjun@openforce.net
@cvs-id $Id$
-
}
namespace eval dotlrn_members_staff_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "dotlrn_members_staff_portlet"
}
@@ -38,32 +34,48 @@
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
} {
-
+ Add the "dotlrn members staff" portlet to the page
} {
- return [portal::add_element_or_append_id \
+ set force_region [ad_parameter \
+ "dotlrn_members_staff_portlet_force_region" \
+ [my_package_key]
+ ]
+
+ set element_id [portal::add_element \
+ -portal_id $portal_id \
-pretty_name [get_pretty_name] \
+ -portlet_name [get_my_name] \
+ -force_region $force_region
+ ]
+
+ portal::set_element_param $element_id "community_id" $community_id
+
+ return $element_id
+ }
+
+ ad_proc -public remove_self_from_page {
+ portal_id
+ community_id
+ } {
+ Removes the PE from the given page
+ } {
+ portal::remove_element \
-portal_id $portal_id \
- -portlet_name [my_name] \
- -force_region 2 \
- -value_id $community_id \
- -key community_id]
+ -portlet_name [get_my_name]
}
ad_proc -public show {
@@ -79,46 +91,7 @@
-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 -N -r1.28 -r1.29
--- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 16 Apr 2002 13:58:28 -0000 1.28
+++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.29
@@ -14,23 +14,22 @@
# details.
#
-# /packages/dotlrn-portlets/tcl/dotlrn-portlets-procs.tcl
ad_library {
-Procedures to supports dotlrn portlets
+ Procedures to supports the "dotlrn" portlet. The "dotlrn" portlet shows
+ the subcommunities of the community's portal where it's located. This portal
+ is not to be confused with the "dotlrn-main" portal, that goes on user's
+ workspace portals and shows the communities that they are members of.
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
+ @creation-date September 30 2001
+ @author arjun@openforce.net
+ @cvs-id $Id$
-@creation-date September 30 2001
-@author arjun@openforce.net
-@cvs-id $Id$
-
}
namespace eval dotlrn_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "dotlrn_portlet"
}
@@ -40,116 +39,57 @@
return "dotlrn-portlet"
}
-
ad_proc -public get_pretty_name {
} {
- return [ad_parameter -package_id [dotlrn::get_package_id] subcommunities_pretty_plural]
-
+ # get the param from the dotlrn package
+ return [ad_parameter subcommunities_pretty_plural dotlrn]
}
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.
+ Adds a dotlrn PE to the given communities's portal
+ @param portal_id
+ @param community_id
@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 \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
-pretty_name [get_pretty_name] \
- -force_region 2 \
- $portal_id \
- [my_name]]
-
- # The default param must be configured
- set key "community_id"
- # set value [portal::get_element_param $element_id $key]
+ -force_region [ad_parameter "dotlrn_portlet_force_region" [my_package_key]]
+ ]
- portal::set_element_param $element_id $key $community_id
+ portal::set_element_param $element_id "community_id" $community_id
return $element_id
}
ad_proc -public show {
cf
} {
- Call the template to display
-
- @param cf A config array
- @author arjun@openforce.net
} {
portal::show_proc_helper \
-package_key [my_package_key] \
-config_list $cf
-
}
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
+ Removes the dotlrn PE from the portal.
} {
- # 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
- }
- }
+ # since there can be only one dotlrn pe on the portal use:
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
}
- 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 -N -r1.10 -r1.11
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp 7 May 2002 22:06:12 -0000 1.10
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.adp 9 May 2002 23:59:52 -0000 1.11
@@ -22,7 +22,7 @@
- - dotLRN Administration
+
- @admin_pretty_name@
-
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 -N -r1.8 -r1.9
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl 28 Apr 2002 18:58:18 -0000 1.8
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl 9 May 2002 23:59:52 -0000 1.9
@@ -34,6 +34,7 @@
set dotlrn_admin_url "[dotlrn::get_url]/admin"
set sub_pretty_name [ad_parameter subcommunities_pretty_name dotlrn]
set sub_pretty_plural [ad_parameter subcommunities_pretty_plural dotlrn]
+set admin_pretty_name [ad_parameter dotlrn_admin_pretty_name dotlrn]
# get the community info
db_1row select_community_info {}
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 -N -r1.5 -r1.6
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl 29 Mar 2002 19:20:50 -0000 1.5
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-members-portlet.tcl 9 May 2002 23:59:52 -0000 1.6
@@ -1,4 +1,3 @@
-#
# Copyright (C) 2001, 2002 OpenForce, Inc.
#
# This file is part of dotLRN.
Index: openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl,v
diff -u -N -r1.14 -r1.15
--- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 6 May 2002 23:56:33 -0000 1.14
+++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 9 May 2002 23:59:52 -0000 1.15
@@ -132,7 +132,6 @@
# set up the DS for the admin page
set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
- static_admin_portlet::make_self_available $admin_portal_id
static_admin_portlet::add_self_to_page $admin_portal_id $community_id
}
Index: openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-create.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-create.sql 27 Apr 2002 17:20:15 -0000 1.1
+++ openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-create.sql 9 May 2002 23:59:52 -0000 1.2
@@ -88,8 +88,8 @@
foo := acs_sc_impl.new_alias(
'portal_datasource',
'syllabus_admin_portlet',
- 'MyName',
- 'syllabus_admin_portlet::my_name',
+ 'GetMyName',
+ 'syllabus_admin_portlet::get_my_name',
'TCL'
);
@@ -141,22 +141,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'syllabus_admin_portlet',
- 'MakeSelfAvailable',
- 'syllabus_admin_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'syllabus_admin_portlet',
- 'MakeSelfUnavailable',
- 'syllabus_admin_portlet::make_self_unavailable',
- 'TCL'
- );
-
-- Add the binding
acs_sc_binding.new(
contract_name => 'portal_datasource',
Index: openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-drop.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-drop.sql 27 Apr 2002 17:20:15 -0000 1.1
+++ openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-admin-portlet-drop.sql 9 May 2002 23:59:52 -0000 1.2
@@ -48,7 +48,7 @@
foo := acs_sc_impl.delete_alias(
impl_contract_name => 'portal_datasource',
impl_name => 'syllabus_admin_portlet',
- impl_operation_name => 'MyName'
+ impl_operation_name => 'GetMyName'
);
foo := acs_sc_impl.delete_alias(
@@ -87,18 +87,6 @@
impl_operation_name => 'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias(
- impl_contract_name => 'portal_datasource',
- impl_name => 'syllabus_admin_portlet',
- impl_operation_name => 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias(
- impl_contract_name => 'portal_datasource',
- impl_name => 'syllabus_admin_portlet',
- impl_operation_name => 'MakeSelfUnavailable'
- );
-
acs_sc_impl.delete(
impl_contract_name => 'portal_datasource',
impl_name => 'syllabus_admin_portlet'
Index: openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-create.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-create.sql 27 Apr 2002 17:20:15 -0000 1.1
+++ openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-create.sql 9 May 2002 23:59:52 -0000 1.2
@@ -87,8 +87,8 @@
foo := acs_sc_impl.new_alias(
'portal_datasource',
'syllabus_portlet',
- 'MyName',
- 'syllabus_portlet::my_name',
+ 'GetMyName',
+ 'syllabus_portlet::get_my_name',
'TCL'
);
@@ -140,22 +140,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'syllabus_portlet',
- 'MakeSelfAvailable',
- 'syllabus_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'syllabus_portlet',
- 'MakeSelfUnavailable',
- 'syllabus_portlet::make_self_unavailable',
- 'TCL'
- );
-
-- Add the binding
acs_sc_binding.new(
contract_name => 'portal_datasource',
Index: openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-drop.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-drop.sql 27 Apr 2002 17:20:15 -0000 1.1
+++ openacs-4/packages/dotlrn-syllabus/sql/oracle/syllabus-portlet-drop.sql 9 May 2002 23:59:52 -0000 1.2
@@ -48,7 +48,7 @@
foo := acs_sc_impl.delete_alias(
impl_contract_name => 'portal_datasource',
impl_name => 'syllabus_portlet',
- impl_operation_name => 'MyName'
+ impl_operation_name => 'GetMyName'
);
foo := acs_sc_impl.delete_alias(
@@ -87,18 +87,6 @@
impl_operation_name => 'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias(
- impl_contract_name => 'portal_datasource',
- impl_name => 'syllabus_portlet',
- impl_operation_name => 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias(
- impl_contract_name => 'portal_datasource',
- impl_name => 'syllabus_portlet',
- impl_operation_name => 'MakeSelfUnavailable'
- );
-
acs_sc_impl.delete(
impl_contract_name => 'portal_datasource',
impl_name => 'syllabus_portlet'
Index: openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl 27 Apr 2002 17:20:15 -0000 1.1
+++ openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-admin-procs.tcl 9 May 2002 23:59:53 -0000 1.2
@@ -68,7 +68,6 @@
set pt_id \
[dotlrn_community::get_community_admin_portal_id $community_id]
- syllabus_admin_portlet::make_self_available $pt_id
syllabus_admin_portlet::add_self_to_page $pt_id $community_id
}
Index: openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl 27 Apr 2002 17:20:15 -0000 1.1
+++ openacs-4/packages/dotlrn-syllabus/tcl/dotlrn-syllabus-procs.tcl 9 May 2002 23:59:53 -0000 1.2
@@ -74,8 +74,6 @@
} {
set pt_id [dotlrn_community::get_portal_template_id $community_id]
- syllabus_portlet::make_self_available $pt_id
-
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
syllabus_portlet::add_self_to_page $pt_id $community_id
return
Index: openacs-4/packages/dotlrn-syllabus/tcl/syllabus-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/tcl/syllabus-admin-portlet-procs.tcl,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-syllabus/tcl/syllabus-admin-portlet-procs.tcl 27 Apr 2002 17:20:15 -0000 1.1
+++ openacs-4/packages/dotlrn-syllabus/tcl/syllabus-admin-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.2
@@ -14,11 +14,9 @@
# details.
#
-# dotlrn-syllabus/tcl/syllabus-portlet-procs.tcl
-
ad_library {
- Procedures to support the syllabus module portlet
+ Procedures to support the syllabus admin portlet.
@author arjun (arjun@openforce.net)
@creation-date 2002-02-24
@@ -33,88 +31,45 @@
return "dotlrn-syllabus"
}
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "syllabus_admin_portlet"
}
ad_proc -public get_pretty_name {
} {
- return "Syllabus"
+ return "Syllabus Administration"
}
- ad_proc -public link {
- } {
- return
- }
-
ad_proc -public add_self_to_page {
- {-page_id ""}
portal_id
- community_id
} {
- Adds a syllabus portlet element to the specified page.
+ Adds a syllabus admin portlet element to the specified portal
} {
- return [portal::add_element_or_append_id \
- -portal_id $portal_id \
- -portlet_name [my_name] \
- -value_id $community_id \
- -key "community_id"
+ return [portal::add_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
]
}
ad_proc -public remove_self_from_page {
portal_id
- instance_id
} {
- Removes a syllabus portlet element from the specified page.
+ Removes a syllabus admin portlet element from the specified portal
} {
- portal::remove_element_or_remove_id \
+ portal::remove_element \
-portal_id $portal_id \
- -portlet_name [my_name]
+ -portlet_name [get_my_name]
}
- ad_proc -public make_self_available {
- portal_id
- } {
- Wrapper for the portal:: proc
-
- @param portal_id
- } {
- 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
- } {
- portal::make_datasource_unavailable \
- $portal_id [portal::get_datasource_id [my_name]]
- }
-
ad_proc -public show {
cf
} {
- Display the portal element
-
- @param cf A config array as a list
-
- @return HTML string
} {
- # no return call required with the helper proc
portal::show_proc_helper \
-template_src "syllabus-admin-portlet" \
-package_key [my_package_key] \
-config_list $cf
}
- ad_proc -public edit {
- } {
- return {}
- }
-
}
Index: openacs-4/packages/dotlrn-syllabus/tcl/syllabus-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/tcl/syllabus-portlet-procs.tcl,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/dotlrn-syllabus/tcl/syllabus-portlet-procs.tcl 29 Apr 2002 15:05:09 -0000 1.2
+++ openacs-4/packages/dotlrn-syllabus/tcl/syllabus-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.3
@@ -14,11 +14,10 @@
# details.
#
-# dotlrn-syllabus/tcl/syllabus-portlet-procs.tcl
-
ad_library {
- Procedures to support the syllabus portlet
+ Procedures to support the syllabus portlet. Note that this
+ portlet depends on dotlrn!
@author arjun (arjun@openforce.net)
@creation-date 2002-02-24
@@ -33,7 +32,7 @@
return "dotlrn-syllabus"
}
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "syllabus_portlet"
}
@@ -53,20 +52,20 @@
portal_id
instance_id
} {
- Adds a syllabus portlet element to the specified page.
+ Adds a syllabus portlet to the specified portal.
@param page_id The page to add self to
@param portal_id The portal to add self to
@param instance_id
@return element_id The new element's id
} {
return [portal::add_element_or_append_id \
- -portal_id $portal_id \
- -page_id $page_id \
- -portlet_name [my_name] \
- -pretty_name [get_pretty_name] \
- -key "package_id" \
- -value_id $instance_id
+ -portal_id $portal_id \
+ -page_id $page_id \
+ -portlet_name [get_my_name] \
+ -pretty_name [get_pretty_name] \
+ -key "package_id" \
+ -value_id $instance_id
]
}
@@ -82,33 +81,11 @@
} {
portal::remove_element_or_remove_id \
-portal_id $portal_id \
- -portlet_name [my_name] \
+ -portlet_name [get_my_name] \
-key "package_id" \
-value_id $instance_id
}
- ad_proc -public make_self_available {
- portal_id
- } {
- Wrapper for the portal:: proc
-
- @param portal_id
- } {
- 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
- } {
- portal::make_datasource_unavailable \
- $portal_id [portal::get_datasource_id [my_name]]
- }
-
ad_proc -public show {
cf
} {
@@ -124,10 +101,9 @@
-config_list $cf
}
- ad_proc -public edit {
- } {
- return {}
- }
+ #
+ # helper procs
+ #
ad_proc -public get_syllabus_info_list {
{-community_id:required}
@@ -137,7 +113,7 @@
set community_id [dotlrn_community::get_community_id]
set element_id [portal::get_element_ids_by_ds \
[dotlrn_community::get_portal_template_id $community_id] \
- [fs_portlet::my_name]
+ [fs_portlet::get_my_name]
]
set root_folder_id \
[portal::get_element_param [lindex $element_id 0] "folder_id"]
Index: openacs-4/packages/faq-portlet/faq-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/faq-portlet.info,v
diff -u -N -r1.7 -r1.8
--- openacs-4/packages/faq-portlet/faq-portlet.info 6 Apr 2002 23:41:34 -0000 1.7
+++ openacs-4/packages/faq-portlet/faq-portlet.info 9 May 2002 23:59:53 -0000 1.8
@@ -33,7 +33,7 @@
-
+
Index: openacs-4/packages/faq-portlet/sql/oracle/faq-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/sql/oracle/faq-admin-portlet-create.sql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/faq-portlet/sql/oracle/faq-admin-portlet-create.sql 7 May 2002 17:53:44 -0000 1.3
+++ openacs-4/packages/faq-portlet/sql/oracle/faq-admin-portlet-create.sql 9 May 2002 23:59:53 -0000 1.4
@@ -99,8 +99,8 @@
foo := acs_sc_impl.new_alias(
'portal_datasource',
'faq_admin_portlet',
- 'MyName',
- 'faq_admin_portlet::my_name',
+ 'GetMyName',
+ 'faq_admin_portlet::get_my_name',
'TCL'
);
@@ -152,22 +152,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'faq_admin_portlet',
- 'MakeSelfAvailable',
- 'faq_admin_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'faq_admin_portlet',
- 'MakeSelfUnavailable',
- 'faq_admin_portlet::make_self_unavailable',
- 'TCL'
- );
-
-- Add the binding
acs_sc_binding.new(
contract_name => 'portal_datasource',
Index: openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-create.sql,v
diff -u -N -r1.11 -r1.12
--- openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-create.sql 7 May 2002 17:53:44 -0000 1.11
+++ openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-create.sql 9 May 2002 23:59:53 -0000 1.12
@@ -107,8 +107,8 @@
foo := acs_sc_impl.new_alias(
'portal_datasource',
'faq_portlet',
- 'MyName',
- 'faq_portlet::my_name',
+ 'GetMyName',
+ 'faq_portlet::get_my_name',
'TCL'
);
@@ -160,22 +160,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'faq_portlet',
- 'MakeSelfAvailable',
- 'faq_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'faq_portlet',
- 'MakeSelfUnavailable',
- 'faq_portlet::make_self_unavailable',
- 'TCL'
- );
-
-- Add the binding
acs_sc_binding.new (
contract_name => 'portal_datasource',
Index: openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-drop.sql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-drop.sql 29 Mar 2002 19:25:19 -0000 1.3
+++ openacs-4/packages/faq-portlet/sql/oracle/faq-portlet-drop.sql 9 May 2002 23:59:53 -0000 1.4
@@ -58,7 +58,7 @@
foo := acs_sc_impl.delete_alias (
'portal_datasource',
'faq_portlet',
- 'MyName'
+ 'GetMyName'
);
foo := acs_sc_impl.delete_alias (
@@ -98,18 +98,6 @@
'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'faq_portlet',
- 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'faq_portlet',
- 'MakeSelfUnavailable'
- );
-
-- Drop the binding
acs_sc_binding.delete (
contract_name => 'portal_datasource',
Index: openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl 7 May 2002 17:53:44 -0000 1.3
+++ openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.4
@@ -14,8 +14,6 @@
# details.
#
-# faq-portlet/tcl/faq-admin-portlet-procs.tcl
-
ad_library {
Procedures to support the file-storage portlet
@@ -29,7 +27,7 @@
namespace eval faq_admin_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "faq_admin_portlet"
}
@@ -46,110 +44,47 @@
ad_proc -public link {
} {
- return "faq"
+ return ""
}
ad_proc -public add_self_to_page {
portal_id
- package_id
+ faq_package_id
} {
- Adds a faq PE to the given page with the package_id
- being opaque data in the portal configuration.
+ Adds a faq admin PE to the given admin portal. There should only
+ ever be one of these portals on an admin page with only one faq_package_id
- @return element_id The new element's id
@param portal_id The page to add self to
- @param package_id the id of the faq package for this community
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @param faq_package_id the id of the faq package
+ @return element_id The new element's id
} {
- # Find out if faq already exists on this portal page
- set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]]
+ set element_id [portal::add_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ ]
+
+ portal::set_element_param $element_id "package_id" $faq_package_id
- if {[llength $element_id_list] == 0} {
- # Tell portal to add this element to the page
- set element_id [portal::add_element $portal_id [my_name]]
- # There is already a value for the param which must be overwritten
- portal::set_element_param $element_id package_id $package_id
- set package_id_list [list]
- } else {
- set element_id [lindex $element_id_list 0]
- # There are existing values which should NOT be overwritten
- portal::add_element_param_value -element_id $element_id -key package_id -value $package_id
- }
-
return $element_id
}
+ ad_proc -public remove_self_from_page {
+ portal_id
+ } {
+ Removes a faq admin PE from the given portal
+ } {
+ portal::remove_element -portal_id $portal_id -portlet_name [get_my_name]
+ }
+
ad_proc -public show {
cf
} {
- Display the PE
-
- @return HTML string
- @param cf A config array
- @author arjun@openforce.net
- @creation-date Sept 2001
} {
portal::show_proc_helper \
-package_key [my_package_key] \
-config_list $cf \
-template_src "faq-admin-portlet"
}
- ad_proc -public edit {
- } {
- return ""
- }
- ad_proc -public remove_self_from_page {
- portal_id
- package_id
- } {
- Removes a faq PE from the given page
-
- @param portal_id The page to remove self from
- @param package_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]]
-
- db_transaction {
- foreach element_id $element_ids {
- # Highly simplified (ben)
- portal::remove_element_param_value -element_id $element_id -key package_id -value $package_id
-
- # Check if we should really remove the element
- if {[llength [portal::get_element_param_list -element_id $element_id -key package_id]] == 0} {
- portal::remove_element $element_id
- }
- }
- }
- }
-
- 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/faq-portlet/tcl/faq-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl,v
diff -u -N -r1.27 -r1.28
--- openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 7 May 2002 17:53:44 -0000 1.27
+++ openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.28
@@ -26,7 +26,7 @@
namespace eval faq_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "faq_portlet"
}
@@ -43,120 +43,55 @@
ad_proc -public link {
} {
- return "faq"
+ return ""
}
ad_proc -public add_self_to_page {
portal_id
- package_id
+ faq_package_id
} {
- Adds a faq PE to the given page with the package_id
- being opaque data in the portal configuration.
+ Adds a faq PE to the given portal or appends the given faq_package_id to the
+ params of the faq pe already there
- @return element_id The new element's id
@param portal_id The page to add self to
- @param package_id the id of the faq package for this community
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @param faq_package_id the id of the faq package for this community
+ @return element_id The new element's id
} {
- # Find out if faq already exists on this portal page
- set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]]
-
- if {[llength $element_id_list] == 0} {
-
- # Tell portal to add this element to the page
- set element_id [portal::add_element \
- -pretty_name [get_pretty_name] \
- -force_region 1 \
- $portal_id \
- [my_name] \
- ]
-
- # There is already a value for the param which must be overwritten
- portal::set_element_param $element_id package_id $package_id
- set package_id_list [list]
-
- } else {
-
- set element_id [lindex $element_id_list 0]
-
- # There are existing values which should NOT be overwritten
- portal::add_element_param_value -element_id $element_id -key package_id -value $package_id
-
- }
-
- return $element_id
+ return [portal::add_element_or_append_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key "package_id" \
+ -value_id $faq_package_id \
+ -pretty_name [get_pretty_name] \
+ -force_region [ad_parameter "faq_portlet_force_region" [my_package_key]]
+ ]
}
- 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 "faq-portlet"
- }
-
- ad_proc -public edit {
- } {
- return ""
- }
-
ad_proc -public remove_self_from_page {
portal_id
- package_id
+ faq_package_id
} {
- Removes a faq PE from the given page
+ Removes a faq PE from the given page or just the passed in faq_package_id parameter
+ from the portlet (that has other faq_package_ids)
@param portal_id The page to remove self from
- @param package_id
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @param faq_package_id
} {
- # get the element IDs (could be more than one!)
- set element_ids [portal::get_element_ids_by_ds $portal_id [my_name]]
-
- db_transaction {
- foreach element_id $element_ids {
-
- # Highly simplified (ben)
- portal::remove_element_param_value -element_id $element_id -key package_id -value $package_id
-
- # Check if we should really remove the element
- if {[llength [portal::get_element_param_list -element_id $element_id -key package_id]] == 0} {
- portal::remove_element $element_id
- }
- }
- }
+ portal::remove_element_or_remove_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key "package_id" \
+ -value_id $faq_package_id
}
- ad_proc -public make_self_available {
- portal_id
+ ad_proc -public show {
+ cf
} {
- 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]]
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "faq-portlet"
}
- 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/fs-portlet/sql/oracle/fs-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-create.sql,v
diff -u -N -r1.12 -r1.13
--- openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-create.sql 29 Apr 2002 19:25:55 -0000 1.12
+++ openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-create.sql 9 May 2002 23:59:53 -0000 1.13
@@ -113,8 +113,8 @@
foo := acs_sc_impl.new_alias(
'portal_datasource',
'fs_portlet',
- 'MyName',
- 'fs_portlet::my_name',
+ 'GetMyName',
+ 'fs_portlet::get_my_name',
'TCL'
);
@@ -166,22 +166,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'fs_portlet',
- 'MakeSelfAvailable',
- 'fs_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias(
- 'portal_datasource',
- 'fs_portlet',
- 'MakeSelfUnavailable',
- 'fs_portlet::make_self_unavailable',
- 'TCL'
- );
-
-- Add the binding
acs_sc_binding.new(
contract_name => 'portal_datasource',
Index: openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-drop.sql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-drop.sql 29 Mar 2002 19:25:48 -0000 1.3
+++ openacs-4/packages/fs-portlet/sql/oracle/fs-portlet-drop.sql 9 May 2002 23:59:53 -0000 1.4
@@ -58,7 +58,7 @@
foo := acs_sc_impl.delete_alias (
'portal_datasource',
'fs-portlet',
- 'MyName'
+ 'GetMyName'
);
foo := acs_sc_impl.delete_alias (
@@ -98,18 +98,6 @@
'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'fs-portlet',
- 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'fs-portlet',
- 'MakeSelfUnavailable'
- );
-
-- Drop the binding
acs_sc_binding.delete (
contract_name => 'portal_datasource',
Index: openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl,v
diff -u -N -r1.34 -r1.35
--- openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 27 Apr 2002 21:50:41 -0000 1.34
+++ openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.35
@@ -14,8 +14,6 @@
# details.
#
-# fs-portlet/tcl/fs-portlet-procs.tcl
-
ad_library {
Procedures to support the file-storage portlet
@@ -36,21 +34,19 @@
return "fs-portlet"
}
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "fs_portlet"
}
ad_proc -public get_pretty_name {
} {
- return [ad_parameter \
- -package_id [apm_package_id_from_key [my_package_key]] \
- "pretty_name"]
+ return [ad_parameter "pretty_name" [my_package_key]]
}
ad_proc -public link {
} {
- return "file-storage"
+ return ""
}
ad_proc -public add_self_to_page {
@@ -66,11 +62,7 @@
@param portal_id The page to add self to
@param folder_id The folder to show
-
@return element_id The new element's id
-
- @author arjun@openforce.net
- @creation-date Sept 2001
} {
if {[empty_string_p $extra_params]} {
set extra_params [list]
@@ -82,7 +74,7 @@
-portal_id $portal_id \
-page_id $page_id \
-pretty_name [get_pretty_name] \
- -portlet_name [my_name] \
+ -portlet_name [get_my_name] \
-force_region $force_region \
-value_id $folder_id \
-key folder_id \
@@ -96,64 +88,25 @@
folder_id
} {
Removes a fs PE from the given page
-
- @param portal_id The page to remove self from
- @author arjun@openforce.net
- @creation-date Sept 2001
} {
set extra_params [list "package_id" $instance_id]
portal::remove_element_or_remove_id \
-portal_id $portal_id \
- -portlet_name [my_name] \
+ -portlet_name [get_my_name] \
-value_id $folder_id \
-key "folder_id" \
-extra_params $extra_params
}
- 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]]
- }
-
ad_proc -public show {
cf
} {
- Display the PE
-
- @return HTML string
- @param cf A config array as a list
- @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
}
- ad_proc -public edit {
- } {
- return ""
- }
}
Index: openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql,v
diff -u -N -r1.6 -r1.7
--- openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql 9 May 2002 04:04:05 -0000 1.6
+++ openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql 9 May 2002 23:59:53 -0000 1.7
@@ -247,69 +247,6 @@
);
- -- rem MakeSelfAvailable
- op_id := acs_sc_operation.get_id (
- contract_name => 'portal_datasource',
- operation_name => 'MakeSelfAvailable'
- );
-
- acs_sc_operation.delete (
- operation_id => op_id,
- contract_name => 'portal_datasource',
- operation_name => 'MakeSelfAvailable'
- );
-
-
- msg_type_id := acs_sc_msg_type.get_id (
- msg_type_name => 'portal_datasource.MakeSelfAvailable.InputType'
- );
-
- acs_sc_msg_type.delete (
- msg_type_name => 'portal_datasource.MakeSelfAvailable.InputType',
- msg_type_id => msg_type_id
- );
-
- msg_type_id := acs_sc_msg_type.get_id (
- msg_type_name => 'portal_datasource.MakeSelfAvailable.OutputType'
- );
-
- acs_sc_msg_type.delete (
- msg_type_name => 'portal_datasource.MakeSelfAvailable.OutputType',
- msg_type_id => msg_type_id
- );
-
-
- -- rem MakeSelfUnavailable
- op_id := acs_sc_operation.get_id (
- contract_name => 'portal_datasource',
- operation_name => 'MakeSelfUnavailable'
- );
-
- acs_sc_operation.delete (
- operation_id => op_id,
- contract_name => 'portal_datasource',
- operation_name => 'MakeSelfUnavailable'
- );
-
- msg_type_id := acs_sc_msg_type.get_id (
- msg_type_name => 'portal_datasource.MakeSelfUnavailable.InputType'
- );
-
- acs_sc_msg_type.delete (
- msg_type_name => 'portal_datasource.MakeSelfUnavailable.InputType',
- msg_type_id => msg_type_id
- );
-
- msg_type_id := acs_sc_msg_type.get_id (
- msg_type_name => 'portal_datasource.MakeSelfUnavailable.OutputType'
- );
-
- acs_sc_msg_type.delete (
- msg_type_name => 'portal_datasource.MakeSelfUnavailable.OutputType',
- msg_type_id => msg_type_id
- );
-
-
-- drop the contract
contract_id := acs_sc_contract.get_id ('portal_datasource');
acs_sc_contract.delete (
Index: openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql 9 May 2002 04:10:04 -0000 1.2
+++ openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql 9 May 2002 23:59:53 -0000 1.3
@@ -22,17 +22,17 @@
select acs_sc_msg_type__new (
/* msg_type_name */ 'portal_datasource.GetMyName.OutputType',
- /* msg_type_spec */ 'my_name:string'
+ /* msg_type_spec */ 'get_my_name:string'
);
select acs_sc_operation__new (
'portal_datasource',
- 'MyName',
+ 'GetMyName',
'Get the name',
't', -- not cacheable
0, -- n_args
- 'portal_datasource.MyName.InputType',
- 'portal_datasource.MyName.OutputType'
+ 'portal_datasource.GetMyName.InputType',
+ 'portal_datasource.GetMyName.OutputType'
);
@@ -180,54 +180,3 @@
'portal_datasource.RemoveSelfFromPage.InputType',
'portal_datasource.RemoveSelfFromPage.OutputType'
);
-
-
-
-
-
- -- Make self available
- select acs_sc_msg_type__new(
- /* msg_type_name */ 'portal_datasource.MakeSelfAvailable.InputType',
- /* msg_type_spec */ 'portal_id:integer'
- );
-
- select acs_sc_msg_type__new(
- /* msg_type_name */ 'portal_datasource.MakeSelfAvailable.OutputType',
- /* msg_type_spec */ ''
- );
-
- select acs_sc_operation__new (
- 'portal_datasource',
- 'MakeSelfAvailable',
- 'Makes this PE available to this portal page',
- 'f', -- not cacheable
- 1, -- n_args
- 'portal_datasource.MakeSelfAvailable.InputType',
- 'portal_datasource.MakeSelfAvailable.OutputType'
- );
-
-
-
-
-
-
- -- Make self unavailable
- select acs_sc_msg_type__new(
- /* msg_type_name */ 'portal_datasource.MakeSelfUnavailable.InputType',
- /* msg_type_spec */ 'portal_id:integer'
- );
-
- select acs_sc_msg_type__new(
- /* msg_type_name */ 'portal_datasource.MakeSelfUnavailable.OutputType',
- /* msg_type_spec */ ''
- );
-
- select acs_sc_operation__new (
- 'portal_datasource',
- 'MakeSelfUnavailable',
- 'Makes this PE UNavailable to this portal page',
- 'f', -- not cacheable
- 1, -- n_args
- 'portal_datasource.MakeSelfUnavailable.InputType',
- 'portal_datasource.MakeSelfUnavailable.OutputType'
- );
Index: openacs-4/packages/new-portal/sql/postgresql/datasource-sc-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/postgresql/datasource-sc-drop.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/new-portal/sql/postgresql/datasource-sc-drop.sql 9 May 2002 04:10:04 -0000 1.2
+++ openacs-4/packages/new-portal/sql/postgresql/datasource-sc-drop.sql 9 May 2002 23:59:53 -0000 1.3
@@ -114,38 +114,7 @@
/* msg_type_name */ 'portal_datasource.RemoveSelfFromPage.OutputType'
);
-
- select acs_sc_operation__delete (
- /* contract_name */ 'portal_datasource',
- /* operation_name */ 'MakeSelfAvailable'
- );
-
- select acs_sc_msg_type__delete (
- /* msg_type_name */ 'portal_datasource.MakeSelfAvailable.InputType'
- );
-
- select acs_sc_msg_type__delete (
- /* msg_type_name */ 'portal_datasource.MakeSelfAvailable.OutputType'
- );
-
-
- -- rem MakeSelfUnavailable
-
- select acs_sc_operation__delete (
- /* contract_name */ 'portal_datasource',
- /* operation_name */ 'MakeSelfUnavailable'
- );
-
- select acs_sc_msg_type__delete (
- /* msg_type_name */ 'portal_datasource.MakeSelfUnavailable.InputType'
- );
-
- select acs_sc_msg_type__delete (
- /* msg_type_name */ 'portal_datasource.MakeSelfUnavailable.OutputType'
- );
-
-
-- drop the contract
select acs_sc_contract__delete (
/* contract_name */ 'portal_datasource'
Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v
diff -u -N -r1.135 -r1.136
--- openacs-4/packages/new-portal/tcl/portal-procs.tcl 8 May 2002 14:37:00 -0000 1.135
+++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 9 May 2002 23:59:53 -0000 1.136
@@ -155,10 +155,6 @@
@param user_id
@param layout_name optional
} {
- # aks debug
- ns_log notice "aks1: portal::create name is $name / template_id is $template_id / csv $csv_list"
-
-
# if we have a cvs list in the form "page_name1, layout1;
# page_name2, layout2...", we get the required first page_name
# and first page layout from it, overriding any other params
@@ -211,8 +207,6 @@
}
- ns_log notice "aks1: portal::create leaving $name / $portal_id / $template_id"
-
return $portal_id
}
@@ -835,7 +829,13 @@
@param sort_key - optional, defaults to page 0
} {
if {![empty_string_p $page_name]} {
- return [db_string get_page_id_from_name {} -default ""]
+ set page_id [db_string get_page_id_from_name {} -default ""]
+ if {[empty_string_p $page_id]} {
+ # there is no page by that name in the portal, return page 0
+ return [get_page_id -portal_id $portal_id]
+ } else {
+ return $page_id
+ }
} else {
return [db_string get_page_id_select {}]
}
@@ -955,30 +955,24 @@
#
ad_proc -public add_element {
+ {-portal_id:required}
+ {-portlet_name:required}
{-force_region ""}
{-page_id ""}
- {-page_num ""}
{-pretty_name ""}
- portal_id
- ds_name
} {
Add an element to a portal given a datasource name. Used for procs
that have no knowledge of regions
@return the id of the new element
- @param portal_id
- @param page_num the number of the portal page to add to, def 0
- @param ds_name
} {
- ns_log notice "aks6: portal_id $portal_id"
-
if {[empty_string_p $pretty_name]} {
- set pretty_name $ds_name
+ set pretty_name $portlet_name
}
- if { [empty_string_p $page_num] && [empty_string_p $page_id] } {
+ if {[empty_string_p $page_id]} {
# neither page_num or page_id given, default to 0
- set page_id [portal::get_page_id -portal_id $portal_id -sort_key 0]
+ set page_id [portal::get_page_id -portal_id $portal_id]
}
# Balance the portal by adding the new element to the region
@@ -1035,16 +1029,40 @@
-page_id $page_id \
-layout_id $layout_id \
-pretty_name $pretty_name \
- $portal_id $ds_name $min_region]
+ $portal_id \
+ $portlet_name \
+ $min_region]
}
ad_proc -public remove_element {
- element_id
+ {-element_id ""}
+ {-portlet_name ""}
+ {-portal_id ""}
} {
- Remove an element from a portal
+ Remove an element from a portal. Can either specify 1. the element_id to remove
+ or 2. the portal_id and the datasource_name which will remove all elements of
+ that datasource on the portal. An element_id overrides all other params
} {
- db_dml delete {}
+ if {![empty_string_p $element_id]} {
+ db_dml delete {}
+ } else {
+ if {[empty_string_p $portal_id] && [empty_string_p $datasource_name]} {
+ ad_return_complaint 1 "portal::remove_element error bad params! \n
+ Please notify the system administrator of this error. Thank You"
+ }
+
+ set element_ids [portal::get_element_ids_by_ds \
+ $portal_id \
+ $datasource_name
+ ]
+
+ db_transaction {
+ foreach element_id $element_ids {
+ portal::remove_element $element_id
+ }
+ }
+ }
}
ad_proc -private add_element_to_region {
@@ -1081,7 +1099,7 @@
set bar [db_string foobar { select name from portal_element_map pem where pem.page_id = :target_page_id and pem.sort_key = :template_element_sk and pem.region = 1} -default NONE ]
- ns_log notice "aks5 $template_page_sort_key / $template_element_region / $template_element_name / $template_element_sk / $bar"
+ # ns_log notice "aks5 $template_page_sort_key / $template_element_region / $template_element_name / $template_element_sk / $bar"
db_dml template_insert {}
db_dml template_params_insert {}
@@ -1338,8 +1356,6 @@
# FIXME: this is not as good as it should be
if {$element(ds_name) == $element(pretty_name)} {
- ns_log notice "aks4 about to call get p name"
-
set element(name) \
[datasource_call \
-datasource_name $element(ds_name) \
@@ -1662,11 +1678,11 @@
ad_proc -public add_element_or_append_id {
{-portal_id:required}
- {-page_id ""}
- {-pretty_name ""}
{-portlet_name:required}
{-value_id:required}
{-key "instance_id"}
+ {-page_id ""}
+ {-pretty_name ""}
{-extra_params ""}
{-force_region ""}
} {
@@ -1692,11 +1708,12 @@
# Tell portal to add this element to the page
set element_id [add_element \
+ -portal_id $portal_id \
+ -portlet_name $portlet_name \
-pretty_name $pretty_name \
-page_id $page_id \
- -force_region $force_region \
- $portal_id \
- $portlet_name ]
+ -force_region $force_region
+ ]
# There is already a value for the param which is overwritten
set_element_param $element_id $key $value_id
Index: openacs-4/packages/news-portlet/news-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/news-portlet.info,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/news-portlet/news-portlet.info 6 Apr 2002 18:00:06 -0000 1.3
+++ openacs-4/packages/news-portlet/news-portlet.info 9 May 2002 23:59:53 -0000 1.4
@@ -33,7 +33,8 @@
-
+
+
Index: openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql 29 Mar 2002 19:26:23 -0000 1.2
+++ openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql 9 May 2002 23:59:53 -0000 1.3
@@ -89,12 +89,12 @@
-- news_admin-specific params
- -- community_id must be configured
+ -- news_instance_id must be configured
portal_datasource.set_def_param (
datasource_id => ds_id,
config_required_p => 't',
configured_p => 'f',
- key => 'community_id',
+ key => 'news_instance_id',
value => ''
);
@@ -124,8 +124,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'news_admin_portlet',
- 'MyName',
- 'news_admin_portlet::my_name',
+ 'GetMyName',
+ 'news_admin_portlet::get_my_name',
'TCL'
);
@@ -177,21 +177,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'news_admin_portlet',
- 'MakeSelfAvailable',
- 'news_admin_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'news_admin_portlet',
- 'MakeSelfUnavailable',
- 'news_admin_portlet::make_self_unavailable',
- 'TCL'
- );
end;
/
show errors
Index: openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql,v
diff -u -N -r1.8 -r1.9
--- openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql 29 Mar 2002 19:26:23 -0000 1.8
+++ openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql 9 May 2002 23:59:53 -0000 1.9
@@ -123,8 +123,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'news_portlet',
- 'MyName',
- 'news_portlet::my_name',
+ 'GetMyName',
+ 'news_portlet::get_my_name',
'TCL'
);
@@ -176,21 +176,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'news_portlet',
- 'MakeSelfAvailable',
- 'news_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'news_portlet',
- 'MakeSelfUnavailable',
- 'news_portlet::make_self_unavailable',
- 'TCL'
- );
end;
/
show errors
Index: openacs-4/packages/news-portlet/sql/oracle/news-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/sql/oracle/news-portlet-drop.sql,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/news-portlet/sql/oracle/news-portlet-drop.sql 29 Mar 2002 19:26:23 -0000 1.4
+++ openacs-4/packages/news-portlet/sql/oracle/news-portlet-drop.sql 9 May 2002 23:59:53 -0000 1.5
@@ -58,7 +58,7 @@
foo := acs_sc_impl.delete_alias (
'portal_datasource',
'news_portlet',
- 'MyName'
+ 'GetMyName'
);
foo := acs_sc_impl.delete_alias (
@@ -98,18 +98,6 @@
'RemoveSelfFromPage'
);
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'news_portlet',
- 'MakeSelfAvailable'
- );
-
- foo := acs_sc_impl.delete_alias (
- 'portal_datasource',
- 'news_portlet',
- 'MakeSelfUnavailable'
- );
-
-- Drop the binding
acs_sc_binding.delete (
contract_name => 'portal_datasource',
Index: openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.3
+++ openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.4
@@ -14,26 +14,21 @@
# details.
#
-# news-portlet/tcl/news-portlet-procs.tcl
-
ad_library {
-Procedures to support the news admin portlet
+ Procedures to support the news admin portlet
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
+ @creation-date Jan 2002
+ @author ben@openforce.net
+ @cvs-id $Id$
-@creation-date Jan 2002
-@author ben@openforce.net
-@cvs-id $Id$
-
}
namespace eval news_admin_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
- return "news_admin_portlet"
+ return "news_admin_portlet"
}
ad_proc -public get_pretty_name {
@@ -43,119 +38,60 @@
ad_proc -private my_package_key {
} {
- return "news-portlet"
+ return "news-portlet"
}
ad_proc -public link {
} {
- return "news"
+ return ""
}
ad_proc -public add_self_to_page {
portal_id
- instance_id
+ news_instance_id
} {
- Adds a news PE to the given page with the community_id.
-
- @return element_id The new element's id
+ Adds a news admin PE to the given portal
+
@param portal_id The page to add self to
- @param community_id The community with the folder
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @param news_instance_id The instance_id of the news pacakge
+ @return element_id The new element's id
} {
- # Add some smarts to only add one portlet for now when it's added multiple times (ben)
- # Find out if bboard already exists
- set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]]
+ # there is only one news admin pe, so use:
+ set element_id [portal::add_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ ]
- if {[llength $element_id_list] == 0} {
- # Tell portal to add this element to the page
- set element_id [portal::add_element -force_region 2 $portal_id [my_name]]
- # There is already a value for the param which must be overwritten
- portal::set_element_param $element_id community_id $instance_id
- set package_id_list [list]
- } else {
- set element_id [lindex $element_id_list 0]
- # There are existing values which should NOT be overwritten
- portal::add_element_param_value \
- -element_id $element_id \
- -key community_id \
- -value $instance_id
- }
+ portal::set_element_param \
+ $element_id \
+ "news_instance_id" \
+ $news_instance_id
- return $element_id
+ return $element_id
}
+ ad_proc -public remove_self_from_page {
+ portal_id
+ } {
+ Removes a news admin PE from the given page
+ } {
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ }
+
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 "news-admin-portlet"
}
- ad_proc -public edit {
- } {
- return ""
- }
- ad_proc -public remove_self_from_page {
- portal_id
- community_id
- } {
- Removes a news 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 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/news-portlet/tcl/news-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl,v
diff -u -N -r1.13 -r1.14
--- openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.13
+++ openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.14
@@ -14,24 +14,19 @@
# details.
#
-# news-portlet/tcl/news-portlet-procs.tcl
-
ad_library {
-Procedures to support the news portlet
+ Procedures to support the news portlet
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
+ @creation-date Nov 2001
+ @author arjun@openforce.net
+ @cvs-id $Id$
-@creation-date Nov 2001
-@author arjun@openforce.net
-@cvs-id $Id$
-
}
namespace eval news_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "news_portlet"
}
@@ -41,126 +36,59 @@
return "news-portlet"
}
-
ad_proc -public get_pretty_name {
} {
- return "News"
+ return [ad_parameter "news_portlet_pretty_name" [my_package_key]]
}
ad_proc -public link {
} {
- return "news"
+ return ""
}
ad_proc -public add_self_to_page {
portal_id
instance_id
} {
- Adds a news PE to the given page with the community_id.
+ Adds a news PE to the given portal.
- @return element_id The new element's id
@param portal_id The page to add self to
- @param community_id The community with the folder
- @author arjun@openforce.net
- @creation-date Sept 2001
+ @param instance_id The community with the folder
+ @return element_id The new element's id
} {
- # Add some smarts to only add one portlet for now when it's added multiple times (ben)
- # Find out if bboard already exists
- set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]]
+ return [portal::add_element_or_append_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value_id $instance_id \
+ -force_region [ad_parameter "news_portlet_force_region" [my_package_key]] \
+ -pretty_name [get_pretty_name]
+ ]
+ }
- if {[llength $element_id_list] == 0} {
- # Tell portal to add this element to the page
- set element_id [portal::add_element \
- -pretty_name [get_pretty_name] \
- -force_region 1 \
- $portal_id \
- [my_name]]
-
- # There is already a value for the param which must be overwritten
- portal::set_element_param $element_id community_id $instance_id
- set package_id_list [list]
- } else {
- set element_id [lindex $element_id_list 0]
- # There are existing values which should NOT be overwritten
- portal::add_element_param_value \
- -element_id $element_id \
- -key community_id \
- -value $instance_id
- }
-
- return $element_id
+ ad_proc -public remove_self_from_page {
+ portal_id
+ instance_id
+ } {
+ Removes a news PE from the given page or the instance_id of the
+ news pacakge from the portlet if there are others remaining
+
+ @param portal_id The page to remove self from
+ @param instance_id
+ } {
+ portal::remove_element_or_remove_id \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value_id $instance_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 "news-portlet"
}
- ad_proc -public edit {
- } {
- return ""
- }
-
- ad_proc -public remove_self_from_page {
- portal_id
- community_id
- } {
- Removes a news 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 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/news-portlet/www/news-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/news-admin-portlet.tcl,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/news-portlet/www/news-admin-portlet.tcl 29 Mar 2002 19:26:23 -0000 1.2
+++ openacs-4/packages/news-portlet/www/news-admin-portlet.tcl 9 May 2002 23:59:53 -0000 1.3
@@ -27,9 +27,8 @@
array set config $cf
set user_id [ad_conn user_id]
+set list_of_package_ids $config(news_instance_id)
-set list_of_package_ids $config(community_id)
-
if {[llength $list_of_package_ids] > 1} {
# We have a problem!
return -code error "There should be only one instance of news for admin purposes"
Index: openacs-4/packages/news-portlet/www/news-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/news-portlet.tcl,v
diff -u -N -r1.11 -r1.12
--- openacs-4/packages/news-portlet/www/news-portlet.tcl 6 Apr 2002 18:08:55 -0000 1.11
+++ openacs-4/packages/news-portlet/www/news-portlet.tcl 9 May 2002 23:59:53 -0000 1.12
@@ -28,7 +28,7 @@
set shaded_p $config(shaded_p)
# Should be a list already! XXX rename me!
-set list_of_instance_ids $config(community_id)
+set list_of_instance_ids $config(instance_id)
set one_instance_p [ad_decode [llength $list_of_instance_ids] 1 1 0]
db_multirow news_items select_news_items {}
Index: openacs-4/packages/static-portlet/static-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/static-portlet.info,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/static-portlet/static-portlet.info 4 Mar 2002 22:45:51 -0000 1.4
+++ openacs-4/packages/static-portlet/static-portlet.info 9 May 2002 23:59:54 -0000 1.5
@@ -40,7 +40,7 @@
-
+
Index: openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql 29 Mar 2002 19:43:33 -0000 1.2
+++ openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql 9 May 2002 23:59:54 -0000 1.3
@@ -117,8 +117,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'static_admin_portlet',
- 'MyName',
- 'static_admin_portlet::my_name',
+ 'GetMyName',
+ 'static_admin_portlet::get_my_name',
'TCL'
);
@@ -170,22 +170,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'static_admin_portlet',
- 'MakeSelfAvailable',
- 'static_admin_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'static_admin_portlet',
- 'MakeSelfUnavailable',
- 'static_admin_portlet::make_self_unavailable',
- 'TCL'
- );
-
-- Add the binding
acs_sc_binding.new (
contract_name => 'portal_datasource',
Index: openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql 29 Mar 2002 19:43:33 -0000 1.2
+++ openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql 9 May 2002 23:59:54 -0000 1.3
@@ -126,8 +126,8 @@
foo := acs_sc_impl.new_alias (
'portal_datasource',
'static_portlet',
- 'MyName',
- 'static_portlet::my_name',
+ 'GetMyName',
+ 'static_portlet::get_my_name',
'TCL'
);
@@ -179,22 +179,6 @@
'TCL'
);
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'static_portlet',
- 'MakeSelfAvailable',
- 'static_portlet::make_self_available',
- 'TCL'
- );
-
- foo := acs_sc_impl.new_alias (
- 'portal_datasource',
- 'static_portlet',
- 'MakeSelfUnavailable',
- 'static_portlet::make_self_unavailable',
- 'TCL'
- );
-
-- Add the binding
acs_sc_binding.new (
contract_name => 'portal_datasource',
Index: openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl,v
diff -u -N -r1.6 -r1.7
--- openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.6
+++ openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 9 May 2002 23:59:54 -0000 1.7
@@ -13,30 +13,30 @@
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
-
-# /packages/dotlrn-static/tcl/static-admin-portlet-procs.tcl
ad_library {
-Procedures to support the static ADMIN portlet
+ Procedures to support the static ADMIN portlet
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
+ Copyright Openforce, Inc.
+ Licensed under GNU GPL v2
-@author arjun@openforce.net
-@cvs-id $Id$
-
+ @author arjun@openforce.net
+ @cvs-id $Id$
}
namespace eval static_admin_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "static_admin_portlet"
}
ad_proc -public get_pretty_name {
} {
- return [ad_parameter static_admin_portlet_pretty_name static-portlet "Custom Portlet Administration"]
+ return [ad_parameter \
+ static_admin_portlet_pretty_name \
+ static-portlet
+ ]
}
ad_proc -private my_package_key {
@@ -53,26 +53,35 @@
portal_id
instance_id
} {
- Adds a static PE to the given page with the instance key being
- opaque data in the portal configuration.
+ Adds a static admin PE to the given portal
} {
# we don't care if there are other instaces of the
# static portlet in this portal since this PE only has one
# and only one instace_id. i.e. There is no aggregation
# unlike bboard-portlet
- # Tell portal to add this element to the page
+ # there is only one static admin portlet per portal so use:
set element_id [portal::add_element \
- -force_region 1 \
- $portal_id \
- [my_name]
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
]
# Set the instace of "static" that this PE will know
portal::set_element_param $element_id instance_id $instance_id
return $element_id
}
+
+ ad_proc -public remove_self_from_page {
+ portal_id
+ } {
+ Removes static PE from the given page
+ } {
+ # This is easy since there's one and only one instace_id
+ portal::remove_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ }
ad_proc -public show {
cf
@@ -84,46 +93,6 @@
-config_list $cf \
-template_src "static-admin-portlet"
}
-
- ad_proc -public edit {
- element_id
- } {
- Display the PE's edit page
- } {
- return ""
- }
-
- ad_proc -public remove_self_from_page {
- portal_id
- instance_id
- } {
- Removes static PE from the given page
- } {
- # This is easy since there's one and only one instace_id
- portal::remove_element $element_id
- }
-
- ad_proc -public make_self_available {
- portal_id
- } {
- Wrapper for the portal:: proc
-
- @param portal_id
- } {
- 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
- } {
- portal::make_datasource_unavailable \
- $portal_id [portal::get_datasource_id [my_name]]
- }
}
Index: openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 16 Apr 2002 13:55:32 -0000 1.5
+++ openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 9 May 2002 23:59:54 -0000 1.6
@@ -14,18 +14,16 @@
# details.
#
-# /packages/static-portlet/tcl/static-portal-content-procs.tcl
ad_library {
-The procs for manipulating static portal content. Akin to the "bboard"
-package being included in it's own "bboard-portlet" package
+ The procs for manipulating static portal content. This is like having
+ the "bboard" included in it's own "bboard-portlet" package.
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
+ Copyright Openforce, Inc.
+ Licensed under GNU GPL v2
-@author arjun@openforce.net
-@cvs-id $Id$
-
+ @author arjun@openforce.net
+ @cvs-id $Id$
}
namespace eval static_portal_content {
@@ -60,13 +58,13 @@
db_transaction {
# Generate the element
set element_id [portal::add_element \
+ -portal_id $portal_id \
+ -portlet_name [static_portlet::get_my_name] \
-pretty_name [get_pretty_name -content_id $content_id] \
- -force_region 1 \
- $portal_id \
- [static_portlet::my_name]
+ -force_region [ad_parameter "static_portal_content_force_region" static-portlet]
]
- # Set the parameter
+ # Set the parameter for the newly created element
portal::set_element_param $element_id content_id $content_id
}
}
Index: openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 29 Mar 2002 19:43:33 -0000 1.4
+++ openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 9 May 2002 23:59:54 -0000 1.5
@@ -14,22 +14,17 @@
# details.
#
-# /packages/dotlrn-static/tcl/static-portlet-procs.tcl
ad_library {
-Procedures to supports static portlets
+ Procedures to supports static portlets
-Copyright Openforce, Inc.
-Licensed under GNU GPL v2
-
-@author arjun@openforce.net
-@cvs-id $Id$
-
+ @author arjun@openforce.net
+ @cvs-id $Id$
}
namespace eval static_portlet {
- ad_proc -private my_name {
+ ad_proc -private get_my_name {
} {
return "static_portlet"
}
@@ -55,40 +50,18 @@
} {
Adds a static PE to the given page
} {
- # we don't care if there are other instaces of the
- # static portlet in this portal since this PE only has one
- # and only one instace_id. i.e. There is no aggregation
- # unlike bboard-portlet for instance
+ # there is no aggregation, so use:
+ set element_id [portal::add_element \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name]
+ ]
- # Tell portal to add this element to the page
- set element_id [portal::add_element $portal_id [my_name]]
-
# Set the instace of "static-portlet" that this PE will know
portal::set_element_param $element_id instance_id $instance_id
return $element_id
}
- ad_proc -public show {
- cf
- } {
- Display the PE
- } {
-
- portal::show_proc_helper \
- -package_key [my_package_key] \
- -config_list $cf \
- -template_src "static-portlet"
- }
-
- ad_proc -public edit {
- element_id
- } {
- Display the PE's edit page
- } {
- return ""
- }
-
ad_proc -public remove_self_from_page {
portal_id
element_id
@@ -99,27 +72,16 @@
portal::remove_element $element_id
}
- ad_proc -public make_self_available {
- portal_id
+ ad_proc -public show {
+ cf
} {
- Wrapper for the portal:: proc
-
- @param portal_id
} {
- 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
- } {
- portal::make_datasource_unavailable \
- $portal_id [portal::get_datasource_id [my_name]]
- }
+
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "static-portlet"
+ }
}
Index: openacs-4/packages/static-portlet/www/element-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/element-delete.tcl,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/static-portlet/www/element-delete.tcl 29 Mar 2002 19:43:33 -0000 1.4
+++ openacs-4/packages/static-portlet/www/element-delete.tcl 9 May 2002 23:59:54 -0000 1.5
@@ -27,7 +27,7 @@
title:onevalue
}
-set ds_name [static_portlet::my_name]
+set ds_name [static_portlet::get_my_name]
set pretty_name [static_portal_content::get_pretty_name -content_id $content_id]
# THIS NEEDS TO BE GENERALIZED (FIXME - ben)