Index: openacs-4/packages/dotlrn-research/dotlrn-research.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/dotlrn-research.info,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-research/dotlrn-research.info 25 Feb 2002 22:13:00 -0000 1.1 +++ openacs-4/packages/dotlrn-research/dotlrn-research.info 5 Mar 2002 00:41:01 -0000 1.2 @@ -20,11 +20,21 @@ + + + + + + + + + + Index: openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-create.sql 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,100 @@ +-- +-- Creates the research paper module dotLRN applet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: dotlrn-research-applet-create.sql,v 1.1 2002/03/05 00:41:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- create the implementation + foo := acs_sc_impl.new ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_owner_name => 'dotlrn_research' + ); + + -- GetPrettyName + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'GetPrettyName', + impl_alias => 'dotlrn_research::get_pretty_name', + impl_pl => 'TCL' + ); + + -- AddApplet + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddApplet', + impl_alias => 'dotlrn_research::add_applet', + impl_pl => 'TCL' + ); + + -- AddAppletToCommunity + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddAppletToCommunity', + impl_alias => 'dotlrn_research::add_applet_to_community', + impl_pl => 'TCL' + ); + + -- RemoveApplet + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveApplet', + impl_alias => 'dotlrn_research::remove_applet', + impl_pl => 'TCL' + ); + + -- AddUser + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddUser', + impl_alias => 'dotlrn_research::add_user', + impl_pl => 'TCL' + ); + + -- AddUserToCommunity + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddUserToCommunity', + impl_alias => 'dotlrn_research::add_user_to_community', + impl_pl => 'TCL' + ); + + -- RemoveUser + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveUser', + impl_alias => 'dotlrn_research::remove_user', + impl_pl => 'TCL' + ); + + -- RemoveUserFromCommunity + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveUserFromCommunity', + impl_alias => 'dotlrn_research::remove_user_from_community', + impl_pl => 'TCL' + ); + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-drop.sql 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,81 @@ +-- +-- Drops the research paper module dotLRN applet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: dotlrn-research-applet-drop.sql,v 1.1 2002/03/05 00:41:01 yon Exp $ +-- + +declare + foo integer; +begin + + acs_sc_binding.delete ( + contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research' + ); + + -- GetPrettyName + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'GetPrettyName' + ); + + -- AddApplet + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddApplet' + ); + + -- AddAppletToCommunity + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddAppletToCommunity' + ); + + -- RemoveApplet + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveApplet' + ); + + -- AddUser + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddUser' + ); + + -- AddUserToCommunity + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddUserToCommunity' + ); + + -- RemoveUser + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveUser' + ); + + -- RemoveUserFromCommunity + foo := acs_sc_impl.delete_alias ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveUserFromCommunity' + ); + + acs_sc_impl.delete ( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-create.sql 25 Feb 2002 22:13:00 -0000 1.1 +++ openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-create.sql 5 Mar 2002 00:41:01 -0000 1.2 @@ -1,100 +1,24 @@ -- --- Creates the research paper module dotLRN applet +-- Creates the dotLRN research paper module -- -- @author yon (yon@openforce.net) -- @creation-date 2002-02-24 -- @version $Id$ -- -@@ research-portlet-create.sql; +create table dotlrn_research_papers ( + community_id constraint dotlrn_rp_community_id_fk + references dotlrn_communities (community_id) + constraint dotlrn_rp_community_id_nn + not null, + file_id constraint dotlrn_rp_file_id_fk + references cr_revisions (revision_id) + constraint dotlrn_rp_file_id_nn + not null, + constraint dotlrn_research_papers_pk + primary key (community_id, file_id) +); -declare - foo integer; -begin - -- create the implementation - foo := acs_sc_impl.new ( - 'dotlrn_applet', - 'dotlrn_research', - 'dotlrn_research' - ); - - -- GetPrettyName - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'GetPrettyName', - 'dotlrn_research::get_pretty_name', - 'TCL' - ); - - -- AddApplet - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'AddApplet', - 'dotlrn_research::add_applet', - 'TCL' - ); - - -- AddAppletToCommunity - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'AddAppletToCommunity', - 'dotlrn_research::add_applet_to_community', - 'TCL' - ); - - -- RemoveApplet - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'RemoveApplet', - 'dotlrn_research::remove_applet', - 'TCL' - ); - - -- AddUser - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'AddUser', - 'dotlrn_research::add_user', - 'TCL' - ); - - -- AddUserToCommunity - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'AddUserToCommunity', - 'dotlrn_research::add_user_to_community', - 'TCL' - ); - - -- RemoveUser - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'RemoveUser', - 'dotlrn_research::remove_user', - 'TCL' - ); - - -- RemoveUserFromCommunity - foo := acs_sc_impl.new_alias ( - 'dotlrn_applet', - 'dotlrn_research', - 'RemoveUserFromCommunity', - 'dotlrn_research::remove_user_from_community', - 'TCL' - ); - - -- Add the binding - acs_sc_binding.new ( - contract_name => 'dotlrn_applet', - impl_name => 'dotlrn_research' - ); -end; -/ -show errors +@@ research-portlet-create.sql; +@@ research-admin-portlet-create.sql; +@@ dotlrn-research-applet-create.sql Index: openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-drop.sql 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,13 @@ +-- +-- Creates the dotLRN research paper module +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: dotlrn-research-drop.sql,v 1.1 2002/03/05 00:41:01 yon Exp $ +-- + +@@ dotlrn-research-applet-drop.sql +@@ research-admin-portlet-drop.sql; +@@ research-portlet-drop.sql; + +drop table dotlrn_research_papers; Index: openacs-4/packages/dotlrn-research/sql/oracle/research-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/Attic/research-admin-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/research-admin-portlet-create.sql 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,162 @@ +-- +-- Creates the research paper module portlet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: research-admin-portlet-create.sql,v 1.1 2002/03/05 00:41:01 yon Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + ds_id := portal_datasource.new( + name => 'research_admin_portlet', + description => 'Displays a list of research papers' + ); + + -- the standard 4 params + -- shadeable_p + portal_datasource.set_def_param( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 't' + ); + + -- 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' + ); + + -- shaded_p + portal_datasource.set_def_param( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_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' + ); + + -- party_id + portal_datasource.set_def_param( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'party_id', + value => '' + ); + + -- create the implementation + foo := acs_sc_impl.new( + 'portal_datasource', + 'research_admin_portlet', + 'research_admin_portlet' + ); + + -- add all the hooks + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'MyName', + 'research_admin_portlet::my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'GetPrettyName', + 'research_admin_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Link', + 'research_admin_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'AddSelfToPage', + 'research_admin_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Show', + 'research_admin_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Edit', + 'research_admin_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'RemoveSelfFromPage', + 'research_admin_portlet::remove_self_from_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'MakeSelfAvailable', + 'research_admin_portlet::make_self_available', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'MakeSelfUnavailable', + 'research_admin_portlet::make_self_unavailable', + 'TCL' + ); + + -- Add the binding + acs_sc_binding.new( + contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn-research/sql/oracle/research-admin-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/Attic/research-admin-portlet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/research-admin-portlet-drop.sql 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,92 @@ +-- +-- Creates the research paper module portlet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: research-admin-portlet-drop.sql,v 1.1 2002/03/05 00:41:01 yon Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + begin + select datasource_id + into ds_id + from portal_datasources + where name = 'research_admin_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; + + acs_sc_binding.delete( + contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'MyName' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'GetPrettyName' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'Link' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'AddSelfToPage' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'Show' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'Edit' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'RemoveSelfFromPage' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'MakeSelfAvailable' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet', + impl_operation_name => 'MakeSelfUnavailable' + ); + + acs_sc_impl.delete( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); +end; +/ +show errors Index: openacs-4/packages/dotlrn-research/sql/oracle/research-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/Attic/research-portlet-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-research/sql/oracle/research-portlet-drop.sql 25 Feb 2002 22:13:00 -0000 1.1 +++ openacs-4/packages/dotlrn-research/sql/oracle/research-portlet-drop.sql 5 Mar 2002 00:41:01 -0000 1.2 @@ -8,6 +8,7 @@ declare ds_id portal_datasources.datasource_id%TYPE; + foo integer; begin begin @@ -23,72 +24,69 @@ portal_datasource.delete(ds_id); end if; - -- drop the hooks + acs_sc_binding.delete( + contract_name => 'portal_datasource', + impl_name => 'research_portlet' + ); + foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'MyName' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'MyName' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'GetPrettyName' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'GetPrettyName' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'Link' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'Link' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'AddSelfToPage' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'AddSelfToPage' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'Show' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'Show' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'Edit' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'Edit' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'RemoveSelfFromPage' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'RemoveSelfFromPage' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'MakeSelfAvailable' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'MakeSelfAvailable' ); foo := acs_sc_impl.delete_alias( - 'portal_datasource', - 'research_portlet', - 'MakeSelfUnavailable' + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet', + impl_operation_name => 'MakeSelfUnavailable' ); - -- Drop the binding - acs_sc_binding.delete( - contract_name => 'portal_datasource', + acs_sc_impl.delete( + impl_contract_name => 'portal_datasource', impl_name => 'research_portlet' ); - - -- drop the impl - foo := acs_sc_impl.delete( - 'portal_datasource', - 'research_portlet' - ); end; / show errors Index: openacs-4/packages/dotlrn-research/tcl/dotlrn-research-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/Attic/dotlrn-research-admin-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-admin-procs.tcl 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,117 @@ +ad_library { + + Procs to set up the dotLRN research module applet + + @author yon (yon@openforce.net) + @creation-date 2002-02-25 + @version $Id: dotlrn-research-admin-procs.tcl,v 1.1 2002/03/05 00:41:01 yon Exp $ + +} + +namespace eval dotlrn_research_admin { + + ad_proc -public applet_key { + } { + get the package_key this applet deals with + } { + return "dotlrn_research_admin" + } + + 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 "research-portlet" + } + + ad_proc -public get_pretty_name { + } { + returns the pretty name + } { + return "dotLRN Research Papers" + } + + ad_proc -public get_user_default_page {} { + return the user default page to add the portlet to + } { + return "Research Papers" + } + + ad_proc -public add_applet { + } { + Used for one-time init - must be repeatable! + } { + dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] + } + + ad_proc -public add_applet_to_community { + community_id + } { + Add the research paper applet to a specifc dotlrn community + } { + # get the portal_template_id by callback + set pt_id [dotlrn_community::get_community_admin_portal_id $community_id] + + research_admin_portlet::make_self_available $pt_id + research_admin_portlet::add_self_to_page $pt_id "" $community_id + } + + ad_proc -public remove_applet { + community_id + package_id + } { + remove the applet from the community + } { + } + + ad_proc -public add_user { + user_id + } { + One time user-specfic init + } { + } + + ad_proc -public add_user_to_community { + community_id + user_id + } { + Add a user to a to a specifc dotlrn community + } { + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] + + # Call the portal element to be added correctly + # Make research paper applet available at community-user page level + research_admin_portlet::add_self_to_page $portal_id "" $community_id + } + + ad_proc -public remove_user { + user_id + } { + } { + } + + ad_proc -public remove_user_from_community { + community_id + user_id + } { + Remove a user from a community + } { + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] + + # Remove the portal element + research_admin_portlet::remove_self_from_page $portal_id "" $party_id + + # Buh Bye. + research_admin_portlet::make_self_unavailable $portal_id + } + +} Index: openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 25 Feb 2002 22:13:00 -0000 1.1 +++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 5 Mar 2002 00:41:01 -0000 1.2 @@ -48,7 +48,7 @@ } { Used for one-time init - must be repeatable! } { - dotlrn_community::add_applet_to_dotlrn -applet_key [applet_key] + dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] } ad_proc -public add_applet_to_community { @@ -61,6 +61,8 @@ research_portlet::make_self_available $pt_id research_portlet::add_self_to_page $pt_id "" $community_id + + dotlrn_research_admin::add_applet_to_community $community_id } ad_proc -public remove_applet { Index: openacs-4/packages/dotlrn-research/tcl/research-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/Attic/research-admin-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/tcl/research-admin-portlet-procs.tcl 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,120 @@ +# dotlrn-research/tcl/research-portlet-procs.tcl + +ad_library { + + Procedures to support the research module portlet + + @author yon (yon@openforce.net) + @creation-date 2002-02-24 + @version $Id: research-admin-portlet-procs.tcl,v 1.1 2002/03/05 00:41:01 yon Exp $ + +} + +namespace eval research_admin_portlet { + + ad_proc -private my_package_key { + } { + return "dotlrn-research" + } + + ad_proc -private my_name { + } { + return "research_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "Research Papers" + } + + ad_proc -public link { + } { + return "file-storage" + } + + ad_proc -public add_self_to_page { + {-page_id ""} + portal_id + instance_id + party_id + } { + Adds a research portlet element to the specified page. + + @param page_id The page to add self to + @param portal_id The portal to add self to + @param instance_id XXX DO NOT KNOW WHAT THIS IS + @param party_id The party for which to display research papers + + @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] \ + -key "party_id" \ + -value_id $party_id + ] + } + + ad_proc -public remove_self_from_page { + portal_id + instance_id + party_id + } { + Removes a research portlet element from the specified page. + + @param portal_id The page to remove self from + @param instance_id XXX DO NOT KNOW WHAT THIS IS + @param party_id The party for which to display research papers + } { + portal::remove_element_or_remove_id \ + -portal_id $portal_id \ + -portlet_name [my_name] \ + -key "party_id" \ + -value_id $party_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 + } { + 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 "research-admin-portlet" \ + -package_key [my_package_key] \ + -config_list $cf + } + + ad_proc -public edit { + } { + return {} + } + +} Index: openacs-4/packages/dotlrn-research/www/research-admin-portlet-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/www/Attic/research-admin-portlet-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/www/research-admin-portlet-oracle.xql 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,45 @@ + + + +oracle8.1.6 + + + + select fs_files.file_id, + fs_files.name, + fs_files.live_revision, + fs_files.type, + to_char(fs_files.last_modified, 'Mon DD YYYY HH24:MI') as last_modified, + fs_files.content_size, + fs_files.url + from fs_files, + acs_permissions + where acs_permissions.object_id = fs_files.live_revision + and acs_permissions.grantee_id = :party_id + and acs_permissions.privilege = 'read' + and not exists (select 1 + from dotlrn_research_papers + where dotlrn_research_papers.community_id = :community_id + and dotlrn_research_papers.file_id = fs_files.live_revision) + order by name + + + + + + select fs_files.file_id, + fs_files.name, + fs_files.live_revision, + fs_files.type, + to_char(fs_files.last_modified, 'Mon DD YYYY HH24:MI') as last_modified, + fs_files.content_size, + fs_files.url + from dotlrn_research_papers, + fs_files + where dotlrn_research_papers.community_id = :community_id + and dotlrn_research_papers.file_id = fs_files.live_revision + order by name + + + + Index: openacs-4/packages/dotlrn-research/www/research-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/www/Attic/research-admin-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/www/research-admin-portlet.adp 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,51 @@ + + +

No research papers to add

+
+ + + + +

No research papers to remove

+
+ + + +
+ +   + Index: openacs-4/packages/dotlrn-research/www/research-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/www/Attic/research-admin-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/www/research-admin-portlet.tcl 5 Mar 2002 00:41:01 -0000 1.1 @@ -0,0 +1,21 @@ +# dotlrn-research/www/research-portlet.tcl + +ad_page_contract { + The display logic for the research portlet + + @author yon (yon@openforce.net) + @version $Id: research-admin-portlet.tcl,v 1.1 2002/03/05 00:41:01 yon Exp $ +} -properties { + files_to_add:multirow + files_to_remove:multirow +} + +array set config $cf +set user_id [ad_conn user_id] +set community_id [dotlrn_community::get_community_id] +set party_id $config(party_id) + +db_multirow files_to_add select_files_to_add {} +db_multirow files_to_remove select_files_to_remove {} + +ad_return_template Index: openacs-4/packages/dotlrn-research/www/research-portlet-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/www/Attic/research-portlet-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-research/www/research-portlet-oracle.xql 25 Feb 2002 22:43:48 -0000 1.2 +++ openacs-4/packages/dotlrn-research/www/research-portlet-oracle.xql 5 Mar 2002 00:41:01 -0000 1.3 @@ -5,25 +5,17 @@ - select cr_items.item_id as file_id, - cr_items.name as name, - cr_items.live_revision as file_live_rev, - cr_revisions.mime_type as type, - to_char(acs_objects.last_modified,'YYYY-MM-DD HH24:MI') as last_modified, - cr_revisions.content_length as content_size, - (select site_node.url(site_nodes.node_id) - from site_nodes - where site_nodes.object_id = file_storage.get_package_id(cr_items.item_id)) as url - from cr_items, - cr_revisions, - acs_objects, - acs_permissions - where cr_items.content_type = 'file_storage_object' - and cr_items.item_id = acs_objects.object_id - and cr_items.live_revision = cr_revisions.revision_id - and acs_permissions.object_id = cr_items.live_revision - and acs_permissions.grantee_id = :party_id - and acs_permissions.privilege = 'read' + select fs_files.file_id, + fs_files.name, + fs_files.live_revision, + fs_files.type, + to_char(fs_files.last_modified, 'Mon DD YYYY HH24:MI') as last_modified, + fs_files.content_size, + fs_files.url + from dotlrn_research_papers, + fs_files + where dotlrn_research_papers.community_id = :community_id + and dotlrn_research_papers.file_id = fs_files.live_revision order by name Index: openacs-4/packages/dotlrn-research/www/research-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/www/Attic/research-portlet.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-research/www/research-portlet.adp 25 Feb 2002 22:13:00 -0000 1.1 +++ openacs-4/packages/dotlrn-research/www/research-portlet.adp 5 Mar 2002 00:41:01 -0000 1.2 @@ -9,11 +9,11 @@ @files.name@ - ( - -  download  + (  + + download - ) +  ) Index: openacs-4/packages/dotlrn-research/www/research-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/www/Attic/research-portlet.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-research/www/research-portlet.tcl 25 Feb 2002 22:13:00 -0000 1.1 +++ openacs-4/packages/dotlrn-research/www/research-portlet.tcl 5 Mar 2002 00:41:01 -0000 1.2 @@ -11,6 +11,7 @@ array set config $cf set user_id [ad_conn user_id] +set community_id [dotlrn_community::get_community_id] set party_id $config(party_id) db_multirow files select_files {}