Index: openacs-4/packages/dotlrn-dotlrn/dotlrn-dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/dotlrn-dotlrn.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-dotlrn/dotlrn-dotlrn.info 9 Oct 2001 03:04:20 -0000 1.1 @@ -0,0 +1,30 @@ + + + + + dotLRN Dotlrn Applet + dotLRN Dotlrn Applets + f + t + + + + oracle + postgresql + + Ben Adida + blah blah + + + + + + + + + + + + + + Index: openacs-4/packages/dotlrn-dotlrn/sql/oracle/dotlrn-dotlrn-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/sql/oracle/Attic/dotlrn-dotlrn-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-dotlrn/sql/oracle/dotlrn-dotlrn-init.sql 9 Oct 2001 03:04:20 -0000 1.1 @@ -0,0 +1,63 @@ + +-- +-- The "dotLRN" applet for dotLRN +-- copyright 2001, OpenForce +-- distributed under GPL v2.0 +-- +-- +-- ben,arjun@openforce.net +-- +-- 10/05/2001 +-- + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'dotlrn_applet', + 'dotlrn_dotlrn', + 'dotlrn_dotlrn' + ); + + -- add all the hooks + + -- AddApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_dotlrn', + 'AddApplet', + 'dotlrn_dotlrn::add_applet', + 'TCL' + ); + + -- RemoveApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_dotlrn', + 'RemoveApplet', + 'dotlrn_dotlrn::remove_applet', + 'TCL' + ); + + -- AddUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_dotlrn', + 'AddUser', + 'dotlrn_dotlrn::add_user', + 'TCL' + ); + + -- RemoveUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_dotlrn', + 'RemoveUser', + 'dotlrn_dotlrn::remove_user', + 'TCL' + ); +end; +/ +show errors 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 9 Oct 2001 03:04:20 -0000 1.1 @@ -0,0 +1,109 @@ + + +# +# Procs for DOTLRN Dotlrn Applet +# Copyright 2001 OpenForce, inc. +# Distributed under the GNU GPL v2 +# +# October 5th, 2001 +# + +ad_library { + + Procs to set up the dotLRN Dotlrn applet + + @author ben@openforce.net,arjun@openforce.net + @creation-date 2001-10-05 + +} + +namespace eval dotlrn_dotlrn { + + ad_proc -public package_key { + } { + get the package_key this applet deals with + } { + return "dotlrn" + } + + ad_proc portal_element_key { + } { + return the portal element key + } { + return "dotlrn-portlet" + } + + ad_proc -public add_applet { + community_id + } { + Add the dotlrn applet + } { + # Callback to get node_id from community + # REVISIT this (ben) +# set node_id [site_node_id [ad_conn url]] + + # create the dotlrn package instance (all in one, I've mounted it) +# set package_key [package_key] + #set package_id [site_node_mount_application -return package_id $node_id $package_key $package_key $package_key] + + # set up a forum inside that instance + #dotlrn_forum_new -context_id $package_id -short_name "Discussions" + + # aks - I think we just return the community_id here? + # return the package_id + return $community_id + } + + ad_proc -public remove_applet { + community_id + package_id + } { + remove the applet from the community + } { + # Remove all instances of the dotlrn portlet! (this is some serious stuff!) + + # Dropping all messages, forums + + # Killing the package + + } + + ad_proc -public add_user { + community_id + user_id + } { + Add a user to a community + } { + # Get the page_id by callback + set page_id [dotlrn_community::get_page_id $community_id $user_id] + + # Get the package_id by callback + # set package_id [dotlrn_community::get_package_id $community_id] + + # Allow user to see the dotlrn forums + # nothing for now + + # Call the portal element to be added correctly + dotlrn_portlet::add_self_to_page $page_id $community_id + } + + ad_proc -public remove_user { + community_id + user_id + } { + Remove a user from a community + } { + # Get the page_id + set page_id [dotlrn_community::get_page_id $community_id $user_id] + + # Get the package_id by callback + # set package_id [dotlrn_community::get_package_id $community_id] + + # Remove the portal element + dotlrn_portlet::remove_self_from_page $page_id $community_id + + # remove user permissions to see dotlrns + # nothing to do here + } + +} Index: openacs-4/packages/dotlrn-fs/dotlrn-fs.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/dotlrn-fs.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-fs/dotlrn-fs.info 9 Oct 2001 03:13:36 -0000 1.1 @@ -0,0 +1,30 @@ + + + + + dotLRN Fs Applet + dotLRN Fs Applets + f + t + + + + oracle + postgresql + + Ben Adida + blah blah + + + + + + + + + + + + + + Index: openacs-4/packages/dotlrn-fs/sql/oracle/dotlrn-fs-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/sql/oracle/Attic/dotlrn-fs-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-fs/sql/oracle/dotlrn-fs-init.sql 9 Oct 2001 03:13:36 -0000 1.1 @@ -0,0 +1,63 @@ + +-- +-- The fs applet for dotLRN +-- copyright 2001, OpenForce +-- distributed under GPL v2.0 +-- +-- +-- ben,arjun@openforce.net +-- +-- 10/05/2001 +-- + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'dotlrn_applet', + 'dotlrn_fs', + 'dotlrn_fs' + ); + + -- add all the hooks + + -- AddApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_fs', + 'AddApplet', + 'dotlrn_fs::add_applet', + 'TCL' + ); + + -- RemoveApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_fs', + 'RemoveApplet', + 'dotlrn_fs::remove_applet', + 'TCL' + ); + + -- AddUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_fs', + 'AddUser', + 'dotlrn_fs::add_user', + 'TCL' + ); + + -- RemoveUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_fs', + 'RemoveUser', + 'dotlrn_fs::remove_user', + 'TCL' + ); +end; +/ +show errors 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 9 Oct 2001 03:13:36 -0000 1.1 @@ -0,0 +1,114 @@ + + +# +# Procs for DOTLRN fs Applet +# Copyright 2001 OpenForce, inc. +# Distributed under the GNU GPL v2 +# +# October 5th, 2001 +# + +ad_library { + + Procs to set up the dotLRN fs applet + + @author ben@openforce.net,arjun@openforce.net + @creation-date 2001-10-05 + +} + +namespace eval dotlrn_fs { + + ad_proc -public package_key { + } { + get the package_key this applet deals with + } { + return "file-storage" + } + + ad_proc portal_element_key { + } { + return the portal element key + } { + return "fs-portlet" + } + + ad_proc -public add_applet { + community_id + } { + Add the fs applet + } { + # Callback to get node_id from community + # REVISIT this (ben) + set node_id [site_node_id [ad_conn url]] + + # create the fs package instance (all in one, I've mounted it) + set package_key [package_key] + set package_id [site_node_mount_application -return package_id $node_id $package_key $package_key $package_key] + + # set up a forum inside that instance + set folder_id [db_exec_plsql fs_root_folder " + begin + :1 := file_storage.new_root_folder(:package_id); + end;"] + + # return the package_id + return $package_id + } + + ad_proc -public remove_applet { + community_id + package_id + } { + remove the applet from the community + } { + # Remove all instances of the fs portlet! (this is some serious stuff!) + + # Dropping all messages, forums + + # Killing the package + + } + + ad_proc -public add_user { + community_id + user_id + } { + Add a user to a community + } { + # Get the page_id by callback + set page_id [dotlrn_community::get_page_id $community_id $user_id] + + # Get the package_id by callback + set package_id [dotlrn_community::get_package_id $community_id] + + # Allow user to see the fs folders + # nothing for now + + # Call the portal element to be added correctly + # fs portlet needs folder_id too + set folder_id fs_get_root_folder -package_id $package_id + + fs_portlet::add_self_to_page $page_id $package_id $folder_id + } + + ad_proc -public remove_user { + community_id + user_id + } { + Remove a user from a community + } { + # Get the page_id + set page_id [dotlrn_community::get_page_id $community_id $user_id] + + # Get the package_id by callback + set package_id [dotlrn_community::get_package_id $community_id] + + # Remove the portal element + fs_portlet::remove_self_from_page $page_id $package_id + + # remove user permissions to see fs folders + # nothing to do here + } + +}