Index: openacs-4/packages/curriculum-portlet/curriculum-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/curriculum-portlet.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/curriculum-portlet.info 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,25 @@ + + + + + Curriculum Portlet + Curriculum Portlets + f + t + + + Ola Hansson + Polyxena + + + + + + + + + + + + + Index: openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-admin-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-admin-portlet-create.sql 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,171 @@ +-- packages/curriculum-portlet/sql/curriculum-admin-portlet-create.sql +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-11 +-- @cvs-id $Id: curriculum-admin-portlet-create.sql,v 1.1 2003/06/16 22:24:04 olah Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource.new( + name => 'curriculum_admin_portlet', + description => 'Displays the curriculum_admin' + ); + + -- 4 defaults procs + + -- shadeable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 'f' +); + + -- shaded_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_p', + value => 'f' +); + + -- hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'hideable_p', + value => 't' +); + + -- user_editable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'user_editable_p', + value => 'f' +); + + -- link_hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'link_hideable_p', + value => 't' +); + + + -- curriculum_admin-specific procs + + -- package_id must be configured + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'package_id', + value => '' +); + + +end; +/ +show errors + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'curriculum_admin_portlet' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- add all the hooks + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'GetMyName', + 'curriculum_admin_portlet::get_my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'GetPrettyName', + 'curriculum_admin_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Link', + 'curriculum_admin_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'AddSelfToPage', + 'curriculum_admin_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Show', + 'curriculum_admin_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Edit', + 'curriculum_admin_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'RemoveSelfFromPage', + 'curriculum_admin_portlet::remove_self_from_page', + 'TCL' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'portal_datasource', + impl_name => 'curriculum_admin_portlet' + ); +end; +/ +show errors Index: openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-portlet-create.sql 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,172 @@ +-- packages/curriculum-portlet/sql/curriculum-portlet-create.sql +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-13 +-- @cvs-id $Id: curriculum-portlet-create.sql,v 1.1 2003/06/16 22:24:04 olah Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource.new( + name => 'curriculum_portlet', + description => 'Displays the curriculum' + ); + + -- 4 defaults procs + + -- shadeable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 't' +); + + -- shaded_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_p', + value => 'f' +); + + -- hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'hideable_p', + value => 't' +); + + -- user_editable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'user_editable_p', + value => 'f' +); + + -- link_hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'link_hideable_p', + value => 't' +); + + + -- curriculum-specific procs + + -- package_id must be configured + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'package_id', + value => '' +); + +end; +/ +show errors + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'portal_datasource', + 'curriculum_portlet', + 'curriculum_portlet' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- add all the hooks + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'GetMyName', + 'curriculum_portlet::get_my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'GetPrettyName', + 'curriculum_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'Link', + 'curriculum_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'AddSelfToPage', + 'curriculum_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'Show', + 'curriculum_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'Edit', + 'curriculum_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'RemoveSelfFromPage', + 'curriculum_portlet::remove_self_from_page', + 'TCL' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'portal_datasource', + impl_name => 'curriculum_portlet' + ); +end; +/ +show errors + +@curriculum-admin-portlet-create.sql Index: openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-portlet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/sql/oracle/curriculum-portlet-drop.sql 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,91 @@ +-- packages/curriculum-portlet/sql/oracle/curriculum-portlet-drop.sql +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-13 +-- @cvs-id $Id: curriculum-portlet-drop.sql,v 1.1 2003/06/16 22:24:04 olah Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + begin + select datasource_id into ds_id + from portal_datasources + where name = 'curriculum-portlet'; + exception when no_data_found then + ds_id := null; + end; + + if ds_id is not null then + portal_datasource.delete(ds_id); + end if; + +end; +/ +show errors; + + + +declare + foo integer; +begin + + -- add all the hooks + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'GetMyName' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'GetPrettyName' + ); + + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'Link' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'AddSelfToPage' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'Show' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'Edit' + ); + + foo := acs_sc_impl.delete_alias ( + 'portal_datasource', + 'curriculum_portlet', + 'RemoveSelfFromPage' + ); + + -- Drop the binding + acs_sc_binding.delete ( + contract_name => 'portal_datasource', + impl_name => 'curriculum_portlet' + ); + + -- drop the impl + foo := acs_sc_impl.delete ( + 'portal_datasource', + 'curriculum_portlet' + ); +end; +/ +show errors Index: openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-admin-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-admin-portlet-create.sql 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,151 @@ +-- /curriculum-portlet/sql/postgresql/curriculum-admin-portlet-create.sql +-- +-- Creates Curriculum portlet +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-11 +-- @cvs-id $Id: curriculum-admin-portlet-create.sql,v 1.1 2003/06/16 22:24:04 olah Exp $ +-- + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id = portal_datasource__new( + ''curriculum_admin_portlet'', + ''Displays a Curriculum'' + ); + +RAISE NOTICE '' created new ds''; + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shadeable_p'', + ''f'' + ); + +RAISE NOTICE '' set shadeable''; + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''f'' + ); + +RAISE NOTICE '' set hideable''; + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '' '' + ); + + +return 0; + +end;' language 'plpgsql'; + + + +select inline_0(); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__new ( + 'portal_datasource', + 'curriculum_admin_portlet', + 'curriculum_admin_portlet' +); + +-- add all the hooks +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_admin_portlet', + 'GetMyName', + 'curriculum_admin_portlet::get_my_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_admin_portlet', + 'GetPrettyName', + 'curriculum_admin_portlet::get_pretty_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Link', + 'curriculum_admin_portlet::link', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_admin_portlet', + 'AddSelfToPage', + 'curriculum_admin_portlet::add_self_to_page', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Show', + 'curriculum_admin_portlet::show', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Edit', + 'curriculum_admin_portlet::edit', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_admin_portlet', + 'RemoveSelfFromPage', + 'curriculum_admin_portlet::remove_self_from_page', + 'TCL' +); + +-- Add the binding +select acs_sc_binding__new( + 'portal_datasource', + 'curriculum_admin_portlet' +); Index: openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-admin-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-admin-portlet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-admin-portlet-drop.sql 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,90 @@ +-- /curriculum-portlet/sql/postgresql/curriculum-admin-portlet-drop.sql + +-- Drops curriculum portlet + +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-11 +-- @cvs-id $Id: curriculum-admin-portlet-drop.sql,v 1.1 2003/06/16 22:24:04 olah Exp $ + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + select datasource_id into ds_id + from portal_datasources + where name = ''curriculum_admin_portlet''; + + if not found then + raise exception ''No datasource_id found here '',ds_id ; + ds_id := null; + end if; + + + if ds_id is NOT null then + perform portal_datasource__delete(ds_id); + end if; + +return 0; + +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__delete ( + 'portal_datasource', + 'curriculum_admin_portlet' +); + +-- add all the hooks +select acs_sc_impl_alias__delete( + 'portal_datasource', + 'curriculum_admin_portlet', + 'GetMyName' +); + +select acs_sc_impl_alias__delete( + 'portal_datasource', + 'curriculum_admin_portlet', + 'GetPrettyName' +); + +select acs_sc_impl_alias__delete( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Link' +); + +select acs_sc_impl_alias__delete( + 'portal_datasource', + 'curriculum_admin_portlet', + 'AddSelfToPage' +); + +select acs_sc_impl_alias__delete( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Show' +); + +select acs_sc_impl_alias__delete( + 'portal_datasource', + 'curriculum_admin_portlet', + 'Edit' +); + +select acs_sc_impl_alias__delete( + 'portal_datasource', + 'curriculum_admin_portlet', + 'RemoveSelfFromPage' +); + +-- Add the binding +select acs_sc_binding__delete( + 'portal_datasource', + 'curriculum_admin_portlet' +); Index: openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-portlet-create.sql 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,156 @@ +-- /curriculum-portlet/sql/postgresql/curriculum-portlet-create.sql +-- +-- Creates Curriculum portlet +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-11 +-- @cvs-id $Id: curriculum-portlet-create.sql,v 1.1 2003/06/16 22:24:04 olah Exp $ +-- + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id = portal_datasource__new( + ''curriculum_portlet'', + ''Displays a Curriculum'' + ); + + +perform portal_datasource__set_def_param( + ds_id, + ''t'', + ''t'', + ''shadeable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''style'', + ''list'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '' '' +); + +return 0; + +end; ' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__new( + 'portal_datasource', + 'curriculum_portlet', + 'curriculum_portlet' +); + + +-- add all the hooks +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_portlet', + 'GetMyName', + 'curriculum_portlet::get_my_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_portlet', + 'GetPrettyName', + 'curriculum_portlet::get_pretty_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_portlet', + 'Link', + 'curriculum_portlet::link', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_portlet', + 'AddSelfToPage', + 'curriculum_portlet::add_self_to_page', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_portlet', + 'Show', + 'curriculum_portlet::show', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_portlet', + 'Edit', + 'curriculum_portlet::edit', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'curriculum_portlet', + 'RemoveSelfFromPage', + 'curriculum_portlet::remove_self_from_page', + 'TCL' + ); + + -- Add the binding +select acs_sc_binding__new ( + 'portal_datasource', + 'curriculum_portlet' +); + +\i curriculum-admin-portlet-create.sql Index: openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-portlet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/sql/postgresql/curriculum-portlet-drop.sql 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,98 @@ +-- /curriculum-portlet/sql/postgresql/curriculum-portlet-drop.sql +-- +-- Drops curriculum portlet +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-11 +-- @cvs-id $Id: curriculum-portlet-drop.sql,v 1.1 2003/06/16 22:24:04 olah Exp $ +-- + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + select datasource_id into ds_id + from portal_datasources + where name = ''curriculum_portlet''; + +-- Exception handling? + + + if not found then + raise notice ''No datasource_id found here '', ds_id ; + ds_id := null; + end if; + + + if ds_id is NOT null then + perform portal_datasource__delete(ds_id); + end if; + +return 0; + +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + + +-- drop the hooks +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'curriculum_portlet', + 'GetMyName' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'curriculum_portlet', + 'GetPrettyName' + ); + + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'curriculum_portlet', + 'Link' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'curriculum_portlet', + 'AddSelfToPage' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'curriculum_portlet', + 'Show' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'curriculum_portlet', + 'Edit' +); + +select acs_sc_impl_alias__delete ( + 'portal_datasource', + 'curriculum_portlet', + 'RemoveSelfFromPage' +); + +-- Drop the binding +select acs_sc_binding__delete ( + 'portal_datasource', + 'curriculum_portlet' +); + +-- drop the impl +select acs_sc_impl__delete ( + 'portal_datasource', + 'curriculum_portlet' +); + +\i curriculum-admin-portlet-drop.sql Index: openacs-4/packages/curriculum-portlet/tcl/curriculum-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/tcl/curriculum-admin-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/tcl/curriculum-admin-portlet-procs.tcl 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,71 @@ +ad_library { + + Procedures to support the curriculum portlet. + + @creation-date 2003-06-11 + @author Ola Hansson (ola@polyxena.net) + @cvs-id $Id: curriculum-admin-portlet-procs.tcl,v 1.1 2003/06/16 22:24:04 olah Exp $ + +} + +namespace eval curriculum_admin_portlet { + + ad_proc -private get_my_name { + } { + return "curriculum_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "Curriculum Administration" + } + + ad_proc -private my_package_key { + } { + return "curriculum-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + } { + Adds a curriculum admin PE to the given admin portal. There should only + ever be one of these portals on an admin page with only one curriculum_package_id + + @param portal_id The page to add self to + @param package_id the id of the curriculum package + + @return element_id The new element's id + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + ] + } + + ad_proc -public remove_self_from_page { + portal_id + } { + Removes a curriculum admin PE from the given portal + } { + portal::remove_element -portal_id $portal_id -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "curriculum-admin-portlet" + } + +} Index: openacs-4/packages/curriculum-portlet/tcl/curriculum-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/tcl/curriculum-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/tcl/curriculum-portlet-procs.tcl 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,87 @@ +ad_library { + + Procedures to support the Curriculum portlet. + + @author Ola Hansson (ola@polyxena.net) + @creation-date 2003-06-11 + @cvs-id $Id: curriculum-portlet-procs.tcl,v 1.1 2003/06/16 22:24:04 olah Exp $ + +} + +namespace eval curriculum_portlet { + + ad_proc -private get_my_name { + } { + return "curriculum_portlet" + } + + ad_proc -private my_package_key { + } { + return "curriculum-portlet" + } + + ad_proc -public get_pretty_name { + } { + return "Curriculum" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + {-param_action:required} + } { + Adds a curriculum PE to the given portal or appends the given + curriculum_package_id to the params of the curriculum pe already there + + @param portal_id The page to add self to + @param package_id the id of the curriculum package for this community + + @return element_id The new element's id + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id \ + -pretty_name [get_pretty_name] \ + -force_region [parameter::get_from_package_key \ + -package_key [my_package_key] \ + -parameter "curriculum_portlet_force_region"] \ + -param_action $param_action + ] + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + {-package_id:required} + } { + Removes a curriculum PE from the given page or just the passed + in curriculum_package_id parameter from the portlet + (that has other curriculum_package_ids) + + @param portal_id The page to remove self from + @param package_id + } { + portal::remove_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + } + + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "curriculum-portlet" + } + +} Index: openacs-4/packages/curriculum-portlet/www/curriculum-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/www/curriculum-admin-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/www/curriculum-admin-portlet.adp 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,5 @@ + Index: openacs-4/packages/curriculum-portlet/www/curriculum-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/www/curriculum-admin-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/www/curriculum-admin-portlet.tcl 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,25 @@ +ad_page_contract { + + The display logic for the Curriculum admin portlet + + @author Ola Hanssson (ola@polyxena.net) + @creation-date 2003-06-11 + @cvs-id $Id: curriculum-admin-portlet.tcl,v 1.1 2003/06/16 22:24:04 olah Exp $ + +} -properties { + +} + +array set config $cf +set list_of_package_ids $config(package_id) + +if {[llength $list_of_package_ids] > 1} { + # We have a problem! + return -code error "There should be only one instance of curriculum for admin purposes" +} + +set package_id [lindex $list_of_package_ids 0] + +set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0] + +ad_return_template Index: openacs-4/packages/curriculum-portlet/www/curriculum-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/www/curriculum-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/www/curriculum-portlet.adp 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,6 @@ + + + + +   + Index: openacs-4/packages/curriculum-portlet/www/curriculum-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/curriculum-portlet/www/curriculum-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/curriculum-portlet/www/curriculum-portlet.tcl 16 Jun 2003 22:24:04 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + + The logic for the curriculum portlet. + + @author Ola Hansson (ola@polyxena.net) + @creation-date 2003-06-11 + @cvs-id $Id: curriculum-portlet.tcl,v 1.1 2003/06/16 22:24:04 olah Exp $ + +} -query { +} + +array set config $cf + +set shaded_p $config(shaded_p) +set list_of_package_ids $config(package_id) + +if {[llength $list_of_package_ids] > 1} { + # We have a problem! + return -code error "There should be only one instance of curriculum for admin purposes" +} + +ad_return_template Index: openacs-4/packages/dotlrn-curriculum/dotlrn-curriculum.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-curriculum/dotlrn-curriculum.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-curriculum/dotlrn-curriculum.info 16 Jun 2003 22:21:02 -0000 1.1 @@ -0,0 +1,25 @@ + + + + + dotLRN Curriculum Applet + dotLRN Curriculum Applets + f + t + + + Ola Hansson + Polyxena + + + + + + + + + + + + + Index: openacs-4/packages/dotlrn-curriculum/sql/oracle/dotlrn-curriculum-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-curriculum/sql/oracle/dotlrn-curriculum-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-curriculum/sql/oracle/dotlrn-curriculum-create.sql 16 Jun 2003 22:21:02 -0000 1.1 @@ -0,0 +1,145 @@ +-- +-- The curriculum applet for dotLRN +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-13 +-- @cvs-id $Id: dotlrn-curriculum-create.sql,v 1.1 2003/06/16 22:21:02 olah Exp $ +-- + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'dotlrn_curriculum' + ); + + -- add all the hooks + + -- GetPrettyName + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'GetPrettyName', + 'dotlrn_curriculum::get_pretty_name', + 'TCL' + ); + + -- AddApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddApplet', + 'dotlrn_curriculum::add_applet', + 'TCL' + ); + + -- RemoveApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveApplet', + 'dotlrn_curriculum::remove_applet', + 'TCL' + ); + + -- AddAppletToCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddAppletToCommunity', + 'dotlrn_curriculum::add_applet_to_community', + 'TCL' + ); + + -- RemoveAppletFromCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveAppletFromCommunity', + 'dotlrn_curriculum::remove_applet_from_community', + 'TCL' + ); + + -- AddUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddUser', + 'dotlrn_curriculum::add_user', + 'TCL' + ); + + -- RemoveUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveUser', + 'dotlrn_curriculum::remove_user', + 'TCL' + ); + + -- AddUserToCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddUserToCommunity', + 'dotlrn_curriculum::add_user_to_community', + 'TCL' + ); + + -- RemoveUserFromCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveUserFromCommunity', + 'dotlrn_curriculum::remove_user_from_community', + 'TCL' + ); + + -- AddPortlet + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_curriculum', + impl_operation_name => 'AddPortlet', + impl_alias => 'dotlrn_curriculum::add_portlet', + impl_pl => 'TCL' + ); + + -- RemovePortlet + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_curriculum', + impl_operation_name => 'RemovePortlet', + impl_alias => 'dotlrn_curriculum::remove_portlet', + impl_pl => 'TCL' + ); + + -- Clone + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_curriculum', + impl_operation_name => 'Clone', + impl_alias => 'dotlrn_curriculum::clone', + impl_pl => 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_curriculum', + impl_operation_name => 'ChangeEventHandler', + impl_alias => 'dotlrn_curriculum::change_event_handler', + impl_pl => 'TCL' + ); + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_curriculum' + ); +end; +/ +show errors Index: openacs-4/packages/dotlrn-curriculum/sql/postgresql/dotlrn-curriculum-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-curriculum/sql/postgresql/dotlrn-curriculum-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-curriculum/sql/postgresql/dotlrn-curriculum-create.sql 16 Jun 2003 22:21:02 -0000 1.1 @@ -0,0 +1,141 @@ +-- +-- The curriculum applet for dotLRN +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-11 +-- @cvs-id $Id: dotlrn-curriculum-create.sql,v 1.1 2003/06/16 22:21:02 olah Exp $ +-- + + +-- create the implementation + +select acs_sc_impl__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'dotlrn_curriculum' +); + + +-- add all the hooks + +-- GetPrettyName +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'GetPrettyName', + 'dotlrn_curriculum::get_pretty_name', + 'TCL' +); + +-- AddApplet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddApplet', + 'dotlrn_curriculum::add_applet', + 'TCL' +); + +-- RemoveApplet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveApplet', + 'dotlrn_curriculum::remove_applet', + 'TCL' +); + +-- AddAppletToCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddAppletToCommunity', + 'dotlrn_curriculum::add_applet_to_community', + 'TCL' +); + +-- RemoveAppletFromCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveAppletFromCommunity', + 'dotlrn_curriculum::remove_applet_from_community', + 'TCL' +); + +-- AddUser +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddUser', + 'dotlrn_curriculum::add_user', + 'TCL' +); + +-- RemoveUser +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveUser', + 'dotlrn_curriculum::remove_user', + 'TCL' +); + +-- AddUserToCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddUserToCommunity', + 'dotlrn_curriculum::add_user_to_community', + 'TCL' +); + +-- RemoveUserFromCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveUserFromCommunity', + 'dotlrn_curriculum::remove_user_from_community', + 'TCL' +); + +-- AddPortlet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddPortlet', + 'dotlrn_curriculum::add_portlet', + 'TCL' +); + +-- RemovePortlet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemovePortlet', + 'dotlrn_curriculum::remove_portlet', + 'TCL' +); + +-- Clone +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'Clone', + 'dotlrn_curriculum::clone', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'ChangeEventHandler', + 'dotlrn_curriculum::change_event_handler', + 'TCL' +); + +-- Add the binding +select acs_sc_binding__new ( + 'dotlrn_applet', + 'dotlrn_curriculum' +); Index: openacs-4/packages/dotlrn-curriculum/sql/postgresql/dotlrn-curriculum-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-curriculum/sql/postgresql/dotlrn-curriculum-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-curriculum/sql/postgresql/dotlrn-curriculum-drop.sql 16 Jun 2003 22:21:02 -0000 1.1 @@ -0,0 +1,108 @@ +-- +-- The curriculum applet for dotLRN +-- +-- @author Ola Hansson (ola@polyxena.net) +-- @creation-date 2003-06-11 +-- @cvs-id $Id: dotlrn-curriculum-drop.sql,v 1.1 2003/06/16 22:21:02 olah Exp $ +-- + + +-- delete the implementation + +select acs_sc_impl__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum' +); + + + + +-- GetPrettyName +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'GetPrettyName' +); + +-- AddApplet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddApplet' +); + +-- RemoveApplet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveApplet' +); + +-- AddAppletToCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddAppletToCommunity' +); + +-- RemoveAppletFromCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveAppletFromCommunity' +); + +-- AddUser +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddUser' +); + +-- RemoveUser +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveUser' +); + +-- AddUserToCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddUserToCommunity' +); + +-- RemoveUserFromCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemoveUserFromCommunity' +); + +-- AddPortlet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'AddPortlet' +); + +-- RemovePortlet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'RemovePortlet' +); + +-- Clone +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum', + 'Clone' +); + +-- Add the binding +select acs_sc_binding__delete ( + 'dotlrn_applet', + 'dotlrn_curriculum' +); Index: openacs-4/packages/dotlrn-curriculum/tcl/dotlrn-curriculum-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-curriculum/tcl/dotlrn-curriculum-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-curriculum/tcl/dotlrn-curriculum-procs-postgresql.xql 16 Jun 2003 22:21:02 -0000 1.1 @@ -0,0 +1,16 @@ + + + +postgresql7.1 + + + + select curriculum__clone ( + :old_package_id, + :new_package_id + ); + + + + + Index: openacs-4/packages/dotlrn-curriculum/tcl/dotlrn-curriculum-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-curriculum/tcl/dotlrn-curriculum-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-curriculum/tcl/dotlrn-curriculum-procs.tcl 16 Jun 2003 22:21:02 -0000 1.1 @@ -0,0 +1,232 @@ +ad_library { + + Procs to set up the dotLRN Curriculum applet + + @author Ola Hansson (ola@polyxena.net) + @creation-date 2003-06-11 + @cvs-id $Id: dotlrn-curriculum-procs.tcl,v 1.1 2003/06/16 22:21:02 olah Exp $ + +} + +namespace eval dotlrn_curriculum { + + ad_proc -public get_pretty_name { + } { + get the pretty name + } { + return "Curriculum" + } + + ad_proc -public applet_key {} { + return "dotlrn_curriculum" + } + + ad_proc -public my_package_key { + } { + What's my package key? + } { + return "dotlrn-curriculum" + } + + ad_proc -public package_key { + } { + What package is associated with this applet? + } { + return "curriculum" + } + + ad_proc -public add_applet { + } { + Add the curriculum applet to dotlrn - one time init - must be repeatable! + } { + dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key] + } + + ad_proc -public remove_applet { + community_id + package_id + } { + remove the applet + } { + ad_return_complaint 1 "[applet_key] remove_applet not implimented!" + } + + ad_proc -public add_applet_to_community { + community_id + } { + Add the curriculum applet to a specifc community + } { + set portal_id [dotlrn_community::get_portal_id \ + -community_id $community_id + ] + + # create the curriculum package instance (all in one, I've mounted it) + set package_id [dotlrn::instantiate_and_mount \ + $community_id \ + [package_key] + ] + + # + # portlet stuff + # + + # set up the admin portlet + + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] + + curriculum_admin_portlet::add_self_to_page \ + -portal_id $admin_portal_id \ + -package_id $package_id + + # set up the curriculum portlet for this community + + set portal_id [dotlrn_community::get_portal_id \ + -community_id $community_id + ] + + # add the portlet to the comm's portal using add_portlet_helper + set args [ns_set create] + ns_set put $args package_id $package_id + ns_set put $args param_action "overwrite" + + dotlrn_curriculum::add_portlet_helper $portal_id $args + + # return the package_id + return $package_id + } + + ad_proc -public remove_applet_from_community { + community_id + } { + Drops the curriculum applet from the given community + } { + ad_return_complaint 1 "[applet_key] remove_applet_from_community not implimented!" + } + + ad_proc -public add_user { + user_id + } { + For one time user-specfic init + } { + # noop + } + + ad_proc -public remove_user { + user_id + } { + Remove the user from dotlrn. + } { + ad_return_complaint 1 "[applet_key] remove_user not implimented!" + } + + ad_proc -public add_user_to_community { + community_id + user_id + } { + Called when a user is added to a specific dotlrn community + } { + set portal_id [dotlrn::get_portal_id -user_id $user_id] + set package_id [dotlrn_community::get_applet_package_id \ + -community_id $community_id \ + -applet_key [applet_key] + ] + + set args [ns_set create] + ns_set put $args package_id $package_id + ns_set put $args param_action append + + dotlrn_curriculum::add_portlet_helper $portal_id $args + } + + ad_proc -public remove_user_from_community { + community_id + user_id + } { + Remove a user from a community + } { + set portal_id [dotlrn::get_portal_id -user_id $user_id] + set package_id [dotlrn_community::get_applet_package_id \ + -community_id $community_id \ + -applet_key [applet_key] + ] + + set args [ns_set create] + ns_set put $args package_id $package_id + + remove_portlet $portal_id $args + } + + ad_proc -public add_portlet { + portal_id + } { + A helper proc to add the underlying portlet to the given portal. + + @portal_id + } { + set args [ns_set create] + ns_set put $args package_id 0 + ns_set put $args param_action "overwrite" + + add_portlet_helper $portal_id $args + } + + ad_proc -public add_portlet_helper { + portal_id + args + } { + This does the call to add the portlet to the given portal. + Params for the portlet are set by the calllers. + + @param portal_id + @param args An ns_set + } { + curriculum_portlet::add_self_to_page \ + -portal_id $portal_id \ + -package_id [ns_set get $args "package_id"] \ + -param_action [ns_set get $args "param_action"] + } + + ad_proc -public remove_portlet { + portal_id + args + } { + A helper proc to remove the underlying portlet from the given portal. + + @param portal_id + @param args An ns_set + } { + curriculum_portlet::remove_self_from_page \ + -portal_id $portal_id \ + -package_id [ns_set get $args "package_id"] + } + + ad_proc -public clone { + old_community_id + new_community_id + } { + Clone this applet's content from the old community to the new one + } { + ns_log notice "Cloning: [applet_key]" + set new_package_id [add_applet_to_community $new_community_id] + set old_package_id [dotlrn_community::get_applet_package_id \ + -community_id $old_community_id \ + -applet_key [applet_key] + ] + + db_exec_plsql call_curriculum_clone {} + return $new_package_id + } + + ad_proc -public change_event_handler { + community_id + event + old_value + new_value + } { + listens for the following events: + } { + } + +}