Index: openacs-4/contrib/packages/dotlrn-research/dotlrn-research.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/Attic/dotlrn-research.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/dotlrn-research.info 14 Nov 2003 20:57:05 -0000 1.1 @@ -0,0 +1,41 @@ + + + + + dotLRN Research Paper + dotLRN Research Papers + f + t + + + + oracle + postgresql + + Yonatan Feldman + OpenForce + Code delivered to Sloan by OpenForce. As far as we know it is not finished, and certainly needs much updating. + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/oracle/Attic/dotlrn-research-applet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,146 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- 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 2003/11/14 20:57:06 janines Exp $ +-- + +declare + foo integer; +begin + + foo := acs_sc_impl.new( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_owner_name => 'dotlrn_research' + ); + + 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' + ); + + 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' + ); + + 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' + ); + + 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' + ); + + foo := acs_sc_impl.new_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveAppletFromCommunity', + impl_alias => 'dotlrn_research::remove_applet_from_community', + impl_pl => 'TCL' + ); + + 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' + ); + + 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' + ); + + 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' + ); + + 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' + ); + + foo := acs_sc_impl.new_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddPortlet', + impl_alias => 'dotlrn_research::add_portlet', + impl_pl => 'TCL' + ); + + foo := acs_sc_impl.new_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemovePortlet', + impl_alias => 'dotlrn_research::remove_portlet', + impl_pl => 'TCL' + ); + + foo := acs_sc_impl.new_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'Clone', + impl_alias => 'dotlrn_research::clone', + impl_pl => 'TCL' + ); + + foo := acs_sc_impl.new_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'ChangeEventHandler', + impl_alias => 'dotlrn_research::change_event_handler', + impl_pl => 'TCL' + ); + + acs_sc_binding.new( + contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/oracle/Attic/dotlrn-research-applet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-applet-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,113 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- 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 2003/11/14 20:57:06 janines Exp $ +-- + +declare + foo integer; +begin + + acs_sc_binding.delete( + contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'GetPrettyName' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddApplet' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveApplet' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddAppletToCommunity' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveAppletFromCommunity' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddUser' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveUser' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddUserToCommunity' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemoveUserFromCommunity' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'AddPortlet' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'RemovePortlet' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research', + impl_operation_name => 'Clone' + ); + + acs_sc_impl.delete( + impl_contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_research' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/oracle/Attic/dotlrn-research-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- Creates the dotLRN research paper module +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: dotlrn-research-create.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +@@ dotlrn-research-applet-create.sql Index: openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/oracle/Attic/dotlrn-research-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/oracle/dotlrn-research-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- 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 2003/11/14 20:57:06 janines Exp $ +-- + +@@ dotlrn-research-applet-drop.sql Index: openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-applet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/postgresql/Attic/dotlrn-research-applet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-applet-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,142 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- 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 2003/11/14 20:57:06 janines Exp $ +-- +-- postgresql port adarsh@symphinity.com +-- +-- 11th July 2002 +-- + +select acs_sc_impl__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'dotlrn_research' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'GetPrettyName', + 'dotlrn_research::get_pretty_name', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddApplet', + 'dotlrn_research::add_applet', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveApplet', + 'dotlrn_research::remove_applet', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddAppletToCommunity', + 'dotlrn_research::add_applet_to_community', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveAppletFromCommunity', + 'dotlrn_research::remove_applet_from_community', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddUser', + 'dotlrn_research::add_user', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveUser', + 'dotlrn_research::remove_user', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddUserToCommunity', + 'dotlrn_research::add_user_to_community', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveUserFromCommunity', + 'dotlrn_research::remove_user_from_community', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddPortlet', + 'dotlrn_research::add_portlet', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemovePortlet', + 'dotlrn_research::remove_portlet', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'Clone', + 'dotlrn_research::clone', + 'TCL' +); + +select acs_sc_impl_alias__new ( + 'dotlrn_applet', + 'dotlrn_research', + 'ChangeEventHandler', + 'dotlrn_research::change_event_handler', + 'TCL' +); + +select acs_sc_binding__new ( + 'dotlrn_applet', + 'dotlrn_research' +); Index: openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-applet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/postgresql/Attic/dotlrn-research-applet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-applet-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,109 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- 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 2003/11/14 20:57:06 janines Exp $ +-- +-- postgresql port adarsh@symphinity.com +-- +-- 11th July 2002 +-- + +select acs_sc_binding__delete ( + 'dotlrn_applet', + 'dotlrn_research' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'GetPrettyName' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddApplet' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveApplet' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddAppletToCommunity' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveAppletFromCommunity' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddUser' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveUser' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddUserToCommunity' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemoveUserFromCommunity' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'AddPortlet' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'RemovePortlet' +); + +select acs_sc_impl_alias__delete ( + 'dotlrn_applet', + 'dotlrn_research', + 'Clone' +); + +select acs_sc_impl__delete ( + 'dotlrn_applet', + 'dotlrn_research' +); Index: openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/postgresql/Attic/dotlrn-research-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,29 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- Creates the dotLRN research paper module +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-02-24 +-- @version $Id: dotlrn-research-create.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- +-- postgresql port adarsh@symphinity.com +-- +-- 11th July 2002 +-- + +\i dotlrn-research-applet-create.sql Index: openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/sql/postgresql/Attic/dotlrn-research-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/sql/postgresql/dotlrn-research-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,29 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- 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 2003/11/14 20:57:06 janines Exp $ +-- +-- postgresql port adarsh@symphinity.com +-- +-- 11th July 2002 +-- + +\i dotlrn-research-applet-drop.sql Index: openacs-4/contrib/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/dotlrn-research/tcl/Attic/dotlrn-research-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,173 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +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 2003/11/14 20:57:06 janines Exp $ + +} + +namespace eval dotlrn_research { + + ad_proc -public applet_key { + } { + What's my applet key? + } { + return dotlrn_research + } + + ad_proc -public package_key { + } { + What package do I deal with? + } { + return dotlrn-research + } + + ad_proc -public get_pretty_name { + } { + returns the pretty name + } { + 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] \ + -package_key [package_key] + } + + ad_proc -public remove_applet { + } { + Used for one-time destroy - must be repeatable! + } { + ad_return_complaint 1 "[applet_key] remove_applet not implimented!" + } + + ad_proc -public add_applet_to_community { + community_id + } { + Add the research paper applet to a specifc dotlrn community + } { + set node_id [site_node::new \ + -name [research_paper::get_url] \ + -parent_id [site_node::get_node_id_from_object_id -object_id [dotlrn_community::get_package_id $community_id]] + ] + + set package_id [apm_package_id_from_key "research-papers"] + set admins [dotlrn_community::get_admin_rel_id -community_id $community_id] + permission::grant -party_id $admins -object_id $package_id -privilege admin + + site_node::mount \ + -node_id $node_id \ + -object_id $package_id + + set type [dotlrn_community::get_toplevel_community_type_from_community_id $community_id] + + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + add_portlet_helper $portal_id + set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] + + # Only add the admin portlet if it's a personal community + if {$type == "dotlrn_pers_community"} { + research_admin_portlet::add_self_to_page -portal_id $admin_portal_id + } + + research_admin_approval_portlet::add_self_to_page -portal_id $admin_portal_id + + } + + ad_proc -public remove_applet_from_community { + community_id + } { + remove the applet from the community + } { + ad_return_complaint 1 "[applet_key] remove_applet_from_community not implimented!" + } + + ad_proc -public add_user { + user_id + } { + # no-op + } + + ad_proc -public remove_user { + user_id + } { + # no-op + } + + ad_proc -public add_user_to_community { + community_id + user_id + } { + # no-op + } + + ad_proc -public remove_user_from_community { + community_id + user_id + } { + # no-op + } + + ad_proc -public add_portlet { + portal_id + } { + set type [dotlrn::get_type_from_portal_id -portal_id $portal_id] + + if {[string equal $type dotlrn_class_instance] || [string equal $type dotlrn_pers_community]} { + add_portlet_helper $portal_id + } + } + + ad_proc -public add_portlet_helper { + portal_id + } { + research_portlet::add_self_to_page -portal_id $portal_id + } + + ad_proc -public remove_portlet { + portal_id + } { + # no-op + } + + ad_proc -public clone { + old_community_id + new_community_id + } { + ns_log notice "Cloning: [applet_key]" + add_applet_to_community $new_community_id + } + + ad_proc -public change_event_handler { + community_id + event + old_value + new_value + } { + listens for the following events: + } { + } + +} Index: openacs-4/contrib/packages/personal-community/personal-community.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/personal-community.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/personal-community.info 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,51 @@ + + + + + Personal Community + Personal Communities + f + t + + + + oracle + postgresql + + yon@openforce.net + Code delivered to Sloan by OpenForce. A +s far as we know it is not finished, and certainly needs much updating. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,122 @@ + +-- +-- create personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date August 18th, 2002 +-- @version $Id: personal-community-create.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +@@ personal-community-init.sql + +create table dotlrn_pers_communities ( + community_id constraint dpc_community_id_fk + references dotlrn_communities_all (community_id), + user_id constraint dpc_user_id_fk + references users (user_id), + constraint dotlrn_pers_communities_pk + primary key (community_id, user_id) +); + +create view dotlrn_pers_communities_full +as + select dotlrn_communities.*, + dotlrn_pers_communities.user_id, + dotlrn_community.url(dotlrn_communities.community_id) as url, + groups.join_policy + from dotlrn_communities, + dotlrn_pers_communities, + groups + where dotlrn_communities.community_id = dotlrn_pers_communities.community_id + and dotlrn_communities.community_id = groups.group_id; + +create or replace package dotlrn_pers_community +is + + function new ( + community_id in dotlrn_pers_communities.community_id%TYPE default null, + user_id in dotlrn_pers_communities.user_id%TYPE, + community_key in dotlrn_communities_all.community_key%TYPE, + pretty_name in dotlrn_communities_all.pretty_name%TYPE, + description in dotlrn_communities_all.description%TYPE, + package_id in dotlrn_communities_all.package_id%TYPE default null, + portal_id in dotlrn_communities_all.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities_all.non_member_portal_id%TYPE default null, + join_policy in groups.join_policy%TYPE default null, + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return dotlrn_pers_communities.community_id%TYPE; + + procedure delete ( + community_id in dotlrn_pers_communities.community_id%TYPE + ); + +end; +/ +show errors + +create or replace package body dotlrn_pers_community +is + + function new ( + community_id in dotlrn_pers_communities.community_id%TYPE default null, + user_id in dotlrn_pers_communities.user_id%TYPE, + community_key in dotlrn_communities_all.community_key%TYPE, + pretty_name in dotlrn_communities_all.pretty_name%TYPE, + description in dotlrn_communities_all.description%TYPE, + package_id in dotlrn_communities_all.package_id%TYPE default null, + portal_id in dotlrn_communities_all.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities_all.non_member_portal_id%TYPE default null, + join_policy in groups.join_policy%TYPE default null, + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return dotlrn_pers_communities.community_id%TYPE + is + v_community_id integer; + begin + + v_community_id := dotlrn_community.new( + community_id => community_id, + community_type => 'dotlrn_pers_community', + community_key => community_key, + pretty_name => pretty_name, + description => description, + package_id => package_id, + portal_id => portal_id, + non_member_portal_id => non_member_portal_id, + join_policy => join_policy, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert + into dotlrn_pers_communities + (community_id, user_id) + values + (v_community_id, user_id); + + return v_community_id; + + end; + + procedure delete ( + community_id in dotlrn_pers_communities.community_id%TYPE + ) + is + begin + delete + from dotlrn_pers_communities + where community_id = dotlrn_pers_community.delete.community_id; + + dotlrn_community.delete(community_id => community_id); + end; + +end; +/ +show errors Index: openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,16 @@ + +-- +-- drop personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date August 18th, 2002 +-- @version $Id: personal-community-drop.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +drop package body dotlrn_pers_community; +drop package dotlrn_pers_community; + +drop view dotlrn_pers_communities_full; +drop table dotlrn_pers_communities; + +@@ personal-community-sanitize.sql Index: openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-init.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,30 @@ + +-- +-- initialize personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-08-25 +-- @version $Id: personal-community-init.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- +-- + +declare + foo dotlrn_community_types.community_type%TYPE; +begin + + foo := dotlrn_community_type.new( + community_type => 'dotlrn_pers_community', + parent_type => 'dotlrn_community', + pretty_name => 'Personal Community', + pretty_plural => 'Personal Communities', + description => 'e.g. Hal Abelson Community' + ); + + update acs_object_types + set table_name = 'dotlrn_pers_communities', + package_name = 'dotlrn_pers_community' + where object_type = 'dotlrn_pers_community'; + +end; +/ +show errors Index: openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-sanitize.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/oracle/personal-community-sanitize.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,18 @@ +-- +-- sanitize personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-08-25 +-- @version $Id: personal-community-sanitize.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +declare +begin + + dotlrn_community_type.delete( + community_type => 'dotlrn_pers_community' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,97 @@ + +-- +-- create personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date August 18th, 2002 +-- @version $Id: personal-community-create.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +\i personal-community-init.sql + +create table dotlrn_pers_communities ( + community_id integer + constraint dpc_community_id_fk + references dotlrn_communities_all (community_id), + user_id integer + constraint dpc_user_id_fk + references users (user_id), + constraint dotlrn_pers_communities_pk + primary key (community_id, user_id) +); + +create view dotlrn_pers_communities_full +as + select dotlrn_communities.*, + dotlrn_pers_communities.user_id, + dotlrn_community__url(dotlrn_communities.community_id::integer) as url, + groups.join_policy + from dotlrn_communities, + dotlrn_pers_communities, + groups + where dotlrn_communities.community_id = dotlrn_pers_communities.community_id + and dotlrn_communities.community_id = groups.group_id; + +select define_function_args('dotlrn_pers_community__new','community_id,user_id,community_key,pretty_name,description,package_id,portal_id,non_member_portal_id,join_policy,creation_date,creation_user,creation_ip,context_id'); + +create function dotlrn_pers_community__new (integer,integer,varchar,varchar,varchar,integer,integer,integer,varchar,timestamp,integer,varchar,integer) +returns integer as ' +declare + p_community_id alias for $1; + p_user_id alias for $2; + p_community_key alias for $3; + p_pretty_name alias for $4; + p_description alias for $5; + p_package_id alias for $6; + p_portal_id alias for $7; + p_non_member_portal_id alias for $8; + p_join_policy alias for $9; + p_creation_date alias for $10; + p_creation_user alias for $11; + p_creation_ip alias for $12; + p_context_id alias for $13; + v_community_id integer; +begin + v_community_id := dotlrn_community__new( + p_community_id, + null, + ''dotlrn_pers_community'', + p_community_key, + p_pretty_name, + p_description, + ''f'', + p_portal_id, + p_non_member_portal_id, + p_package_id, + p_join_policy, + p_creation_date, + p_creation_user, + p_creation_ip, + p_context_id + ); + + insert + into dotlrn_pers_communities + (community_id, user_id) + values + (v_community_id, p_user_id); + + return v_community_id; +end; +' language 'plpgsql'; + +select define_function_args('dotlrn_pers_community__delete','community_id'); + +create function dotlrn_pers_community__delete (integer) +returns integer as ' +declare + p_community_id alias for $1; +begin + delete + from dotlrn_pers_communities + where community_id = p_community_id; + + perform dotlrn_community__delete(p_community_id); + return(0); +end; +' language 'plpgsql'; Index: openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,15 @@ + +-- +-- drop personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date August 18th, 2002 +-- @version $Id: personal-community-drop.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +select drop_package('dotlrn_pers_community'); + +drop view dotlrn_pers_communities_full; +drop table dotlrn_pers_communities; + +\i personal-community-sanitize.sql Index: openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-init.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,34 @@ + +-- +-- initialize personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-08-25 +-- @version $Id: personal-community-init.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- +-- + +create function inline_0() +returns integer as ' +begin + + perform dotlrn_community_type__new( + ''dotlrn_pers_community'', + ''dotlrn_community'', + ''personal Community'', + ''personal Communities'', + ''e.g. Hal Abelson Community'' + ); + + update acs_object_types + set table_name = ''dotlrn_pers_communities'', + package_name = ''dotlrn_pers_community'' + where object_type = ''dotlrn_pers_community''; + + return 0; + +end;' language 'plpgsql'; + +select inline_0(); + +drop function inline_0(); Index: openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-sanitize.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/sql/postgresql/personal-community-sanitize.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,23 @@ +-- +-- sanitize personal communities +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-08-25 +-- @version $Id: personal-community-sanitize.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +create function inline_0() +returns integer as ' +begin + + perform dotlrn_community_type__delete( + ''dotlrn_pers_community'' + ); + + return 0; + +end;' language 'plpgsql'; + +select inline_0(); + +drop function inline_0(); Index: openacs-4/contrib/packages/personal-community/tcl/personal-community-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/tcl/personal-community-init.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/tcl/personal-community-init.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,17 @@ +ad_library { + + initialize personal communities + + @author yon (yon@openforce.net) + @creation-date 2002-08-18 + @version $Id: personal-community-init.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} + +if {[dotlrn::is_instantiated]} { + + if {![dotlrn_pers_community::is_initialized]} { dotlrn_pers_community::init } + + dotlrn_applet::applet_call dotlrn_research AddApplet [list] + +} Index: openacs-4/contrib/packages/personal-community/tcl/personal-community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/tcl/personal-community-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/tcl/personal-community-procs.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,250 @@ +ad_library { + + procs to manage dotlrn personal communities + + @author yon@openforce.net + @creation-date 2002-08-23 + @version $Id: personal-community-procs.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} + +namespace eval dotlrn_pers_community { + + ad_proc -public community_type {} { + return the community type + } { + return dotlrn_pers_community + } + + ad_proc -public get_url_part {} { + return the url part for this community type + } { + return "personal-community" + } + + ad_proc -public get_url {} { + return the url part for this community type + } { + return "/[get_url_part]" + } + + ad_proc -public is_initialized {} { + is dotlrn_class initialized with the right community_type? + } { + dotlrn_community::is_initialized -community_type [community_type] + } + + ad_proc -public init {} { + create base community_type for dotlrn_pers_communities + } { + db_transaction { + new_type_portal -pretty_name "Personal Communities" + + set package_id [dotlrn::mount_package \ + -package_key [get_url_part] \ + -url [get_url_part] \ + -pretty_name "Personal Communities" \ + -directory_p t \ + ] + + dotlrn_community::set_type_package_id \ + -community_type [community_type] \ + -package_id $package_id + } + } + + ad_proc -public new_type_portal { + {-pretty_name:required} + } { + (copied from dotlrn::new_type_portal) + } { + + set csv_list {Home,Simple 2-Column;My Files,Simple 1-Column} + set user_id -1 + + set portal_id [portal::create \ + -name "$pretty_name Portal" \ + -csv_list $csv_list \ + $user_id + ] + + # Associate this type with portal_id, must be before applet + # callbacks, since they use this info + dotlrn::set_type_portal_id \ + -type [community_type] \ + -portal_id $portal_id + + # Add the default applets + set default_applets_list {dotlrn_dotlrn dotlrn_forums dotlrn_research} + + foreach applet_key $default_applets_list { + if {[dotlrn_applet::applet_exists_p -applet_key $applet_key]} { + dotlrn_community::applet_call $applet_key AddPortlet [list $portal_id] + } + } + + set args [ns_set create] + ns_set put $args package_id 0 + ns_set put $args folder_id 0 + ns_set put $args param_action overwrite + ns_set put $args page_name {My Files} + + dotlrn_fs::add_portlet_helper $portal_id $args + + } + + ad_proc -public new { + {-user_id:required} + {-pretty_name:required} + {-description ""} + {-join_policy closed} + {-parent_community_id ""} + } { + creates a new personal community and returns the community key + (mostly copied from dotlrn_community::new) + } { + set community_key [dotlrn::generate_key -name $pretty_name] + + dotlrn_community::check_community_key_valid_p \ + -complain_if_invalid \ + -community_key $community_key \ + -parent_community_id $parent_community_id + + set package_id [dotlrn::get_package_id] + + set extra_vars [ns_set create] + ns_set put $extra_vars parent_community_id $parent_community_id + ns_set put $extra_vars community_type [community_type] + ns_set put $extra_vars community_key $community_key + ns_set put $extra_vars pretty_name $pretty_name + ns_set put $extra_vars pretty_plural $pretty_name + ns_set put $extra_vars description $description + ns_set put $extra_vars context_id $package_id + ns_set put $extra_vars join_policy $join_policy + ns_set put $extra_vars user_id $user_id + + db_transaction { + + set community_id [package_instantiate_object -extra_vars $extra_vars [community_type]] + + # YON MAJOR HACK + # acs_object.new() initializes the acs_attributes for us if the + # object_type of this community matches the object_type of the + # acs_attributes. this fucks us because we use dotlrn_community + # as the object_type for subgroups which means that their + # attributes will be defaulted to empty strings but we will think + # that they are set. we must delete them. + db_dml delete_acs_attribute_values { + delete + from acs_attribute_values + where object_id = :community_id + } + + set template_id [dotlrn::get_portal_id_from_type -type [community_type]] + + # Create comm's portal page + set portal_id [portal::create \ + -template_id $template_id \ + -name "$pretty_name Portal" \ + -context_id $community_id \ + $user_id \ + ] + + # Create the comm's non-member page + set non_member_portal_id [portal::create \ + -name "$pretty_name Non-Member Portal" \ + -default_page_name [dotlrn::parameter -name non_member_page_name] \ + -context_id $community_id \ + $user_id \ + ] + + # Create the comm's admin page + set admin_portal_id [portal::create \ + -name "$pretty_name Administration Portal" \ + -default_page_name [dotlrn::parameter -name admin_page_name] \ + -context_id $community_id \ + $user_id \ + ] + + # Set up the rel segments + dotlrn_community::create_rel_segments -community_id $community_id + + # Set up the node + if {[empty_string_p $parent_community_id]} { + set parent_node_id [dotlrn_community::get_type_node_id [community_type]] + } else { + set parent_node_id [dotlrn_community::get_community_node_id $parent_community_id] + } + + set package_id [site_node_apm_integration::new_site_node_and_package \ + -name $community_key \ + -parent_id $parent_node_id \ + -package_key [dotlrn_community::one_community_package_key] \ + -instance_name $pretty_name \ + -context_id $community_id \ + ] + + # Set the right parameters + ad_parameter -package_id $package_id -set 0 dotlrn_level_p + ad_parameter -package_id $package_id -set 0 community_type_level_p + ad_parameter -package_id $package_id -set 1 community_level_p + + # Set up the node + dotlrn_community::set_package_id $community_id $package_id + + # update the portal_id and non_member_portal_id + db_dml dbqd.dotlrn.tcl.community-procs.dotlrn_community::new.update_portal_ids {} + + # add the default applets based on the community type + # 2. the the list of default applets for this type + set default_applets_list {dotlrn_dotlrn dotlrn_forums dotlrn_research} + + foreach applet_key $default_applets_list { + if {[dotlrn_applet::applet_exists_p -applet_key $applet_key]} { + dotlrn_community::add_applet_to_community $community_id $applet_key + } + } + + set args [ns_set create] + ns_set put $args package_id 0 + ns_set put $args folder_id [dotlrn_fs::get_user_root_folder -user_id $user_id] + ns_set put $args param_action overwrite + ns_set put $args page_name {My Files} + + dotlrn_fs::add_portlet_helper $portal_id $args + + add_user -rel_type dotlrn_admin_rel -community_id $community_id -user_id $user_id + + } + + # This new community should _not_ inherit it's permissions + # from the root dotlrn instance. Why? All dotlrn users + # can read the root dotlrn instance, but only members of + # this community should be able to read this instance (and + # it's children) + permission::set_not_inherit -object_id $community_id + + return $community_id + + } + + ad_proc -public add_user { + {-rel_type ""} + {-community_id:required} + {-user_id:required} + {-member_state approved} + } { + assigns a user to a particular role in the personal's community. + } { + if [empty_string_p $rel_type] { + set rel_type dotlrn_member_rel + } + + dotlrn_community::add_user_to_community \ + -rel_type $rel_type \ + -community_id $community_id \ + -user_id $user_id \ + -member_state $member_state + } + +} Index: openacs-4/contrib/packages/personal-community/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/index.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,27 @@ + +Persons Without Communities +foo + + Index: openacs-4/contrib/packages/personal-community/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/index.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + + @author yon@openforce.net + @creation-date 2002-08-28 + @version $Id: index.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} + +db_multirow persons select_persons_without_communities {} + +ad_return_template Index: openacs-4/contrib/packages/personal-community/www/admin/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/index.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/index.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,14 @@ + + + + + + + select dotlrn_users.* + from dotlrn_users + where dotlrn_users.user_id not in (select user_id + from dotlrn_pers_communities) + + + + Index: openacs-4/contrib/packages/personal-community/www/admin/personal-communities.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-communities.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-communities.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,50 @@ + +@title@ +@context_bar@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Person's Community NameDescriptionMembersActions
@communities.pretty_name@@communities.description@@communities.n_members@ + + + [ Administer ] + + +
+ No Personal Communities +
+ +
Index: openacs-4/contrib/packages/personal-community/www/admin/personal-communities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-communities.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-communities.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + + displays personal communities admin page + + @author yon (yon@openforce.net) + @creation-date 2002-08-23 + @version $Id: personal-communities.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} -query { +} -properties { + title:onevalue + context_bar:onevalue + communities:multirow +} + +set title "Personal Communities" +set context_bar [list $title] + +db_multirow communities select_communities {} { + set description [ad_quotehtml $description] +} + +ad_return_template Index: openacs-4/contrib/packages/personal-community/www/admin/personal-communities.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-communities.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-communities.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select dotlrn_pers_communities_full.*, + (select count(*) + from dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = dotlrn_pers_communities_full.community_id) as n_members + from dotlrn_pers_communities_full + order by dotlrn_pers_communities_full.pretty_name, + dotlrn_pers_communities_full.description + + + + Index: openacs-4/contrib/packages/personal-community/www/admin/personal-community-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-community-new.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-community-new.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,5 @@ + +@title@ +@context_bar@ + + Index: openacs-4/contrib/packages/personal-community/www/admin/personal-community-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-community-new.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-community-new.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,72 @@ +ad_page_contract { + + create a new personal community - input form + + @author yon (yon@openforce.net) + @creation-date 2002-08-23 + @version $Id: personal-community-new.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} -query { + {user_id:integer,notnull} + {referer "personal-communities"} +} -properties { + title:onevalue + context_bar:onevalue +} + +oacs::user::get -user_id $user_id -array user + +form create add_community + +element create add_community user_id \ + -label "User ID" \ + -datatype text \ + -widget hidden \ + -value $user_id + +element create add_community pretty_name \ + -label "Name" \ + -datatype text \ + -widget text \ + -html {size 60 maxlength 100} \ + -value "$user(first_names) $user(last_name)'s Community" + +element create add_community description \ + -label "Description" \ + -datatype text \ + -widget textarea \ + -html {rows 5 cols 60 wrap soft} \ + -optional + +element create add_community join_policy \ + -label "Join Policy" \ + -datatype text \ + -widget select \ + -options {{Open open} {"Needs Approval" "needs approval"} {Closed closed}} \ + -value closed + +element create add_community referer \ + -label "Referer" \ + -datatype text \ + -widget hidden \ + -value $referer + +if {[form is_valid add_community]} { + form get_values add_community \ + pretty_name description join_policy referer + + set key [dotlrn_pers_community::new \ + -user_id $user_id \ + -description $description \ + -pretty_name $pretty_name \ + -join_policy $join_policy \ + ] + + ad_returnredirect $referer + ad_script_abort +} + +set title "New Personal Community" +set context_bar [list [list "personal-communities" "Personal Communities"] $title] + +ad_return_template Index: openacs-4/contrib/packages/personal-community/www/admin/personal-community-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-community-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-community-oracle.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,16 @@ + + + + oracle8.1.6 + + + + select dotlrn_communities.pretty_name, + dotlrn_communities.description, + dotlrn_community.url(:community_id) as url + from dotlrn_communities + where dotlrn_communities.community_id = :community_id + + + + Index: openacs-4/contrib/packages/personal-community/www/admin/personal-community-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-community-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-community-postgresql.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,16 @@ + + + + postgresql7.1 + + + + select dotlrn_communities.pretty_name, + dotlrn_communities.description, + dotlrn_community__url(:community_id) as url + from dotlrn_communities + where dotlrn_communities.community_id = :community_id + + + + Index: openacs-4/contrib/packages/personal-community/www/admin/personal-community.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-community.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-community.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,5 @@ + +@pretty_name@ +@context_bar@ + +@pretty_name@ -
@description@
Index: openacs-4/contrib/packages/personal-community/www/admin/personal-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/personal-community/www/admin/personal-community.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/personal-community/www/admin/personal-community.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,25 @@ +ad_page_contract { + + displays single person's community page + + @author yon (yon@openforce.net) + @creation-date 2001-12-03 + @version $Id: personal-community.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} -query { + community_id:naturalnum,notnull +} -errors { + community_id:naturalnum,notnull {must provide a valid community_id} +} -properties { + context_bar:onevalue + pretty_name:onevalue + description:onevalue +} + +db_1row select_community {} + +set description [ad_quotehtml $description] + +set context_bar [list [list "personal-communities" "Personal Communities"] $pretty_name] + +ad_return_template Index: openacs-4/contrib/packages/research-papers/research-papers.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/research-papers.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/research-papers.info 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,80 @@ + + + + + Research Papers + Research Papers + f + t + + + + oracle + postgresql + + yon + Code delivered to Sloan by OpenForce. A +s far as we know it is not finished, and certainly needs much updating. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,65 @@ + +-- +-- create research paper model +-- +-- @author yon@openforce.net +-- @creation-date 2002-08-19 +-- @version $Id: research-papers-create.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +create table research_papers ( + paper_id integer + constraint research_papers_paper_id_fk + references acs_objects (object_id) + constraint research_papers_pk + primary key, + author_id integer + constraint research_papers_author_id_fk + references users(user_id), + -- there is either a revision or a URL + revision_id integer + constraint research_papers_revision_id_fk + references cr_revisions (revision_id), + paper_url varchar(500), + title varchar(4000) + constraint research_papers_title_nn + not null, + abstract varchar(4000), + publication_date date, + last_updated date, + type varchar(200), + subject varchar(1000), + identifier varchar(500), + source varchar(500), + lang char(2), + rights varchar(4000), + license_url varchar(300), + public_p char(1) + default 'f' + constraint research_papers_public_p_ck + check (public_p in ('t', 'f')) + constraint research_papers_public_p_nn + not null +); + +declare +begin + + acs_object_type.create_type( + object_type => 'research_paper', + pretty_name => 'Research Paper', + pretty_plural => 'Research Papers', + supertype => 'acs_object', + table_name => 'research_papers', + id_column => 'paper_id', + package_name => 'research_paper', + name_method => 'research_paper.name' + ); + +end; +/ +show errors + +@@ research-papers-package-create.sql; +@@ research-papers-notif-create.sql; + Index: openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,23 @@ + +-- +-- drop research paper model +-- +-- @author yon@openforce.net +-- @creation-date 2002-08-19 +-- @version $Id: research-papers-drop.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +@@ research-papers-package-drop.sql; + +declare +begin + + acs_object_type.drop_type( + object_type => 'research_paper' + ); + +end; +/ +show errors + +drop table research_papers; Index: openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-notif-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-notif-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-notif-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,67 @@ + +-- +-- The Research Paper Package +-- +-- @author ben@openforce +-- @creation-date 2002-11-03 +-- +-- + +-- the integration with Notifications + +declare + impl_id integer; + v_foo integer; +begin + -- the notification type impl + impl_id := acs_sc_impl.new ( + 'NotificationType', + 'research_author_notif_type', + 'research_papers' + ); + + v_foo := acs_sc_impl.new_alias ( + 'NotificationType', + 'research_author_notif_type', + 'GetURL', + 'research_paper::notification::get_url', + 'TCL' + ); + + v_foo := acs_sc_impl.new_alias ( + 'NotificationType', + 'research_author_notif_type', + 'ProcessReply', + 'research_paper::notification::process_reply', + 'TCL' + ); + + acs_sc_binding.new ( + contract_name => 'NotificationType', + impl_name => 'research_author_notif_type' + ); + + v_foo:= notification_type.new ( + short_name => 'research_author_notif', + sc_impl_id => impl_id, + pretty_name => 'Research Author Notification', + description => 'Notifications for Research Authors', + creation_user => NULL, + creation_ip => NULL + ); + + -- enable the various intervals and delivery methods + insert into notification_types_intervals + (type_id, interval_id) + select v_foo, interval_id + from notification_intervals where name in ('instant','hourly','daily'); + + insert into notification_types_del_methods + (type_id, delivery_method_id) + select v_foo, delivery_method_id + from notification_delivery_methods where short_name in ('email'); + + +end; +/ +show errors Index: openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-package-create.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,126 @@ + +-- +-- create research paper package +-- +-- @author yon@openforce.net +-- @creation-date 2002-08-19 +-- @version $Id: research-papers-package-create.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +create or replace package research_paper +as + + function new ( + paper_id in research_papers.paper_id%TYPE default null, + author_id in research_papers.author_id%TYPE, + revision_id in research_papers.revision_id%TYPE default null, + paper_url in research_papers.paper_url%TYPE default null, + title in research_papers.title%TYPE, + abstract in research_papers.abstract%TYPE default null, + publication_date in research_papers.publication_date%TYPE default null, + type in research_papers.type%TYPE default null, + subject in research_papers.subject%TYPE default null, + identifier in research_papers.identifier%TYPE default null, + source in research_papers.source%TYPE default null, + lang in research_papers.lang%TYPE default null, + rights in research_papers.rights%TYPE default null, + license_url in research_papers.license_url%TYPE default null, + public_p in research_papers.public_p%TYPE default 'f', + object_type in acs_objects.object_type%TYPE default 'research_paper', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return research_papers.paper_id%TYPE; + + procedure delete ( + paper_id in research_papers.paper_id%TYPE + ); + + function name ( + paper_id in research_papers.paper_id%TYPE + ) return varchar; + +end research_paper; +/ +show errors + +create or replace package body research_paper +as + + function new ( + paper_id in research_papers.paper_id%TYPE default null, + author_id in research_papers.author_id%TYPE, + revision_id in research_papers.revision_id%TYPE default null, + paper_url in research_papers.paper_url%TYPE default null, + title in research_papers.title%TYPE, + abstract in research_papers.abstract%TYPE default null, + publication_date in research_papers.publication_date%TYPE default null, + type in research_papers.type%TYPE default null, + subject in research_papers.subject%TYPE default null, + identifier in research_papers.identifier%TYPE default null, + source in research_papers.source%TYPE default null, + lang in research_papers.lang%TYPE default null, + rights in research_papers.rights%TYPE default null, + license_url in research_papers.license_url%TYPE default null, + public_p in research_papers.public_p%TYPE default 'f', + object_type in acs_objects.object_type%TYPE default 'research_paper', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return research_papers.paper_id%TYPE + is + v_paper_id research_papers.paper_id%TYPE; + begin + + v_paper_id := acs_object.new( + object_id => new.paper_id, + object_type => new.object_type, + creation_date => new.creation_date, + creation_user => new.creation_user, + creation_ip => new.creation_ip, + context_id => new.context_id + ); + + insert + into research_papers + (paper_id, author_id, revision_id, paper_url, title, abstract, publication_date, last_updated, + type, subject, identifier, source, lang, rights, license_url, public_p) + values + (v_paper_id, new.author_id, new.revision_id, new.paper_url, new.title, new.abstract, new.publication_date, sysdate, + new.type, new.subject, new.identifier, new.source, new.lang, new.rights, new.license_url, new.public_p); + + return v_paper_id; + + end new; + + procedure delete ( + paper_id in research_papers.paper_id%TYPE + ) + is + begin + + acs_object.delete(research_paper.delete.paper_id); + + end; + + function name ( + paper_id in research_papers.paper_id%TYPE + ) return varchar + is + v_title research_papers.title%TYPE; + begin + + select title + into v_title + from research_papers + where research_papers.paper_id = name.paper_id; + + return v_title; + + end; + +end research_paper; +/ +show errors Index: openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/sql/oracle/research-papers-package-drop.sql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,11 @@ + +-- +-- drop research paper package +-- +-- @author yon@openforce.net +-- @creation-date 2002-08-19 +-- @version $Id: research-papers-package-drop.sql,v 1.1 2003/11/14 20:57:06 janines Exp $ +-- + +drop package body research_paper; +drop package research_paper; Index: openacs-4/contrib/packages/research-papers/tcl/extra-date-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/tcl/extra-date-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/tcl/extra-date-procs.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,76 @@ + +# +# extra stuff for now +# (ben) +# + +namespace eval research_paper { + + ad_proc -public from_sql_datetime { + {-sql_date:required} + {-format:required} + } { + + if {[empty_string_p $sql_date]} { + return "" + } + + set date [template::util::date::create] + + switch -exact -- $format { + {YYYY-MM-DD} { + regexp {([0-9]*)-([0-9]*)-([0-9]*)} $sql_date all year month day + + set date [template::util::date::set_property format $date {DD MONTH YYYY}] + set date [template::util::date::set_property year $date $year] + set date [template::util::date::set_property month $date $month] + set date [template::util::date::set_property day $date $day] + } + + {HH12:MIam} { + regexp {([0-9]*):([0-9]*) *([aApP][mM])} $sql_date all hours minutes ampm + + set date [template::util::date::set_property format $date {HH12:MI am}] + set date [template::util::date::set_property hours $date $hours] + set date [template::util::date::set_property minutes $date $minutes] + set date [template::util::date::set_property ampm $date [string tolower $ampm]] + } + + {HH24:MI} { + regexp {([0-9]*):([0-9]*)} $sql_date all hours minutes + + set date [template::util::date::set_property format $date {HH24:MI}] + set date [template::util::date::set_property hours $date $hours] + set date [template::util::date::set_property minutes $date $minutes] + } + + {HH24} { + set date [template::util::date::set_property format $date {HH24:MI}] + set date [template::util::date::set_property hours $date $sql_date] + set date [template::util::date::set_property minutes $date 0] + } + } + + return $date + + } + + ad_proc -public to_sql_date { + {-date:required} + } { + This takes two date chunks, one for date one for time, + and combines them correctly. + + The issue here is the incoming format. + date: ANSI SQL YYYY-MM-DD + time: we return HH24. + } { + set year [template::util::date::get_property year $date] + set month [template::util::date::get_property month $date] + set day [template::util::date::get_property day $date] + + # put together the timestamp + return "$year-$month-$day" + } + +} Index: openacs-4/contrib/packages/research-papers/tcl/research-papers-notification-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/tcl/research-papers-notification-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/tcl/research-papers-notification-procs.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,31 @@ +ad_library { + + Research Papers - Notification Handling + + @creation-date 2002-11-03 + @author Ben Adida + @cvs-id $Id: research-papers-notification-procs.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} + +namespace eval research_paper::notification { + + ad_proc -public get_url { + object_id + } { + # The URL for one author + set url "[research_paper::get_url]/author/${object_id}" + + return $url + } + + ad_proc -public process_reply { + reply_id + } { + # do nothing, no reply processing + } + +} + + + Index: openacs-4/contrib/packages/research-papers/tcl/research-papers-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/tcl/research-papers-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/tcl/research-papers-procs.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,126 @@ +ad_library { + + @author yon@openforce.net + @creation-date 2002-08-29 + @version $Id: research-papers-procs.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} + +namespace eval research_paper { + + ad_proc -public new { + {-revision_id ""} + {-title:required} + {-author_id:required} + {-paper_url ""} + {-abstract ""} + {-publication_date ""} + {-type ""} + {-subject ""} + {-identifier ""} + {-source ""} + {-lang ""} + {-rights ""} + {-license_url ""} + {-public_p f} + } { + create a new research paper + } { + set extra_vars [ns_set create] + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {revision_id author_id title abstract publication_date type subject identifier source lang rights license_url public_p} + + db_transaction { + set paper_id [package_instantiate_object -extra_vars $extra_vars research_paper] + + if {$public_p == "t"} { + notify_paper -paper_id $paper_id + } + } + + return $paper_id + } + + ad_proc -public get { + {-paper_id:required} + {-array:required} + } { + get a research paper's meta data + } { + upvar $array row + db_1row select_research_paper {} -column_array row + } + + ad_proc -public edit { + {-paper_id:required} + {-revision_id:required} + {-title:required} + {-paper_url ""} + {-abstract ""} + {-publication_date ""} + {-type ""} + {-subject ""} + {-identifier ""} + {-source ""} + {-lang ""} + {-rights ""} + {-license_url ""} + {-public_p f} + } { + edit a research paper's meta data + } { + db_transaction { + db_dml update_research_paper {} + + if {$public_p == "t"} { + notify_paper -paper_id $paper_id + } + } + } + + ad_proc -public set_public_p { + {-paper_id:required} + {-public_p:required} + } { + set the public aspect of the paper + } { + db_transaction { + db_dml update_public_p {} + + if {$public_p == "t"} { + notify_paper -paper_id $paper_id + } + } + } + + ad_proc -public get_url {} { + get the url for this package + } { + return knowledge + } + + ad_proc -private notify_paper { + {-paper_id:required} + } { + # Select information about the paper + research_paper::get -paper_id $paper_id -array paper + + set author_id $paper(author_id) + + # Select information about the author + oacs::user::get -user_id $author_id -array paper_author + + # Prepare the content + set subject "New paper \"$paper(title)\" by $paper_author(first_names) $paper_author(last_name)" + set text "$paper_author(first_names) $paper_author(last_name) ($paper_author(email)) has published a new paper entitled $paper(title)." + + ns_log Notice "BENHACK: about to create the notification" + + # Create the notification for authors + notification::new \ + -type_id [notification::type::get_type_id -short_name research_author_notif_type] \ + -object_id $paper(author_id) \ + -notif_subject $subject \ + -notif_text $text + } + +} Index: openacs-4/contrib/packages/research-papers/tcl/research-papers-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/tcl/research-papers-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/tcl/research-papers-procs.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,42 @@ + + + + + + + select * + from research_papers + where paper_id = :paper_id + + + + + + update research_papers + set revision_id = :revision_id, + title = :title, + abstract = :abstract, + paper_url = :paper_url, + publication_date = :publication_date, + last_updated = sysdate, + type = :type, + subject = :subject, + identifier = :identifier, + source = :source, + lang = :lang, + rights = :rights, + license_url = :license_url, + public_p = :public_p + where paper_id = :paper_id + + + + + + update research_papers + set public_p = :public_p + where paper_id = :paper_id + + + + Index: openacs-4/contrib/packages/research-papers/www/authors.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/authors.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/authors.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,59 @@ + +Authors + +

Authors

+
+ + + + + +
+ [ publications | authors ] + +
+ Search:  +
+
+
+ + + +
+ + + + + + + +
Author# of PapersLatest Publication
+ + + + + + + + + + + + + + + + + + +
@authors.last_name@, @authors.first_names@@authors.n_papers@<%= [util_AnsiDatetoPrettyDate $authors(last_publication_date)] %>
+ +
+ + +
+ +
+ + No Research Papers + Index: openacs-4/contrib/packages/research-papers/www/authors.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/authors.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/authors.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,12 @@ + +ad_page_contract { + @author ben@openforce.net + @creation-date 2002-11-10 + @version $Id: authors.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ +} { +} + +# Select authors who have papers +db_multirow authors select_authors {} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/authors.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/authors.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/authors.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + + select author_id, first_names, last_name, + count(paper_id) as n_papers, + max(publication_date) as last_publication_date + from persons, research_papers + where persons.person_id = research_papers.author_id + and public_p = 't' + group by author_id, first_names, last_name + order by last_name, first_names + + + + Index: openacs-4/contrib/packages/research-papers/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/index.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,82 @@ + +Research Papers + +

Publications

+
+ + + + + +
+ [ publications | authors ] + + + Search:  + +
+
+ + + +
+ + + + + + + + +
TitleAuthorPublication Date 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
@papers.title@@papers.last_name@, @papers.first_names@<%= [util_AnsiDatetoPrettyDate $papers(publication_date)] %> + + [ + + + edit | + + download + remote location + + + ] + +
@papers.abstract@
+ +
+ + +
+ +
+ + No Research Papers + Index: openacs-4/contrib/packages/research-papers/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/index.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,40 @@ +ad_page_contract { + + @author yon@openforce.net + @creation-date 2002-08-29 + @version $Id: index.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} -properties { + folder_id:onevalue + return_url:onevalue + admin_p:onevalue + papers:multirow +} + +set user_id [ad_conn user_id] +set folder_id [dotlrn_fs::get_user_root_folder -user_id $user_id] +set return_url [ad_conn url] +set admin_p [permission::permission_p \ + -object_id [ad_conn package_id] \ + -party_id $user_id \ + -privilege admin \ +] + +form create papers_search + +element create papers_search search_text \ + -label Search \ + -datatype text \ + -widget text \ + -html {size 60} \ + -optional + +if {[form is_valid papers_search]} { + form get_values papers_search search_text + + ad_returnredirect "search?[export_vars {search_text}]" +} + +db_multirow papers select_papers {} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/index.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/index.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + + select research_papers.*, + persons.first_names, + persons.last_name + from research_papers, + persons + where research_papers.author_id = persons.person_id + and research_papers.public_p = 't' + order by research_papers.title + + + + Index: openacs-4/contrib/packages/research-papers/www/one-author.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/one-author.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/one-author.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,79 @@ + +Research Papers for @author.full_name@ + +

Papers Authored By @author.full_name@

+ +

+@notification_chunk@ +

+ +
+ + + + +
+

+[ publications | authors ] +

+
+
+ + + +
+ + + + + + + +
TitlePublication Date 
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
@papers.title@<%= [util_AnsiDatetoPrettyDate $papers(publication_date)] %> + + [ + + download + remote location + + + ] + +
@papers.abstract@
+ +
+ + +
+ +
+ + No Research Papers + Index: openacs-4/contrib/packages/research-papers/www/one-author.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/Attic/one-author.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/one-author.adp~ 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,77 @@ + +Research Papers for @author.full_name@ + +

Papers Authored By @author.full_name@

+ +

+@notification_chunk@ +

+ +
+ + + + +
+

+[ publications | authors ] +

+
+
+ + + +
+ + + + + + + +
TitlePublication Date 
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
@papers.title@<%= [util_AnsiDatetoPrettyDate $papers(publication_date)] %> + + [ + + download + + ] + +
@papers.abstract@
+ +
+ + +
+ +
+ + No Research Papers + Index: openacs-4/contrib/packages/research-papers/www/one-author.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/one-author.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/one-author.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,25 @@ + +ad_page_contract { + @author ben@openforce.net + @creation-date 2002-11-10 + @version $Id: one-author.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ +} { + author_id:integer,notnull +} + +# Select the author's papers +db_multirow papers select_papers {} + +# Select information about the author +oacs::user::get -user_id $author_id -array author + +# Notification stuff +set notification_chunk [notification::display::request_widget \ + -type research_author_notif \ + -object_id $author_id \ + -pretty_name "Publications by $author(full_name)" \ + -url [ad_conn url]?author_id=$author_id \ +] + + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/one-author.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/one-author.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/one-author.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + + select research_papers.* + from research_papers + where author_id = :author_id + and public_p = 't' + order by publication_date desc + + + + Index: openacs-4/contrib/packages/research-papers/www/one-paper.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/one-paper.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/one-paper.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,123 @@ + +Research Papers: @paper.title@ + +
+ + + + +
+

+[ publications | authors ] +

+
+
+ +

One Publication: @paper.title@

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Title + +@paper.title@ +
+Author + +@author.last_name@, @author.first_names@ +
+Abstract + +@paper.abstract@ +
+Publication Date + +<%= [util_AnsiDatetoPrettyDate $paper(publication_date)] %> +
+Type + +@paper.type@ +
+Subject + +@paper.subject@ +
+Identifier + +@paper.identifier@ +
+Source + +@paper.source@ +
+Rights + +@paper.rights@ +
+Download + +download +
+Location + +@paper.paper_url@ +
+Last Modified + +<%= [util_AnsiDatetoPrettyDate $paper(last_updated)] %> +
+ Index: openacs-4/contrib/packages/research-papers/www/one-paper.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/one-paper.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/one-paper.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,21 @@ + +ad_page_contract { + One Paper + + @author ben@openforce.net + @creation-date 2002-11-10 + @version $Id: one-paper.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ +} { + paper_id:integer,notnull +} + +# Permission Check +permission::require_permission -object_id $paper_id -privilege read + +# Select the paper +research_paper::get -paper_id $paper_id -array paper + +# Select author info +oacs::user::get -user_id $paper(author_id) -array author + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/search.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/search.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/search.adp 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,75 @@ + +Search + +

Search for '@search_text@'

+
+ + + + + +
+ [ publications | authors ] + +
+ Search:  +
+
+
+ + + +
+ + + + + + + + +
TitleAuthorPublication Date 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
@papers.title@@papers.last_name@, @papers.first_names@<%= [util_AnsiDatetoPrettyDate $papers(publication_date)] %> + [  + download + remote location + +  ] +
@papers.abstract@
+ +
+ + +
+ +
+ + No Results + Index: openacs-4/contrib/packages/research-papers/www/search.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/Attic/search.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/search.adp~ 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,75 @@ + +Search + +

Search for '@search_text@'

+
+ + + + + +
+ [ publications | authors ] + +
+ Search:  +
+
+
+ + + +
+ + + + + + + + +
TitleAuthorCreation Date 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
@papers.title@@papers.last_name@, @papers.first_names@<%= [util_AnsiDatetoPrettyDate $papers(creation_date)] %> + [  + download + remote location + +  ] +
@papers.abstract@
+ +
+ + +
+ +
+ + No Results + Index: openacs-4/contrib/packages/research-papers/www/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/search.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/search.tcl 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,13 @@ +ad_page_contract { + + @author yon@openforce.net + @creation-date 2002-08-29 + @version $Id: search.tcl,v 1.1 2003/11/14 20:57:06 janines Exp $ + +} -query { + {search_text ""} +} + +db_multirow papers search_papers {} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/search.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/search.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/search.xql 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,32 @@ + + + + + + + select research_papers.*, + parties.*, + persons.first_names, + persons.last_name, + score(1) as the_score + from research_papers, + cr_revisions, + parties, + persons + where author_id = parties.party_id + and author_id = persons.person_id + and public_p = 't' + and research_papers.revision_id = cr_revisions.revision_id(+) + and ( lower(research_papers.title) like '%' || :search_text || '%' + or contains(cr_revisions.content, :search_text, 1) > 0 + or lower(parties.email) like '%' || :search_text || '%' + or lower(persons.first_names) like '%' || :search_text || '%' + or lower(persons.last_name) like '%' || :search_text || '%' + or lower(research_papers.abstract) like '%' || :search_text || '%' + or lower(research_papers.subject) like '%' || :search_text || '%' + or lower(research_papers.source) like '%' || :search_text || '%' + or lower(research_papers.rights) like '%' || :search_text || '%') + + + + Index: openacs-4/contrib/packages/research-papers/www/search.xql~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/Attic/search.xql~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/search.xql~ 14 Nov 2003 20:57:06 -0000 1.1 @@ -0,0 +1,34 @@ + + + + + + + select research_papers.*, + acs_objects.creation_date, + parties.*, + persons.first_names, + persons.last_name, + score(1) as the_score + from research_papers, + acs_objects, + parties, + persons, + cr_revisions + where research_papers.paper_id = acs_objects.object_id + and acs_objects.creation_user = parties.party_id + and acs_objects.creation_user = persons.person_id + and research_papers.revision_id = cr_revisions.revision_id(+) + and ( lower(research_papers.title) like '%' || :search_text || '%' + or contains(cr_revisions.content, :search_text, 1) > 0 + or lower(parties.email) like '%' || :search_text || '%' + or lower(persons.first_names) like '%' || :search_text || '%' + or lower(persons.last_name) like '%' || :search_text || '%' + or lower(research_papers.abstract) like '%' || :search_text || '%' + or lower(research_papers.subject) like '%' || :search_text || '%' + or lower(research_papers.source) like '%' || :search_text || '%' + or lower(research_papers.rights) like '%' || :search_text || '%') + + + + Index: openacs-4/contrib/packages/research-papers/www/admin/add-to-community.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/add-to-community.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/add-to-community.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,15 @@ + +Add Paper to Group + + + + + + +

+There are no communities that you can administer that don't already +have this paper shared. +

+continue. + +
Index: openacs-4/contrib/packages/research-papers/www/admin/add-to-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/add-to-community.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/add-to-community.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,60 @@ +ad_page_contract { + Add paper to community +} -query { + paper_id:integer,notnull + return_url:notnull +} + +form create select_community + +element create select_community paper_id \ + -label PaperID \ + -datatype text \ + -widget hidden \ + -value $paper_id + +element create select_community return_url \ + -label ReturnURL \ + -datatype text \ + -widget hidden \ + -value $return_url + +set user_id [ad_get_user_id] +set communities [db_list_of_lists select_all_communities {}] + +set n_communities [llength $communities] + +if {$n_communities} { + element create select_community community_id \ + -label "Share research paper with" \ + -datatype text \ + -widget select \ + -options "$communities" +} else { + element create select_community community_id \ + -label "No groups to add to" \ + -datatype text \ + -widget hidden \ + -value "" +} + +if {[form is_valid select_community]} { + form get_values select_community \ + paper_id return_url community_id + + if {![empty_string_p $community_id]} { + + set approved_p f + if {[dotlrn::user_can_admin_community_p -community_id $community_id]} { + set approved_p t + } + + attachments::attach -object_id $community_id -attachment_id $paper_id -approved_p $approved_p + + } + + ad_returnredirect $return_url + ad_script_abort +} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/admin/add-to-community.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/add-to-community.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/add-to-community.xql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select pretty_name, + dotlrn_communities.community_id + from dotlrn_communities, dotlrn_admin_rels_full dotlrn_admin_rels + where dotlrn_communities.community_id = dotlrn_admin_rels.community_id + and dotlrn_admin_rels.user_id = :user_id + and dotlrn_communities.community_id not in (select object_id from attachments where item_id = :paper_id) + order by pretty_name + + + + Index: openacs-4/contrib/packages/research-papers/www/admin/add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/add.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,14 @@ + +Add a Research Paper +@context_bar@ + +

+ +There is no file associated with this research paper. + + +The file associated with this research paper is + +

+ + Index: openacs-4/contrib/packages/research-papers/www/admin/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/add.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,152 @@ +ad_page_contract {} -query { + {revision_id ""} + {return_url:notnull} + {paper_id:optional} + {public_p f} +} + +if {[exists_and_not_null paper_id]} { + + set new_revision_id $revision_id + + research_paper::get -paper_id $paper_id -array paper + template::util::array_to_vars paper + + research_paper::edit \ + -paper_id $paper_id \ + -title $title \ + -type $type \ + -subject $subject \ + -identifier $identifier \ + -source $source \ + -lang $lang \ + -paper_url $paper_url \ + -publication_date $publication_date \ + -rights $rights \ + -abstract $abstract \ + -revision_id $revision_id \ + -public_p $public_p + + ad_returnredirect $return_url + ad_script_abort + +} + +form create research_paper_create + +element create research_paper_create revision_id \ + -label RevisionID \ + -datatype text \ + -widget hidden \ + -value $revision_id + +element create research_paper_create public_p \ + -label public_p \ + -datatype text \ + -widget hidden \ + -value $public_p + +element create research_paper_create return_url \ + -label ReturnURL \ + -datatype text \ + -widget hidden \ + -value $return_url + +element create research_paper_create title \ + -label Title \ + -datatype text \ + -widget text \ + -html {width 60} + +element create research_paper_create abstract \ + -label Abstract \ + -datatype text \ + -widget textarea \ + -html {rows 5 cols 60 wrap soft} \ + -optional + +element create research_paper_create paper_url \ + -label "URL" \ + -datatype text \ + -widget text \ + -optional + +if {![empty_string_p $revision_id]} { + element set_properties research_paper_create paper_url -widget hidden +} + +element create research_paper_create publication_date \ + -label "Publication Date" \ + -datatype date \ + -widget date \ + -optional + +element create research_paper_create type \ + -label "Type" \ + -datatype text \ + -widget text \ + -optional + +element create research_paper_create subject \ + -label "Subject" \ + -datatype text \ + -widget text \ + -optional + +element create research_paper_create identifier \ + -label "Identifier" \ + -datatype text \ + -widget text \ + -optional + +element create research_paper_create source \ + -label "Source" \ + -datatype text \ + -widget text \ + -optional + +element create research_paper_create lang \ + -label "Language" \ + -datatype text \ + -widget text \ + -html {size 2 maxlength 2} \ + -optional + +element create research_paper_create rights \ + -label "Rights" \ + -datatype text \ + -widget textarea \ + -html {cols 60 rows 5 wrap soft} \ + -optional + +if {[form is_valid research_paper_create]} { + form get_values research_paper_create \ + revision_id return_url title abstract public_p \ + type subject identifier source lang paper_url publication_date + + # Get the date + set publication_date [research_paper::to_sql_date -date $publication_date] + + # Hack for now + set author_id [ad_get_user_id] + + set paper_id [research_paper::new \ + -revision_id $revision_id \ + -author_id $author_id \ + -title $title \ + -type $type \ + -subject $subject \ + -identifier $identifier \ + -source $source \ + -lang $lang \ + -paper_url $paper_url \ + -publication_date $publication_date \ + -abstract $abstract \ + -public_p $public_p] + + ad_returnredirect $return_url +} + +set context_bar {{Create a Research Paper}} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/admin/community-shares.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/community-shares.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/community-shares.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,46 @@ + +Manage Group Shares + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
Community NameActions
@communities.community_name@ + + + [ Unshare ] + + +
+ +
+ +
+ + + +

+Return +

Index: openacs-4/contrib/packages/research-papers/www/admin/community-shares.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/community-shares.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/community-shares.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,13 @@ +ad_page_contract { + Group Shares +} -query { + paper_id:integer,notnull + return_url:notnull +} + +set community_id [dotlrn_community::get_community_id] + +db_multirow -extend { community_name community_url } communities select_communities {} { + set community_name [dotlrn_community::get_community_name $object_id] + set community_url [dotlrn_community::get_community_url $object_id] +} Index: openacs-4/contrib/packages/research-papers/www/admin/community-shares.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/community-shares.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/community-shares.xql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + + select object_id + from attachments + where item_id = :paper_id + + + + Index: openacs-4/contrib/packages/research-papers/www/admin/edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/edit.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,9 @@ + +Add a Research Paper +@context_bar@ + +

+Select a different document +

+ + Index: openacs-4/contrib/packages/research-papers/www/admin/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/edit.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,139 @@ +ad_page_contract {} -query { + {paper_id:notnull} + {return_url:notnull} +} + +set folder_id [dotlrn_fs::get_user_root_folder -user_id [ad_conn user_id]] +research_paper::get -paper_id $paper_id -array paper + +form create research_paper_create + +element create research_paper_create paper_id \ + -label PaperID \ + -datatype text \ + -widget hidden \ + -value $paper_id + +element create research_paper_create revision_id \ + -label RevisionID \ + -datatype text \ + -widget hidden \ + -value $paper(revision_id) + +element create research_paper_create return_url \ + -label ReturnURL \ + -datatype text \ + -widget hidden \ + -value $return_url + +element create research_paper_create title \ + -label Title \ + -datatype text \ + -widget text \ + -html {width 60} \ + -value $paper(title) + +element create research_paper_create abstract \ + -label Abstract \ + -datatype text \ + -widget textarea \ + -html {rows 5 cols 60 wrap soft} \ + -value $paper(abstract) \ + -optional + +element create research_paper_create paper_url \ + -label "URL" \ + -datatype text \ + -widget text \ + -value $paper(paper_url) \ + -optional + +if {![empty_string_p $paper(revision_id)]} { + element set_properties research_paper_create paper_url -widget hidden +} + +element create research_paper_create publication_date \ + -label "Publication Date" \ + -datatype date \ + -widget date \ + -value [research_paper::from_sql_datetime -sql_date $paper(publication_date) -format "YYYY-MM-DD"]\ + -optional + +element create research_paper_create type \ + -label "Type" \ + -datatype text \ + -widget text \ + -value $paper(type) \ + -optional + +element create research_paper_create subject \ + -label "Subject" \ + -datatype text \ + -widget text \ + -value $paper(subject) \ + -optional + +element create research_paper_create identifier \ + -label "Identifier" \ + -datatype text \ + -widget text \ + -value $paper(identifier) \ + -optional + +element create research_paper_create source \ + -label "Source" \ + -datatype text \ + -widget text \ + -value $paper(source) \ + -optional + +element create research_paper_create lang \ + -label "Language" \ + -datatype text \ + -widget text \ + -value $paper(lang) \ + -html {size 2 maxlength 2} \ + -optional + +element create research_paper_create rights \ + -label "Rights" \ + -datatype text \ + -widget textarea \ + -value $paper(rights) \ + -html {cols 60 rows 5 wrap soft} \ + -optional + +element create research_paper_create public_p \ + -label PublicP \ + -datatype text \ + -widget hidden \ + -value $paper(public_p) + +if {[form is_valid research_paper_create]} { + form get_values research_paper_create \ + paper_id revision_id return_url title abstract public_p \ + subject identifier source lang paper_url publication_date type rights + + set publication_date [research_paper::to_sql_date -date $publication_date] + + research_paper::edit \ + -paper_id $paper_id \ + -title $title \ + -type $type \ + -subject $subject \ + -identifier $identifier \ + -source $source \ + -lang $lang \ + -paper_url $paper_url \ + -publication_date $publication_date \ + -rights $rights \ + -abstract $abstract \ + -revision_id $revision_id \ + -public_p $public_p + + ad_returnredirect $return_url +} + +set context_bar {{Edit a Research Paper}} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/admin/file-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/file-add-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/file-add-2-oracle.xql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,75 @@ + + + + oracle8.1.6 + + + + begin + :1 := file_storage.new_file( + title => :title, + folder_id => :folder_id, + creation_user => :user_id, + creation_ip => :creation_ip, + indb_p => 't' + ); + end; + + + + + + begin + :1 := file_storage.new_file ( + title => :title, + folder_id => :folder_id, + creation_user => :user_id, + creation_ip => :creation_ip, + indb_p => 'f' + ); + end; + + + + + + begin + :1 := file_storage.new_version ( + filename => :filename, + description => :description, + mime_type => :mime_type, + item_id => :file_id, + creation_user => :user_id, + creation_ip => :creation_ip + ); + end; + + + + + + update cr_revisions + set content = empty_blob() + where revision_id = :revision_id + returning content into :1 + + + + + + update cr_revisions + set content_length = dbms_lob.getlength(content) + where revision_id = :revision_id + + + + + + update cr_revisions + set filename = '$tmp_filename', + content_length = $tmp_size + where revision_id = :revision_id + + + + Index: openacs-4/contrib/packages/research-papers/www/admin/file-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/file-add-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/file-add-2-postgresql.xql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,87 @@ + + + + postgresql7.1 + + + + + select file_storage__new_file ( + :title, -- title + :folder_id, -- parent_id + :user_id, -- creation_user + :creation_ip, -- creation_ip + true -- indb_p + ); + + + + + + + + + select file_storage__new_file ( + :title, -- title + :folder_id, -- parent_id + :user_id, -- creation_user + :creation_ip, -- creation_ip + false -- indb_p + ); + + + + + + + + + select file_storage__new_version ( + :filename, -- filename + :description, -- description + :mime_type, -- mime_type + :file_id, -- item_id + :user_id, -- creation_user + :creation_ip -- creation_ip + ); + + + + + + + + + update cr_revisions + set lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]] + where revision_id = :version_id + + + + + + + + update cr_revisions + set content_length = lob_length(lob) + where revision_id = :version_id + + + + + + + + + + update cr_revisions + set content = '$tmp_filename', + content_length = $tmp_size + where revision_id = :version_id + + + + + + + Index: openacs-4/contrib/packages/research-papers/www/admin/file-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/file-add-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/file-add-2.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,49 @@ +ad_page_contract {} { + folder_id:integer,notnull + upload_file:notnull,trim + upload_file.tmpfile:tmpfile + return_url:notnull + title:notnull,trim + description + paper_id:optional + {public_p f} +} -validate { + valid_folder -requires {folder_id:integer} { + if {![fs_folder_p $folder_id]} { + ad_complain "The specified parent folder is not valid." + } + } +} + +ad_require_permission $folder_id write + +# get the filename part of the upload file +if {![regexp {[^//\\]+$} $upload_file filename]} { + set filename $upload_file +} + +set user_id [ad_conn user_id] +set creation_ip [ad_conn peeraddr] +set mime_type [fs_maybe_create_new_mime_type $upload_file] +set indb_p 1 + + +db_transaction { + + if {$indb_p} { + + set file_id [db_exec_plsql new_lob_file {}] + set revision_id [db_exec_plsql new_version {}] + db_dml lob_content {} -blob_files [list ${upload_file.tmpfile}] + db_dml lob_size {} + + } + +} + +set passthrough [export_vars {revision_id return_url public_p}] +if {[exists_and_not_null paper_id]} { + append passthrough "&paper_id=$paper_id" +} + +ad_returnredirect "add?$passthrough" Index: openacs-4/contrib/packages/research-papers/www/admin/file-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/file-add-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/file-add-2.xql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + + select count(*) + from cr_items + where name = :filename + and parent_id = :folder_id + + + + + + + Index: openacs-4/contrib/packages/research-papers/www/admin/file-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/file-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/file-add.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,52 @@ + +Upload New Attachment +@context_bar@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Version filename :
 Use the "Browse..." button to locate your file, + then click "Open".
  
Title: @title@
Description:
+
+
Index: openacs-4/contrib/packages/research-papers/www/admin/file-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/file-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/file-add.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,31 @@ +ad_page_contract { + page to add a new file to the system +} { + folder_id:integer,notnull + return_url:notnull + {title ""} + {lock_title_p 0} + {paper_id ""} + {public_p f} +} -validate { + valid_folder -requires {folder_id:integer} { + if ![fs_folder_p $folder_id] { + ad_complain "The specified parent folder is not valid." + } + } +} -properties { + folder_id:onevalue + context_bar:onevalue + title:onevalue + lock_title_p:onevalue +} + +ad_require_permission $folder_id write + +set context_bar {{Attach File}} +set fs_context_bar [fs_context_bar_list -final "Add File" $folder_id] + +# if title isn't passed in ignore lock_title_p +if {[empty_string_p $title]} { + set lock_title_p 0 +} Index: openacs-4/contrib/packages/research-papers/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/index.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,80 @@ + +Add a Research Paper +@context_bar@ + + + To create a research paper from a file already in a folder, open the folder + by clicking the folder's name, then click the "[ Select Version ]" + link next to the file. To upload a new research paper, go to the folder you + want it to reside in by clicking the folder's name, then click the + appropriate "Upload a New Research Paper" link. + + +

+ @rp_context_bar@ +

+ +

+ Upload a New Research Paper +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 NameActionSizeTypeLast Modified
+ @contents.name@ +( new ) +   + @contents.content_size@ items + @contents.type@@contents.last_modified@ + @contents.name@ +( new ) +   @contents.type@@contents.last_modified@ + @contents.name@ + + ( new ) + + + Select Version ] + @contents.content_size@ bytes@contents.type@@contents.last_modified@
+
+ +

Folder @folder_name@ is empty

+
Index: openacs-4/contrib/packages/research-papers/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/index.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,41 @@ +ad_page_contract {} -query { + {folder_id:notnull} + {return_url:notnull} + {paper_id:optional} + {public_p f} +} + +set user_id [ad_conn user_id] + +# sanity check +if {[empty_string_p $folder_id]} { + ad_return_complaint 1 "Error: empty folder_id!" + ad_script_abort +} + +# Check permission +permission::require_permission -object_id $folder_id -privilege read + +# Size of contents +set n_contents [fs::get_folder_contents_count -folder_id $folder_id -user_id $user_id] + +# Folder name +set folder_name [fs::get_object_name -object_id $folder_id] + +# Folder contents +set rows [fs::get_folder_contents \ + -folder_id $folder_id \ + -user_id $user_id] + +template::util::list_of_ns_sets_to_multirow -rows $rows -var_name "contents" + +set passthrough_vars [export_vars {return_url public_p}] +if {[exists_and_not_null paper_id]} { + append passthrough_vars "&paper_id=$paper_id" +} + +set rp_context_bar "" + +set context_bar {{Create a Research Paper}} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/admin/master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/master.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/master.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ + +

@title@

+ +@context_bar@ + +
+ + Index: openacs-4/contrib/packages/research-papers/www/admin/master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/master.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/master.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1 @@ +set context_bar [eval ad_context_bar $context_bar] Index: openacs-4/contrib/packages/research-papers/www/admin/public-toggle.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/public-toggle.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/public-toggle.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,17 @@ +ad_page_contract {} -query { + {paper_id:integer,notnull} + {public_p ""} + {return_url:notnull} +} + +research_paper::get -paper_id $paper_id -array paper + +if {[empty_string_p $public_p]} { + set public_p [ad_decode $paper(public_p) f t f] +} + +research_paper::set_public_p \ + -paper_id $paper_id \ + -public_p $public_p + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/research-papers/www/admin/select-revision.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/select-revision.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/select-revision.adp 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,40 @@ + +Add a Research Paper +@context_bar@ + + + Select which version of the file you want to use for your research paper by + clicking on the "[ Choose ] " link. + + +

+ @rp_context_bar@ +

+ + + + + + + + + + + + + + + + + + + + + +
 NameActionSizeTypeLast Modified
@revisions.title@ + Choose ] + @revisions.content_size@ bytes@revisions.type@@revisions.last_modified@
+
+ +

Item @item_name@ has no versions

+
Index: openacs-4/contrib/packages/research-papers/www/admin/select-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/select-revision.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/select-revision.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,38 @@ +ad_page_contract {} -query { + {item_id:notnull} + {return_url:notnull} + {paper_id:optional} + {public_p f} +} + +set user_id [ad_conn user_id] + +# Check permission +permission::require_permission -object_id $item_id -privilege read + +# Folder name +set item_name [fs::get_object_name -object_id $item_id] + +db_multirow revisions select_revisions { + select cr_revisions.revision_id, + cr_revisions.title, + cr_revisions.mime_type as type, + to_char(acs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + cr_revisions.content_length as content_size + from cr_revisions, + acs_objects + where cr_revisions.item_id = :item_id + and cr_revisions.revision_id = acs_objects.object_id + order by cr_revisions.revision_id +} + +set passthrough_vars [export_vars {return_url public_p}] +if {[exists_and_not_null paper_id]} { + append passthrough_vars "&paper_id=$paper_id" +} + +set rp_context_bar "" + +set context_bar {{Create a Research Paper}} + +ad_return_template Index: openacs-4/contrib/packages/research-papers/www/admin/unattach.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/unattach.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/admin/unattach.tcl 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,9 @@ +ad_page_contract {} -query { + {object_id:integer,notnull} + {item_id:integer,notnull} + {return_url:notnull} +} + +attachments::unattach -object_id $object_id -attachment_id $item_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/research-papers/www/admin/graphics/file.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/graphics/file.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/research-papers/www/admin/graphics/folder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/admin/graphics/folder.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/research-papers/www/download/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/download/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/download/index.vuh 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,32 @@ +ad_page_contract { + + virtual url handler for file downloads + + @author Ben Adida + @creation-date 2 July 2002 + +} -query { + {paper_id:integer,optional} +} + +if {[exists_and_not_null paper_id]} { + + permission::require_permission -object_id $paper_id -privilege read + + db_1row select_paper_info { + select cr_revisions.revision_id, + cr_revisions.title + from cr_revisions, + research_papers + where research_papers.paper_id = :paper_id + and research_papers.revision_id = cr_revisions.revision_id + } + + ad_returnredirect "${revision_id}/${title}" + ad_script_abort + +} + +foreach {revision_id download_name} [split [ad_conn path_info] /] {break} + +cr_write_content -revision_id $revision_id Index: openacs-4/contrib/packages/research-papers/www/download/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-papers/www/download/index.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-papers/www/download/index.xql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,12 @@ + + + + + + select revision_id + from research_papers + where paper_id = :paper_id + + + + Index: openacs-4/contrib/packages/research-portlet/research-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/Attic/research-portlet.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/research-portlet.info 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,51 @@ + + + + + Research Paper Portlet + Research Paper Portlets + f + f + + + + oracle + postgresql + + Yonatan Feldman + OpenForce + Code delivered to Sloan by OpenForce. A +s far as we know it is not finished, and certainly needs much updating. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-approval-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-admin-approval-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-approval-sc-create.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,144 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- create the research portlet admin approval data source +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-admin-approval-sc-create.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + ds_id := portal_datasource.new( + name => 'research_admin_approval_portlet', + description => 'Displays the research paper admin approval portlet' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'shadeable_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'shaded_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'hideable_p', + 't' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'user_editable_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'link_hideable_p', + 't' + ); + + foo := acs_sc_impl.new( + 'portal_datasource', + 'research_admin_approval_portlet', + 'research_admin_approval_portlet' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_approval_portlet', + 'GetMyName', + 'research_admin_approval_portlet::get_my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_approval_portlet', + 'GetPrettyName', + 'research_admin_approval_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_approval_portlet', + 'Link', + 'research_admin_approval_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_approval_portlet', + 'AddSelfToPage', + 'research_admin_approval_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_approval_portlet', + 'Show', + 'research_admin_approval_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_approval_portlet', + 'Edit', + 'research_admin_approval_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_approval_portlet', + 'RemoveSelfFromPage', + 'research_admin_approval_portlet::remove_self_from_page', + 'TCL' + ); + + acs_sc_binding.new( + contract_name => 'portal_datasource', + impl_name => 'research_admin_approval_portlet' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-approval-sc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-admin-approval-sc-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-approval-sc-drop.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,93 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the research admin approval portlet data source +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-admin-approval-sc-drop.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + select datasource_id + into ds_id + from portal_datasources + where name = 'research_admin_portlet'; + + if ds_id is not null then + portal_datasource.delete(ds_id); + end if; + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'GetMyName' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'GetPrettyName' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Link' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'AddSelfToPage' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Show' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Edit' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'RemoveSelfFromPage' + ); + + acs_sc_binding.delete( + contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); + + acs_sc_impl.delete( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-admin-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-sc-create.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,144 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- create the research portlet admin data source +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-admin-sc-create.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + ds_id := portal_datasource.new( + name => 'research_admin_portlet', + description => 'Displays the research paper admin portlet' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'shadeable_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'shaded_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'hideable_p', + 't' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'user_editable_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'link_hideable_p', + 't' + ); + + foo := acs_sc_impl.new( + 'portal_datasource', + 'research_admin_portlet', + 'research_admin_portlet' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_admin_portlet', + 'GetMyName', + 'research_admin_portlet::get_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' + ); + + acs_sc_binding.new( + contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-sc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-admin-sc-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-admin-sc-drop.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,93 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the research admin portlet data source +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-admin-sc-drop.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + select datasource_id + into ds_id + from portal_datasources + where name = 'research_admin_portlet'; + + if ds_id is not null then + portal_datasource.delete(ds_id); + end if; + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'GetMyName' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'GetPrettyName' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Link' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'AddSelfToPage' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Show' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'Edit' + ); + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_admin_portlet', + 'RemoveSelfFromPage' + ); + + acs_sc_binding.delete( + contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); + + acs_sc_impl.delete( + impl_contract_name => 'portal_datasource', + impl_name => 'research_admin_portlet' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-create.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,27 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- create the research portlet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-create.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +@@ research-portlet-sc-create.sql +@@ research-portlet-admin-sc-create.sql +@@ research-portlet-admin-approval-sc-create.sql Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-drop.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,27 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the research portlet +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-drop.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +@@ research-portlet-admin-sc-drop.sql +@@ research-portlet-sc-drop.sql +@@ research-portlet-admin-approval-sc-drop.sql Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-sc-create.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,152 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- create the research portlet data source +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-sc-create.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + ds_id := portal_datasource.new( + name => 'research_portlet', + description => 'Displays the research paper portlet' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'shadeable_p', + 't' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'shaded_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'hideable_p', + 't' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'user_editable_p', + 'f' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 't', + 'link_hideable_p', + 't' + ); + + portal_datasource.set_def_param( + ds_id, + 't', + 'f', + 'package_id', + '' + ); + + foo := acs_sc_impl.new( + 'portal_datasource', + 'research_portlet', + 'research_portlet' + ); + + foo := acs_sc_impl.new_alias( + 'portal_datasource', + 'research_portlet', + 'GetMyName', + 'research_portlet::get_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' + ); + + acs_sc_binding.new( + contract_name => 'portal_datasource', + impl_name => 'research_portlet' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-sc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/sql/oracle/Attic/research-portlet-sc-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/sql/oracle/research-portlet-sc-drop.sql 14 Nov 2003 20:57:07 -0000 1.1 @@ -0,0 +1,93 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the research portlet data source +-- +-- @author yon (yon@openforce.net) +-- @creation-date 2002-07-20 +-- @version $Id: research-portlet-sc-drop.sql,v 1.1 2003/11/14 20:57:07 janines Exp $ +-- + +declare + ds_id portal_datasources.datasource_id%TYPE; + foo integer; +begin + + select datasource_id + into ds_id + from portal_datasources + where name = 'research_portlet'; + + if ds_id is not null then + portal_datasource.delete(ds_id); + end if; + + foo := acs_sc_impl.delete_alias( + 'portal_datasource', + 'research_portlet', + 'GetMyName' + ); + + 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' + ); + + acs_sc_binding.delete( + contract_name => 'portal_datasource', + impl_name => 'research_portlet' + ); + + acs_sc_impl.delete( + impl_contract_name => 'portal_datasource', + impl_name => 'research_portlet' + ); + +end; +/ +show errors Index: openacs-4/contrib/packages/research-portlet/tcl/research-admin-approval-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/tcl/Attic/research-admin-approval-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/tcl/research-admin-approval-portlet-procs.tcl 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,78 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_library { + + procedures to support the research admin approval portlet + + @author yon (yon@openforce.net) + @creation-date 2002-07-20 + @version $Id: research-admin-approval-portlet-procs.tcl,v 1.1 2003/11/14 20:57:08 janines Exp $ + +} + +namespace eval research_admin_approval_portlet { + + ad_proc -private get_my_name { + } { + return research_admin_approval_portlet + } + + ad_proc -public get_pretty_name { + } { + return "Research Paper Approval" + } + + ad_proc -private my_package_key { + } { + return "research-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -key fake_key \ + -value fake_value \ + ] + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + } { + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "research-admin-approval-portlet" + } + +} Index: openacs-4/contrib/packages/research-portlet/tcl/research-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/tcl/Attic/research-admin-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/tcl/research-admin-portlet-procs.tcl 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,78 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_library { + + procedures to support the research admin portlet + + @author yon (yon@openforce.net) + @creation-date 2002-07-20 + @version $Id: research-admin-portlet-procs.tcl,v 1.1 2003/11/14 20:57:08 janines Exp $ + +} + +namespace eval research_admin_portlet { + + ad_proc -private get_my_name { + } { + return research_admin_portlet + } + + ad_proc -public get_pretty_name { + } { + return "Research Paper Administration" + } + + ad_proc -private my_package_key { + } { + return "research-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -key fake_key \ + -value fake_value \ + ] + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + } { + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "research-admin-portlet" + } + +} Index: openacs-4/contrib/packages/research-portlet/tcl/research-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/tcl/Attic/research-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/tcl/research-portlet-procs.tcl 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,78 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_library { + + Procedures to support the research portlet + + @author yon (yon@openforce.net) + @creation-date 2002-07-20 + @version $Id: research-portlet-procs.tcl,v 1.1 2003/11/14 20:57:08 janines Exp $ + +} + +namespace eval research_portlet { + + ad_proc -private get_my_name { + } { + return research_portlet + } + + ad_proc -public get_pretty_name { + } { + return "Research Papers" + } + + ad_proc -private my_package_key { + } { + return "research-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -key fake_key \ + -value fake_value \ + ] + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + } { + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "research-portlet" + } + +} Index: openacs-4/contrib/packages/research-portlet/www/research-admin-approval-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/www/Attic/research-admin-approval-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/www/research-admin-approval-portlet.adp 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,57 @@ +<% + + # + # Copyright (C) 2001, 2002 MIT + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # + +%> + + +
    + <% + foreach attachment $attachments { + + set item_id [lindex $attachment 0] + set name [lindex $attachment 1] + set approved_p [lindex $attachment 2] + set url "[research_paper::get_url]/one-paper?paper_id=$item_id" + + template::adp_puts " +
  • + $name + + " + + if {[string equal $approved_p t]} { + template::adp_puts " + \[ Reject \] + " + } else { + template::adp_puts " + \[ Approve \] + " + } + template::adp_puts { + +
  • + } + } + %> +
+
+ + No Research Papers to approve + + Index: openacs-4/contrib/packages/research-portlet/www/research-admin-approval-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/www/Attic/research-admin-approval-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/www/research-admin-approval-portlet.tcl 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,21 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +set object_id [dotlrn_community::get_community_id] +set return_url [ad_conn url] +set base_url "[dotlrn::get_url]/" +set attachments [attachments::get_all_attachments -object_id $object_id -base_url $base_url] +set n_attachments [llength $attachments] Index: openacs-4/contrib/packages/research-portlet/www/research-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/www/Attic/research-admin-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/www/research-admin-portlet.adp 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,55 @@ +<% + + # + # Copyright (C) 2001, 2002 MIT + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # + +%> + + Index: openacs-4/contrib/packages/research-portlet/www/research-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/www/Attic/research-admin-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/www/research-admin-portlet.tcl 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,23 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +set community_id [dotlrn_community::get_community_id] +set url "[dotlrn_community::get_community_url $community_id][research_paper::get_url]" +set user_id [ad_conn user_id] +set folder_id [dotlrn_fs::get_user_root_folder -user_id $user_id] +set return_url [ad_conn url] + +db_multirow papers select_papers {} Index: openacs-4/contrib/packages/research-portlet/www/research-admin-portlet.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/www/Attic/research-admin-portlet.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/www/research-admin-portlet.xql 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + + + select research_papers.*, + (select count(*) + from attachments + where attachments.item_id = paper_id) as n_shares + from research_papers + where author_id = :user_id + + + + Index: openacs-4/contrib/packages/research-portlet/www/research-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/www/Attic/research-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/www/research-portlet.adp 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,37 @@ +<% + + # + # Copyright (C) 2001, 2002 MIT + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # + +%> + + + + +<% + foreach attachment $attachments { + template::adp_puts "
  • [lindex $attachment 1]
  • \n" + } +%> + +
    + +No Research Papers + +
    + +   + Index: openacs-4/contrib/packages/research-portlet/www/research-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/research-portlet/www/Attic/research-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/research-portlet/www/research-portlet.tcl 14 Nov 2003 20:57:08 -0000 1.1 @@ -0,0 +1,22 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +array set config $cf + +set shaded_p $config(shaded_p) + +set attachments [attachments::get_attachments -object_id [dotlrn_community::get_community_id] -base_url "[dotlrn::get_url]/"] +set n_attachments [llength $attachments]