Index: openacs-4/packages/dotlrn-attendance/dotlrn-attendance.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-attendance/dotlrn-attendance.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-attendance/dotlrn-attendance.info 31 May 2005 22:03:56 -0000 1.1 @@ -0,0 +1,23 @@ + + + + + dotLRN Attendance Applet + dotLRn Attendance Applets + f + t + + + Hamilton Chua + Attendance Package + + + + + + + + + + + Index: openacs-4/packages/dotlrn-attendance/sql/postgresql/dotlrn-attendance-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-attendance/sql/postgresql/dotlrn-attendance-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-attendance/sql/postgresql/dotlrn-attendance-create.sql 31 May 2005 22:03:56 -0000 1.1 @@ -0,0 +1,133 @@ + +-- create the implementation + +select acs_sc_impl__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'dotlrn_attendance' +); + + +-- add all the hooks + +-- GetPrettyName +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'GetPrettyName', + 'dotlrn_attendance::get_pretty_name', + 'TCL' +); + +-- AddApplet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddApplet', + 'dotlrn_attendance::add_applet', + 'TCL' +); + +-- RemoveApplet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveApplet', + 'dotlrn_attendance::remove_applet', + 'TCL' +); + +-- AddAppletToCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddAppletToCommunity', + 'dotlrn_attendance::add_applet_to_community', + 'TCL' +); + +-- RemoveAppletFromCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveAppletFromCommunity', + 'dotlrn_attendance::remove_applet_from_community', + 'TCL' +); + +-- AddUser +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddUser', + 'dotlrn_attendance::add_user', + 'TCL' +); + +-- RemoveUser +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveUser', + 'dotlrn_attendance::remove_user', + 'TCL' +); + +-- AddUserToCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddUserToCommunity', + 'dotlrn_attendance::add_user_to_community', + 'TCL' +); + +-- RemoveUserFromCommunity +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveUserFromCommunity', + 'dotlrn_attendance::remove_user_from_community', + 'TCL' +); + +-- AddPortlet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddPortlet', + 'dotlrn_attendance::add_portlet', + 'TCL' +); + +-- RemovePortlet +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemovePortlet', + 'dotlrn_attendance::remove_portlet', + 'TCL' +); + +-- Clone +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'Clone', + 'dotlrn_attendance::clone', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'ChangeEventHandler', + 'dotlrn_attendance::change_event_handler', + 'TCL' +); + +-- Add the binding +select acs_sc_binding__new ( + 'dotlrn_applet', + 'dotlrn_attendance' +); Index: openacs-4/packages/dotlrn-attendance/sql/postgresql/dotlrn-attendance-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-attendance/sql/postgresql/dotlrn-attendance-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-attendance/sql/postgresql/dotlrn-attendance-drop.sql 31 May 2005 22:03:56 -0000 1.1 @@ -0,0 +1,100 @@ + +-- delete the implementation + +select acs_sc_impl__delete ( + 'dotlrn_applet', + 'dotlrn_attendance' +); + + + + +-- GetPrettyName +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'GetPrettyName' +); + +-- AddApplet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddApplet' +); + +-- RemoveApplet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveApplet' +); + +-- AddAppletToCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddAppletToCommunity' +); + +-- RemoveAppletFromCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveAppletFromCommunity' +); + +-- AddUser +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddUser' +); + +-- RemoveUser +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveUser' +); + +-- AddUserToCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddUserToCommunity' +); + +-- RemoveUserFromCommunity +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemoveUserFromCommunity' +); + +-- AddPortlet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'AddPortlet' +); + +-- RemovePortlet +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'RemovePortlet' +); + +-- Clone +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_attendance', + 'Clone' +); + +-- Add the binding +select acs_sc_binding__delete ( + 'dotlrn_applet', + 'dotlrn_attendance' +); Index: openacs-4/packages/dotlrn-attendance/tcl/dotlrn-attendance-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-attendance/tcl/dotlrn-attendance-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-attendance/tcl/dotlrn-attendance-procs-postgresql.xql 31 May 2005 22:03:56 -0000 1.1 @@ -0,0 +1,16 @@ + + + +postgresql7.1 + + + + select attendance__clone ( + :old_package_id, + :new_package_id + ); + + + + + Index: openacs-4/packages/dotlrn-attendance/tcl/dotlrn-attendance-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-attendance/tcl/dotlrn-attendance-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-attendance/tcl/dotlrn-attendance-procs.tcl 31 May 2005 22:03:56 -0000 1.1 @@ -0,0 +1,175 @@ +ad_library { + + Procs to set up the dotLRN attendance applet + + @author Hamilton Chua (hamilton.chua@gmail.com) + @version $Id: dotlrn-attendance-procs.tcl,v 1.1 2005/05/31 22:03:56 hamiltonc Exp $ + +} + +namespace eval dotlrn_attendance { + + ad_proc -public get_pretty_name { + } { + get the pretty name + } { + return "Attendance" + } + + ad_proc -public applet_key {} { + return "dotlrn_attendance" + } + + ad_proc -public my_package_key { + } { + What's my package key? + } { + return "dotlrn-attendance" + } + + ad_proc -public package_key { + } { + What package is associated with this applet? + } { + return "attendance" + } + + ad_proc -public add_applet { + } { + Add the attendance 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 attendance applet to a specifc community + } { + set portal_id [dotlrn_community::get_portal_id \ + -community_id $community_id + ] + + # create the package instance (all in one, I've mounted it) + set package_id [dotlrn::instantiate_and_mount \ + $community_id \ + [package_key] + ] + # return the package_id + return $package_id + } + + ad_proc -public remove_applet_from_community { + community_id + } { + Drops the attendance 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. + } { + # noop + } + + ad_proc -public add_user_to_community { + community_id + user_id + } { + Called when a user is added to a specific dotlrn community + } { + # noop + } + + ad_proc -public remove_user_from_community { + community_id + user_id + } { + Remove a user from a community + } { + # noop + } + + ad_proc -public add_portlet { + portal_id + } { + A helper proc to add the underlying portlet to the given portal. + + @portal_id + } { + # noop + } + + 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 + } { + #noop + } + + 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 + } { + #noop + } + + 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_attendance_clone {} + return $new_package_id + } + + ad_proc -public change_event_handler { + community_id + event + old_value + new_value + } { + listens for the following events: + } { + } + +}