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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/dotlrn-research.info 25 Feb 2002 22:13:00 -0000 1.1 @@ -0,0 +1,37 @@ + + + + + dotLRN Research Paper + dotLRN Research Papers + f + f + + + + oracle + postgresql + + Yonatan Feldman + OpenForce + + + + + + + + + + + + + + + + + + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/dotlrn-research-create.sql 25 Feb 2002 22:13:00 -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-create.sql,v 1.1 2002/02/25 22:13:00 yon Exp $ +-- + +@@ research-portlet-create.sql; + +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 Index: openacs-4/packages/dotlrn-research/sql/oracle/research-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/sql/oracle/Attic/research-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/research-portlet-create.sql 25 Feb 2002 22:13:00 -0000 1.1 @@ -0,0 +1,160 @@ +-- +-- Creates the research paper module portlet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: research-portlet-create.sql,v 1.1 2002/02/25 22:13:00 yon Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + ds_id := portal_datasource.new( + name => 'research_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_portlet', + 'research_portlet' + ); + + -- add all the hooks + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'MyName', + 'research_portlet::my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'GetPrettyName', + 'research_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'Link', + 'research_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'AddSelfToPage', + 'research_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'Show', + 'research_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'Edit', + 'research_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'RemoveSelfFromPage', + 'research_portlet::remove_self_from_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'MakeSelfAvailable', + 'research_portlet::make_self_available', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'MakeSelfUnavailable', + 'research_portlet::make_self_unavailable', + 'TCL' + ); + + -- Add the binding + acs_sc_binding.new( + contract_name => 'portal_datasource', + impl_name => 'research_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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/sql/oracle/research-portlet-drop.sql 25 Feb 2002 22:13:00 -0000 1.1 @@ -0,0 +1,94 @@ +-- +-- Creates the research paper module portlet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: research-portlet-drop.sql,v 1.1 2002/02/25 22:13:00 yon Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + begin + select datasource_id + into ds_id + from portal_datasources + where name = 'research_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; + + -- drop the hooks + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'MyName' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'GetPrettyName' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'Link' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'AddSelfToPage' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'Show' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'Edit' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'RemoveSelfFromPage' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'MakeSelfAvailable' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'MakeSelfUnavailable' + ); + + -- Drop the binding + acs_sc_binding.delete( + 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-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 25 Feb 2002 22:13:00 -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-procs.tcl,v 1.1 2002/02/25 22:13:00 yon Exp $ + +} + +namespace eval dotlrn_research { + + ad_proc -public applet_key { + } { + get the package_key this applet deals with + } { + return "dotlrn_research" + } + + 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_community::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_portal_template_id $community_id] + + research_portlet::make_self_available $pt_id + research_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_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_portlet::remove_self_from_page $portal_id "" $party_id + + # Buh Bye. + research_portlet::make_self_unavailable $portal_id + } + +} Index: openacs-4/packages/dotlrn-research/tcl/research-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/Attic/research-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/tcl/research-portlet-procs.tcl 25 Feb 2002 22:13:00 -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-portlet-procs.tcl,v 1.1 2002/02/25 22:13:00 yon Exp $ + +} + +namespace eval research_portlet { + + ad_proc -private my_package_key { + } { + return "dotlrn-research" + } + + ad_proc -private my_name { + } { + return "research_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-portlet" \ + -package_key [my_package_key] \ + -config_list $cf + } + + ad_proc -public edit { + } { + return {} + } + +} 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/www/research-portlet-oracle.xql 25 Feb 2002 22:13:00 -0000 1.1 @@ -0,0 +1,31 @@ + + + +oracle8.1.6 + + + + 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 = 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' + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/www/research-portlet.adp 25 Feb 2002 22:13:00 -0000 1.1 @@ -0,0 +1,25 @@ + + + No research papers + + + + + + + + + + +
@files.name@ + ( + +  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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-research/www/research-portlet.tcl 25 Feb 2002 22:13:00 -0000 1.1 @@ -0,0 +1,18 @@ +# dotlrn-research/www/research-portlet.tcl + +ad_page_contract { + The display logic for the research portlet + + @author yon (yon@openforce.net) + @version $Id: research-portlet.tcl,v 1.1 2002/02/25 22:13:00 yon Exp $ +} -properties { + files:multirow +} + +array set config $cf +set user_id [ad_conn user_id] +set party_id $config(party_id) + +db_multirow files select_files {} + +ad_return_template