Index: openacs-4/packages/dotlrn-faq/dotlrn-faq.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/dotlrn-faq.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-faq/dotlrn-faq.info 9 Oct 2001 04:08:05 -0000 1.1 @@ -0,0 +1,30 @@ + + + + + dotLRN Faq Applet + dotLRN Faq Applets + f + t + + + + oracle + postgresql + + Ben Adida + blah blah + + + + + + + + + + + + + + Index: openacs-4/packages/dotlrn-faq/sql/oracle/dotlrn-faq-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/sql/oracle/dotlrn-faq-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-faq/sql/oracle/dotlrn-faq-create.sql 9 Oct 2001 04:08:05 -0000 1.1 @@ -0,0 +1,78 @@ + +-- +-- The faq 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_faq', + 'dotlrn_faq' + ); + + -- add all the hooks + + -- GetPrettyName + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_faq', + 'GetPrettyName', + 'dotlrn_faq::get_pretty_name', + 'TCL' + ); + + -- AddApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_faq', + 'AddApplet', + 'dotlrn_faq::add_applet', + 'TCL' + ); + + -- RemoveApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_faq', + 'RemoveApplet', + 'dotlrn_faq::remove_applet', + 'TCL' + ); + + -- AddUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_faq', + 'AddUser', + 'dotlrn_faq::add_user', + 'TCL' + ); + + -- RemoveUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_faq', + 'RemoveUser', + 'dotlrn_faq::remove_user', + 'TCL' + ); + + -- Add the binding + foo := acs_sc_binding.new ( + contract_name => 'dotlrn_applet' + impl_name => 'dotlrn_faq' + ); +end; +/ +show errors 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 9 Oct 2001 04:08:05 -0000 1.1 @@ -0,0 +1,105 @@ + + +# +# Procs for DOTLRN Faq Applet +# Copyright 2001 OpenForce, inc. +# Distributed under the GNU GPL v2 +# +# October 5th, 2001 +# + +ad_library { + + Procs to set up the dotLRN Faq applet + + @author ben@openforce.net,arjun@openforce.net + @creation-date 2001-10-05 + +} + +namespace eval dotlrn_faq { + + ad_proc -public package_key { + } { + get the package_key this applet deals with + } { + return "faq" + } + + ad_proc portal_element_key { + } { + return the portal element key + } { + return "faq-portlet" + } + + ad_proc -public add_applet { + community_id + } { + Add the faq applet + } { + # Callback to get node_id from community + # REVISIT this (ben) + set node_id [site_node_id [ad_conn url]] + + # create the faq 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] + + # 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 faq 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 faq forums + # nothing for now + + # Call the portal element to be added correctly + faq_portlet::add_self_to_page $page_id $package_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 + faq_portlet::remove_self_from_page $page_id $package_id + + # remove user permissions to see faqs + # nothing to do here + } + +}