Index: openacs-4/packages/wps-portlet/wps-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/wps-portlet.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/wps-portlet.info 25 Sep 2003 16:36:54 -0000 1.1
@@ -0,0 +1,25 @@
+
+
+
+
+ Wimpy Point Portlet
+
+ f
+ t
+
+
+ Rocael Hernandez
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/wps-portlet/sql/oracle/wps-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/sql/oracle/wps-admin-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/sql/oracle/wps-admin-portlet-create.sql 25 Sep 2003 16:36:54 -0000 1.1
@@ -0,0 +1,194 @@
+--
+-- Copyright (C) 2001, 2002, 2003 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.
+--
+
+--
+-- /wps-portlet/sql/oracle/wps-admin-portlet-create.sql
+--
+
+-- Creates wps admin portlet
+
+-- Copyright (C) 2003 MIT
+-- @author Rocael Hernandez (roc@viaro.net)
+-- @creation-date 2003-05-24
+
+-- $Id: wps-admin-portlet-create.sql,v 1.1 2003/09/25 16:36:54 rocaelh Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+ ds_id := portal_datasource.new(
+ name => 'wps_admin_portlet',
+ description => 'Wimpy Point Admin portlet'
+ );
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'shadeable_p',
+ value => 'f'
+);
+
+
+ -- hideable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'hideable_p',
+ value => 'f'
+);
+
+ -- user_editable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'user_editable_p',
+ value => 'f'
+);
+
+ -- shaded_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'shaded_p',
+ value => 'f'
+);
+
+ -- link_hideable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'link_hideable_p',
+ value => 't'
+);
+
+-- wps_admin-specific params
+
+ -- package_id must be configured
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 'f',
+ key => 'package_id',
+ value => ''
+);
+
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- create the implementation
+ foo := acs_sc_impl.new (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'wps_admin_portlet'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- add all the hooks
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'GetMyName',
+ 'wps_admin_portlet::get_my_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'GetPrettyName',
+ 'wps_admin_portlet::get_pretty_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'Link',
+ 'wps_admin_portlet::link',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'AddSelfToPage',
+ 'wps_admin_portlet::add_self_to_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'Show',
+ 'wps_admin_portlet::show',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'Edit',
+ 'wps_admin_portlet::edit',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'RemoveSelfFromPage',
+ 'wps_admin_portlet::remove_self_from_page',
+ 'TCL'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- Add the binding
+ acs_sc_binding.new (
+ contract_name => 'portal_datasource',
+ impl_name => 'wps_admin_portlet'
+ );
+end;
+/
+show errors
+
Index: openacs-4/packages/wps-portlet/sql/oracle/wps-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/sql/oracle/wps-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/sql/oracle/wps-portlet-create.sql 25 Sep 2003 16:36:54 -0000 1.1
@@ -0,0 +1,196 @@
+--
+-- Copyright (C) 2001, 2002, 2003 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.
+--
+
+--
+-- /wps-portlet/sql/oracle/wps-portlet-create.sql
+--
+
+-- Creates wps portlet
+
+-- Copyright (C) 2003 MIT
+-- @author Rocael Hernandez (roc@viaro.net)
+-- @creation-date 2003-05-24
+
+-- $Id: wps-portlet-create.sql,v 1.1 2003/09/25 16:36:54 rocaelh Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+ ds_id := portal_datasource.new(
+ name => 'wps_portlet',
+ description => 'Wimpy Point portlet'
+ );
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'shadeable_p',
+ value => 't'
+);
+
+
+ -- hideable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'hideable_p',
+ value => 't'
+);
+
+ -- user_editable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'user_editable_p',
+ value => 'f'
+);
+
+ -- shaded_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'shaded_p',
+ value => 'f'
+);
+
+ -- link_hideable_p
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 't',
+ key => 'link_hideable_p',
+ value => 't'
+);
+
+-- wps-specific params
+
+ -- community_id must be configured
+ portal_datasource.set_def_param (
+ datasource_id => ds_id,
+ config_required_p => 't',
+ configured_p => 'f',
+ key => 'package_id',
+ value => ''
+);
+
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- create the implementation
+ foo := acs_sc_impl.new (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'wps_portlet'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- add all the hooks
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'GetMyName',
+ 'wps_portlet::get_my_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'GetPrettyName',
+ 'wps_portlet::get_pretty_name',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'Link',
+ 'wps_portlet::link',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'AddSelfToPage',
+ 'wps_portlet::add_self_to_page',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'Show',
+ 'wps_portlet::show',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'Edit',
+ 'wps_portlet::edit',
+ 'TCL'
+ );
+
+ foo := acs_sc_impl.new_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'RemoveSelfFromPage',
+ 'wps_portlet::remove_self_from_page',
+ 'TCL'
+ );
+
+end;
+/
+show errors
+
+declare
+ foo integer;
+begin
+ -- Add the binding
+ acs_sc_binding.new (
+ contract_name => 'portal_datasource',
+ impl_name => 'wps_portlet'
+ );
+end;
+/
+show errors
+
+
+@wps-admin-portlet-create.sql
Index: openacs-4/packages/wps-portlet/sql/oracle/wps-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/sql/oracle/wps-portlet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/sql/oracle/wps-portlet-drop.sql 25 Sep 2003 16:36:54 -0000 1.1
@@ -0,0 +1,115 @@
+--
+-- 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.
+--
+
+--
+-- /wps-portlet/sql/oracle/wps-portlet-drop.sql
+--
+
+-- Drops wps portlet
+
+-- Copyright (C) 2003 MIT
+-- @author Rocael Hernandez (roc@viaro.net)
+-- @creation-date 2003-05-24
+
+-- $Id: wps-portlet-drop.sql,v 1.1 2003/09/25 16:36:54 rocaelh Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ begin
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = 'wps_portlet';
+ exception when no_data_found then
+ ds_id := null;
+ end;
+
+ if ds_id is not null then
+ portal_datasource.delete(ds_id);
+ end if;
+
+end;
+/
+show errors;
+
+declare
+ foo integer;
+begin
+
+ -- drop the hooks
+ foo := acs_sc_impl.delete_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'GetMyName'
+ );
+
+ foo := acs_sc_impl.delete_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'GetPrettyName'
+ );
+
+
+ foo := acs_sc_impl.delete_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'Link'
+ );
+
+ foo := acs_sc_impl.delete_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'AddSelfToPage'
+ );
+
+ foo := acs_sc_impl.delete_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'Show'
+ );
+
+ foo := acs_sc_impl.delete_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'Edit'
+ );
+
+ foo := acs_sc_impl.delete_alias (
+ 'portal_datasource',
+ 'wps_portlet',
+ 'RemoveSelfFromPage'
+ );
+
+ -- Drop the binding
+ acs_sc_binding.delete (
+ contract_name => 'portal_datasource',
+ impl_name => 'wps_portlet'
+ );
+
+ -- drop the impl
+ foo := acs_sc_impl.delete (
+ 'portal_datasource',
+ 'wps_portlet'
+ );
+end;
+/
+show errors
+
Index: openacs-4/packages/wps-portlet/sql/postgresql/wps-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/sql/postgresql/wps-admin-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/sql/postgresql/wps-admin-portlet-create.sql 25 Sep 2003 16:36:55 -0000 1.1
@@ -0,0 +1,186 @@
+--
+-- 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.
+--
+
+--
+-- /wps-portlet/sql/postgresql/wps-admin-portlet-create.sql
+--
+
+-- Creates news admin portlet
+
+-- Copyright (C) 2003 MIT
+-- @author Rocael Hernandez (roc@viaro.net)
+-- @creation-date 2003-05-24
+
+-- $Id: wps-admin-portlet-create.sql,v 1.1 2003/09/25 16:36:55 rocaelh Exp $
+
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id = portal_datasource__new( ''wps_admin_portlet'', ''Wimpy Point Admin portlet'');
+
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shadeable_p'',
+ ''f''
+);
+
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''f''
+);
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''f''
+);
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+-- wps_admin-specific params
+
+ -- package_id must be configured
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''f'',
+ ''package_id'',
+ ''''
+);
+
+ return 0;
+
+end;' language 'plpgsql';
+
+select inline_0();
+drop function inline_0();
+
+
+create function inline_1()
+returns integer as '
+begin
+
+ -- create the implementation
+ perform acs_sc_impl__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''wps_admin_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new(
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''GetMyName'',
+ ''wps_admin_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''GetPrettyName'',
+ ''wps_admin_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''Link'',
+ ''wps_admin_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''AddSelfToPage'',
+ ''wps_admin_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''Show'',
+ ''wps_admin_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''Edit'',
+ ''wps_admin_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet'',
+ ''RemoveSelfFromPage'',
+ ''wps_admin_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''wps_admin_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+
Index: openacs-4/packages/wps-portlet/sql/postgresql/wps-admin-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/sql/postgresql/wps-admin-portlet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/sql/postgresql/wps-admin-portlet-drop.sql 25 Sep 2003 16:36:55 -0000 1.1
@@ -0,0 +1,118 @@
+--
+-- 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.
+--
+
+--
+-- /wps-portlet/sql/oracle/wps-admin-portlet-create.sql
+--
+
+-- Creates wps admin portlet
+
+-- Copyright (C) 2003 MIT
+-- @author Rocael Hernandez (roc@viaro.net)
+-- @creation-date 2003-05-24
+
+-- $Id: wps-admin-portlet-drop.sql,v 1.1 2003/09/25 16:36:55 rocaelh Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+--
+-- Postgresql port adarsh@symphinity.com
+--
+-- 10 July 2002
+
+create function inline_0 ()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = ''wps_admin_portlet'';
+
+ if not found then
+ raise exception ''No datasource_id found here '',ds_id ;
+ ds_id := null;
+ end if;
+
+
+ if ds_id is NOT null then
+ perform portal_datasource__delete(ds_id);
+ end if;
+
+return 0;
+
+end;' language 'plpgsql';
+
+select inline_0 ();
+
+drop function inline_0 ();
+
+-- create the implementation
+select acs_sc_impl__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet'
+);
+
+-- delete all the hooks
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'GetMyName'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'GetPrettyName'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'Link'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'AddSelfToPage'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'Show'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'Edit'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet',
+ 'RemoveSelfFromPage'
+);
+
+-- Add the binding
+select acs_sc_binding__delete (
+ 'portal_datasource',
+ 'wps_admin_portlet'
+);
Index: openacs-4/packages/wps-portlet/sql/postgresql/wps-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/sql/postgresql/wps-portlet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/sql/postgresql/wps-portlet-create.sql 25 Sep 2003 16:36:55 -0000 1.1
@@ -0,0 +1,194 @@
+--
+-- 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.
+--
+
+--
+-- /wps-portlet/sql/postgresql/wps-portlet-create.sql
+--
+
+-- Creates wps portlet
+
+-- Copyright (C) 2003 MIT
+-- @author Rocael Hernandez (roc@viaro.net)
+-- @creation-date 2003-05-24
+
+-- $Id: wps-portlet-create.sql,v 1.1 2003/09/25 16:36:55 rocaelh Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id = portal_datasource__new(
+ ''wps_portlet'', -- Name
+ ''Wps portlet'' -- description
+ );
+
+ -- the standard 4 params
+
+ -- shadeable_p
+ perform portal_datasource__set_def_param (
+ ds_id, -- datasource_id
+ ''t'', -- config_required_p
+ ''t'', -- configured_p
+ ''shadeable_p'', -- key
+ ''t'' -- value
+);
+
+
+ -- hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''hideable_p'',
+ ''t''
+);
+
+ -- user_editable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''user_editable_p'',
+ ''f''
+);
+
+ -- shaded_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''shaded_p'',
+ ''f''
+);
+
+ -- link_hideable_p
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''t'',
+ ''link_hideable_p'',
+ ''t''
+);
+
+-- wps-specific params
+
+ -- community_id must be configured
+ perform portal_datasource__set_def_param (
+ ds_id,
+ ''t'',
+ ''f'',
+ ''package_id'',
+ ''''
+);
+
+ return 0;
+
+end;' language 'plpgsql';
+
+select inline_0();
+
+drop function inline_0();
+
+
+create function inline_1()
+returns integer as '
+begin
+
+ -- create the implementation
+ perform acs_sc_impl__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''wps_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''GetMyName'',
+ ''wps_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''GetPrettyName'',
+ ''wps_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''Link'',
+ ''wps_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''AddSelfToPage'',
+ ''wps_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''Show'',
+ ''wps_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''Edit'',
+ ''wps_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''RemoveSelfFromPage'',
+ ''wps_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''wps_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+
+drop function inline_1();
+
+
+\i wps-admin-portlet-create.sql
Index: openacs-4/packages/wps-portlet/sql/postgresql/wps-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/sql/postgresql/wps-portlet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/sql/postgresql/wps-portlet-drop.sql 25 Sep 2003 16:36:55 -0000 1.1
@@ -0,0 +1,122 @@
+--
+-- 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.
+--
+
+--
+-- /wps-portlet/sql/oracle/wps-portlet-drop.sql
+--
+
+-- Drops wps portlet
+
+-- Copyright (C) 2003 MIT
+-- @author Rocael Hernandez (roc@viaro.net)
+-- @creation-date 2003-05-24
+
+-- $Id: wps-portlet-drop.sql,v 1.1 2003/09/25 16:36:55 rocaelh Exp $
+
+-- This is free software distributed under the terms of the GNU Public
+-- License version 2 or higher. Full text of the license is available
+-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html
+--
+-- PostGreSQL port samir@symphinity.com
+--
+
+
+create function inline_1()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = ''wps_portlet'';
+
+ if not found then
+ RAISE EXCEPTION '' No datasource id found '', ds_id;
+ ds_id := null;
+ end if;
+
+ if ds_id is NOT null then
+ perform portal_datasource__delete(ds_id);
+ end if;
+
+ -- drop the hooks
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''GetMyName''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''GetPrettyName''
+ );
+
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''Link''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''AddSelfToPage''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''Show''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''Edit''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''wps_portlet'',
+ ''RemoveSelfFromPage''
+ );
+
+ -- Drop the binding
+ perform acs_sc_binding__delete (
+ ''portal_datasource'',
+ ''wps_portlet''
+ );
+
+ -- drop the impl
+ perform acs_sc_impl__delete (
+ ''portal_datasource'',
+ ''wps_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+\i wps-admin-portlet-drop.sql
+
+
+
+
Index: openacs-4/packages/wps-portlet/tcl/wps-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/tcl/wps-admin-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/tcl/wps-admin-portlet-procs.tcl 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,90 @@
+#
+# 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 wps admin portlet
+
+ @creation-date Jan 2002
+ @author ben@openforce.net
+ @cvs-id $Id: wps-admin-portlet-procs.tcl,v 1.1 2003/09/25 16:36:56 rocaelh Exp $
+
+}
+
+namespace eval wps_admin_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "wps_admin_portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "Wimpy Point Administration"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "wps-portlet"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-page_name ""}
+ {-package_id:required}
+ } {
+ Adds a wps admin PE to the given portal
+
+ @param portal_id The page to add self to
+ @param package_id The package_id of the wps package
+
+ @return element_id The new element's id
+ } {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -key package_id \
+ -value $package_id
+ ]
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ } {
+ Removes a wps admin PE from the given page
+ } {
+ 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 "wps-admin-portlet"
+
+ }
+
+}
Index: openacs-4/packages/wps-portlet/tcl/wps-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/tcl/wps-portlet-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/tcl/wps-portlet-procs.tcl 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,103 @@
+#
+# 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 news portlet
+
+ @creation-date Nov 2001
+ @author arjun@openforce.net
+ @cvs-id $Id: wps-portlet-procs.tcl,v 1.1 2003/09/25 16:36:56 rocaelh Exp $
+
+}
+
+namespace eval wps_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "wps_portlet"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "wps-portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return [parameter::get_from_package_key \
+ -package_key [my_package_key] \
+ -parameter pretty_name \
+ -default "Wimpy Point"
+ ]
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-package_id:required}
+ {-param_action:required}
+ } {
+ Adds a wps PE to the given portal.
+
+ @param portal_id The page to add self to
+ @param package_id The community with the folder
+
+ @return element_id The new element's id
+ } {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value $package_id \
+ -force_region [parameter::get_from_package_key \
+ -parameter "wps_portlet_force_region" \
+ -package_key [my_package_key]] \
+ -pretty_name [get_pretty_name] \
+ -param_action $param_action
+ ]
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ {-package_id:required}
+ } {
+ Removes a wps PE from the given page or the package_id of the
+ wps package from the portlet if there are others remaining
+
+ @param portal_id The page to remove self from
+ @param package_id
+ } {
+ portal::remove_element_parameters \
+ -portal_id $portal_id \
+ -portlet_name [get_my_name] \
+ -value $package_id
+ }
+
+ ad_proc -public show {
+ cf
+ } {
+ } {
+ portal::show_proc_helper \
+ -package_key [my_package_key] \
+ -config_list $cf \
+ -template_src "wps-portlet"
+ }
+
+}
Index: openacs-4/packages/wps-portlet/www/wps-admin-portlet-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-admin-portlet-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-admin-portlet-oracle.xql 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select i.item_id as pres_item_id,
+ p.pres_title as title,
+ acs_permission.permission_p(i.item_id, :user_id, 'admin') as admin_p,
+ to_char(ao.creation_date, 'Month DD, YYYY') as creation_date
+ from cr_items i, cr_wp_presentations p, acs_objects ao
+ where i.live_revision = p.presentation_id
+ and ao.object_id = i.item_id
+ and ao.creation_user = :user_id
+ and ao.context_id = :package_id
+
+
+
+
+
+
Index: openacs-4/packages/wps-portlet/www/wps-admin-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-admin-portlet-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-admin-portlet-postgresql.xql 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select i.item_id as pres_item_id,
+ p.pres_title as title,
+ acs_permission__permission_p(i.item_id, :user_id, 'admin') as admin_p,
+ to_char(ao.creation_date, 'Month DD, YYYY') as creation_date
+ from cr_items i, cr_wp_presentations p, acs_objects ao
+ where i.live_revision = p.presentation_id
+ and ao.object_id = i.item_id
+ and ao.creation_user = :user_id
+ and ao.context_id = :package_id
+
+
+
+
+
+
Index: openacs-4/packages/wps-portlet/www/wps-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-admin-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-admin-portlet.adp 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,19 @@
+<%
+# @author Rocael Hernandez (roc@viaro.net)
+%>
+
+
+
+
+ No Presentations Available
+
+
+ Create a new presentation.
Index: openacs-4/packages/wps-portlet/www/wps-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-admin-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-admin-portlet.tcl 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,42 @@
+ad_page_contract {
+ @author Rocael Hernandez (roc@viaro.net)
+ @creation-date 2003-05-24
+
+} -properties {
+
+}
+
+# Configuration
+array set config $cf
+
+# Should be a list already!
+set list_of_package_ids $config(package_id)
+
+if {[llength $list_of_package_ids] > 1} {
+ # We have a problem!
+ return -code error "There should be only one instance of Wimpy Point for admin purposes"
+}
+
+set package_id [lindex $list_of_package_ids 0]
+
+
+set user_id [ad_verify_and_get_user_id]
+
+
+db_multirow presentations select_presentations {
+
+ select i.item_id as pres_item_id,
+ p.pres_title as title,
+ acs_permission__permission_p(i.item_id, :user_id, 'admin') as admin_p,
+ to_char(ao.creation_date, 'Month DD, YYYY') as creation_date
+ from cr_items i, cr_wp_presentations p, acs_objects ao
+ where i.live_revision = p.presentation_id
+ and ao.object_id = i.item_id
+ and ao.creation_user = :user_id
+ and ao.context_id = :package_id
+
+}
+
+set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
+
+ad_return_template
Index: openacs-4/packages/wps-portlet/www/wps-portlet-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-portlet-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-portlet-oracle.xql 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,22 @@
+
+
+
+ oracle8.1.6
+
+
+
+ select o.context_id as package_id, i.item_id as pres_item_id,
+ acs_object.name(apm_package.parent_id(o.context_id)) as parent_name,
+ p.pres_title, (select site_node.url(site_nodes.node_id) from site_nodes where site_nodes.object_id = o.context_id) as url
+ from cr_items i, cr_wp_presentations p , acs_objects o
+ where o.context_id in ( [join $list_of_package_ids ", "] )
+ and p.presentation_id = i.live_revision
+ and i.item_id = o.object_id
+ and p.public_p = 't'
+ order by i.item_id desc, pres_title
+
+
+
+
+
+
Index: openacs-4/packages/wps-portlet/www/wps-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-portlet-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-portlet-postgresql.xql 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,22 @@
+
+
+
+ postgresql7.1
+
+
+
+ select o.context_id as package_id, i.item_id as pres_item_id,
+ acs_object__name(apm_package__parent_id(o.context_id)) as parent_name,
+ p.pres_title, (select site_node__url(site_nodes.node_id) from site_nodes where site_nodes.object_id = o.context_id) as url
+ from cr_items i, cr_wp_presentations p , acs_objects o
+ where o.context_id in ( [join $list_of_package_ids ", "] )
+ and p.presentation_id = i.live_revision
+ and i.item_id = o.object_id
+ and p.public_p = 't'
+ order by i.item_id desc, pres_title
+
+
+
+
+
+
Index: openacs-4/packages/wps-portlet/www/wps-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-portlet.adp 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,68 @@
+<%
+# @author Rocael Hernandez (roc@viaro.net)
+%>
+
+
+
+ <%
+ set new_package_id ""
+ set old_package_id ""
+ %>
+
+
+
+
+
+
+
+ @presentation_name@
+ [ Print View ]
+
+
+
+ No Presentations Available
+
+
+
+
+
+
+
+
Index: openacs-4/packages/wps-portlet/www/wps-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wps-portlet/www/wps-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/wps-portlet/www/wps-portlet.tcl 25 Sep 2003 16:36:56 -0000 1.1
@@ -0,0 +1,35 @@
+ad_page_contract {
+ @author Rocael Hernandez (roc@viaro.net)
+ @creation-date 2003-05-24
+
+} -properties {
+
+}
+
+array set config $cf
+
+set shaded_p $config(shaded_p)
+set list_of_package_ids $config(package_id)
+set package_id [lindex $list_of_package_ids 0]
+set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0]
+set user_id [ad_verify_and_get_user_id]
+
+set counter 0
+db_multirow presentations select_presentations { *SQL* } {
+ incr counter
+ # we don't want to fill the users portlet with 1000 presentations! roc@viaro.net
+ # specially true in users portal page, we do it this way because the lack of oracle
+ # on limiting the amount of rows returned
+ if {$counter > 25} {break}
+}
+
+if {${presentations:rowcount} == 1} {
+ set presentation_name [lindex [array get {presentations:1} pres_title] 1]
+ set presentation_url [lindex [array get {presentations:1} url] 1]
+ set presentation_id [lindex [array get {presentations:1} pres_item_id] 1]
+
+}
+
+
+
+