Index: openacs-4/packages/chat-portlet/chat-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/chat-portlet.info,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/chat-portlet.info 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+ Chat Portlet
+ Chat Portlets
+ f
+ t
+
+
+ OpenACS
+ 2004-10-10
+ OpenACS
+
+
+
+
+
+
+
Index: openacs-4/packages/chat-portlet/catalog/chat-portlet.ca_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/catalog/chat-portlet.ca_ES.ISO-8859-1.xml,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/catalog/chat-portlet.ca_ES.ISO-8859-1.xml 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,8 @@
+
+
+
+ Afegeix una sala de xat
+ Administraci� de xat
+ Administra xat
+ Xat
+
Index: openacs-4/packages/chat-portlet/catalog/chat-portlet.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/catalog/chat-portlet.en_US.ISO-8859-1.xml,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/catalog/chat-portlet.en_US.ISO-8859-1.xml 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,8 @@
+
+
+
+ Add a chat room
+ Chat administration
+ Manage chat
+ Chat
+
Index: openacs-4/packages/chat-portlet/catalog/chat-portlet.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/catalog/chat-portlet.es_ES.ISO-8859-1.xml,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/catalog/chat-portlet.es_ES.ISO-8859-1.xml 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,8 @@
+
+
+
+ A�adir una sala
+ Administraci�n de chat
+ Gestionar sala
+ Chat
+
Index: openacs-4/packages/chat-portlet/sql/oracle/chat-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/oracle/chat-admin-portlet-create.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/oracle/chat-admin-portlet-create.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,173 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author Emma (eraffenne@innova.uned.es)
+-- @creation-date 2006-01-04
+-- @version $Id: chat-admin-portlet-create.sql,v 1.1 2006/03/14 12:23:37 emmar Exp $
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id := portal_datasource.new(
+ name => 'chat_admin_portlet',
+ description => 'Chat 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'
+ );
+
+-- chat_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
+ v_impl_id acs_sc_impls.impl_id%TYPE;
+begin
+
+-- create the implementation
+ v_impl_id := acs_sc_impl.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_pretty_name => 'Chat Admin portlet',
+ impl_owner_name => 'chat_admin_portlet'
+ );
+
+-- add all the hooks
+ v_impl_id := acs_sc_impl_alias.new(
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'GetMyName',
+ impl_alias => 'chat_admin_portlet::get_my_name',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'GetPrettyName',
+ impl_alias => 'chat_admin_portlet::get_pretty_name',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'Link',
+ impl_alias => 'chat_admin_portlet::link',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'AddSelfToPage',
+ impl_alias => 'chat_admin_portlet::add_self_to_page',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'Show',
+ impl_alias => 'chat_admin_portlet::show',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'Edit',
+ impl_alias => 'chat_admin_portlet::edit',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'RemoveSelfFromPage',
+ impl_alias => 'chat_admin_portlet::remove_self_from_page',
+ impl_pl => 'TCL'
+ );
+
+-- Add the binding
+ acs_sc_binding.new (
+ contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet'
+ );
+
+end;
+/
+show errors
Index: openacs-4/packages/chat-portlet/sql/oracle/chat-admin-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/oracle/chat-admin-portlet-drop.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/oracle/chat-admin-portlet-drop.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,106 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author Emma (eraffenne@innova.uned.es)
+-- @creation-date 2006-01-04
+-- @version $Id: chat-admin-portlet-drop.sql,v 1.1 2006/03/14 12:23:37 emmar Exp $
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = 'chat_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
+ portal_datasource.del(ds_id);
+ end if;
+
+end;
+/
+show errors
+
+declare
+ v_impl_id acs_sc_impls.impl_id%TYPE;
+begin
+-- delete all the hooks
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'GetMyName'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'GetPrettyName'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'Link'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'AddSelfToPage'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'Show'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'Edit'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet',
+ impl_operation_name => 'RemoveSelfFromPage'
+ );
+
+-- Del the binding
+ acs_sc_binding.del (
+ contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet'
+ );
+
+-- delete the implementation
+
+ acs_sc_impl.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_admin_portlet'
+ );
+
+end;
+/
+show errors
Index: openacs-4/packages/chat-portlet/sql/oracle/chat-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/oracle/chat-portlet-create.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/oracle/chat-portlet-create.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,174 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author Emma (eraffenne@innova.uned.es)
+-- @creation-date 2006-01-04
+-- @version $Id: chat-portlet-create.sql,v 1.1 2006/03/14 12:23:37 emmar Exp $
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id := portal_datasource.new(
+ name => 'chat_portlet',
+ description => 'Chat 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'
+ );
+
+-- chat-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'
+ );
+
+end;
+/
+show errors
+
+declare
+ v_impl_id acs_sc_impls.impl_id%TYPE;
+begin
+
+ -- create the implementation
+ v_impl_id := acs_sc_impl.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_pretty_name => 'Chat portlet',
+ impl_owner_name => 'chat_portlet'
+ );
+
+ -- add all the hooks
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'GetMyName',
+ impl_alias => 'chat_portlet::get_my_name',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'GetPrettyName',
+ impl_alias => 'chat_portlet::get_pretty_name',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'Link',
+ impl_alias => 'chat_portlet::link',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'AddSelfToPage',
+ impl_alias => 'chat_portlet::add_self_to_page',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'Show',
+ impl_alias => 'chat_portlet::show',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'Edit',
+ impl_alias => 'chat_portlet::edit',
+ impl_pl => 'TCL'
+ );
+
+ v_impl_id := acs_sc_impl_alias.new (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'RemoveSelfFromPage',
+ impl_alias => 'chat_portlet::remove_self_from_page',
+ impl_pl => 'TCL'
+ );
+
+-- Add the binding
+ acs_sc_binding.new (
+ contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet'
+ );
+
+end;
+/
+show errors
+
+-- Admin portlet
+@@ chat-admin-portlet-create.sql
Index: openacs-4/packages/chat-portlet/sql/oracle/chat-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/oracle/chat-portlet-drop.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/oracle/chat-portlet-drop.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,101 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author Emma (eraffenne@innova.uned.es)
+-- @creation-date 2006-01-04
+-- @version $Id: chat-portlet-drop.sql,v 1.1 2006/03/14 12:23:37 emmar Exp $
+
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+ v_impl_id acs_sc_impls.impl_id%TYPE;
+begin
+
+ select datasource_id into ds_id
+ from portal_datasources
+ where name = 'chat_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
+ portal_datasource.del(ds_id);
+ end if;
+
+-- drop the hooks
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'GetMyName'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'GetPrettyName'
+ );
+
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'Link'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'AddSelfToPage'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'Show'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'Edit'
+ );
+
+ v_impl_id := acs_sc_impl_alias.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet',
+ impl_operation_name => 'RemoveSelfFromPage'
+ );
+
+-- Drop the binding
+ acs_sc_binding.delete (
+ contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet'
+ );
+
+-- drop the impl
+ acs_sc_impl.del (
+ impl_contract_name => 'portal_datasource',
+ impl_name => 'chat_portlet'
+ );
+
+end;
+/
+show errors
+
+@@ chat-admin-portlet-drop.sql
Index: openacs-4/packages/chat-portlet/sql/postgresql/chat-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/postgresql/chat-admin-portlet-create.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/postgresql/chat-admin-portlet-create.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,179 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author agustin (Agustin.Lopez@uv.es)
+-- @creation-date 2004-10-10
+-- @version $Id: chat-admin-portlet-create.sql,v 0.1 2004/10/10
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id = portal_datasource__new( ''chat_admin_portlet'', ''Chat 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''
+);
+
+-- chat_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'',
+ ''chat_admin_portlet'',
+ ''chat_admin_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new(
+ ''portal_datasource'',
+ ''chat_admin_portlet'',
+ ''GetMyName'',
+ ''chat_admin_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_admin_portlet'',
+ ''GetPrettyName'',
+ ''chat_admin_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_admin_portlet'',
+ ''Link'',
+ ''chat_admin_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_admin_portlet'',
+ ''AddSelfToPage'',
+ ''chat_admin_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_admin_portlet'',
+ ''Show'',
+ ''chat_admin_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_admin_portlet'',
+ ''Edit'',
+ ''chat_admin_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_admin_portlet'',
+ ''RemoveSelfFromPage'',
+ ''chat_admin_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''chat_admin_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+
Index: openacs-4/packages/chat-portlet/sql/postgresql/chat-admin-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/postgresql/chat-admin-portlet-drop.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/postgresql/chat-admin-portlet-drop.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,104 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author agustin (Agustin.Lopez@uv.es)
+-- @creation-date 2004-10-10
+-- @version $Id: chat-admin-portlet-drop.sql,v 0.1 2004/10/10
+
+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 = ''chat_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',
+ 'chat_admin_portlet'
+);
+
+-- delete all the hooks
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet',
+ 'GetMyName'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet',
+ 'GetPrettyName'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet',
+ 'Link'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet',
+ 'AddSelfToPage'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet',
+ 'Show'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet',
+ 'Edit'
+);
+
+select acs_sc_impl_alias__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet',
+ 'RemoveSelfFromPage'
+);
+
+-- Add the binding
+select acs_sc_binding__delete (
+ 'portal_datasource',
+ 'chat_admin_portlet'
+);
Index: openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-create.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-create.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,184 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author agustin (Agustin.Lopez@uv.es)
+-- @creation-date 2004-10-10
+-- @version $Id: chat-portlet-create.sql,v 0.1 2004/10/10
+
+create function inline_0()
+returns integer as '
+declare
+ ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+ ds_id = portal_datasource__new(
+ ''chat_portlet'', -- Name
+ ''Chat 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''
+);
+
+-- chat-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'',
+ ''chat_portlet'',
+ ''chat_portlet''
+ );
+
+ -- add all the hooks
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''GetMyName'',
+ ''chat_portlet::get_my_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''GetPrettyName'',
+ ''chat_portlet::get_pretty_name'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''Link'',
+ ''chat_portlet::link'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''AddSelfToPage'',
+ ''chat_portlet::add_self_to_page'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''Show'',
+ ''chat_portlet::show'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''Edit'',
+ ''chat_portlet::edit'',
+ ''TCL''
+ );
+
+ perform acs_sc_impl_alias__new (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''RemoveSelfFromPage'',
+ ''chat_portlet::remove_self_from_page'',
+ ''TCL''
+ );
+
+ -- Add the binding
+ perform acs_sc_binding__new (
+ ''portal_datasource'',
+ ''chat_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+
+drop function inline_1();
+
+
+\i chat-admin-portlet-create.sql
Index: openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-drop.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-drop.sql 14 Mar 2006 12:23:37 -0000 1.1
@@ -0,0 +1,108 @@
+--
+-- Copyright (C) 2004 University of Valencia
+--
+-- 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.
+--
+--
+-- Procedures to support the chat portlet
+--
+-- @author agustin (Agustin.Lopez@uv.es)
+-- @creation-date 2004-10-10
+-- @version $Id: chat-portlet-drop.sql,v 0.1 2004/10/10
+
+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 = ''chat_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'',
+ ''chat_portlet'',
+ ''GetMyName''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''GetPrettyName''
+ );
+
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''Link''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''AddSelfToPage''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''Show''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''Edit''
+ );
+
+ perform acs_sc_impl_alias__delete (
+ ''portal_datasource'',
+ ''chat_portlet'',
+ ''RemoveSelfFromPage''
+ );
+
+ -- Drop the binding
+ perform acs_sc_binding__delete (
+ ''portal_datasource'',
+ ''chat_portlet''
+ );
+
+ -- drop the impl
+ perform acs_sc_impl__delete (
+ ''portal_datasource'',
+ ''chat_portlet''
+ );
+
+ return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+\i chat-admin-portlet-drop.sql
+
+
+
+
Index: openacs-4/packages/chat-portlet/tcl/chat-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/tcl/chat-admin-portlet-procs.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/tcl/chat-admin-portlet-procs.tcl 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,90 @@
+#
+# Copyright (C) 2004 University of Valencia
+#
+# 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 chat admin portlet
+
+ @author agustin (Agustin.Lopez@uv.es)
+ @creation-date 2004-10-10
+ @version $Id: chat-admin-portlet-procs.tcl,v 0.1 2004/10/10
+
+}
+
+namespace eval chat_admin_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "chat_admin_portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "#chat-portlet.admin_pretty_name#"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "chat-portlet"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-page_name ""}
+ {-package_id:required}
+ } {
+ Adds a chat admin PE to the given portal
+
+ @param portal_id The page to add self to
+ @param package_id The package_id of the chat 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 chat 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 "chat-admin-portlet"
+
+ }
+
+}
Index: openacs-4/packages/chat-portlet/tcl/chat-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/tcl/chat-portlet-procs.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/tcl/chat-portlet-procs.tcl 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,98 @@
+#
+# Copyright (C) 2004 University of Valencia
+#
+# 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 chat portlet
+
+ @author agustin (Agustin.Lopez@uv.es)
+ @creation-date 2004-10-10
+ @version $Id: chat-portlet-procs.tcl,v 0.1 2004/10/10
+
+}
+
+namespace eval chat_portlet {
+
+ ad_proc -private get_my_name {
+ } {
+ return "chat_portlet"
+ }
+
+ ad_proc -private my_package_key {
+ } {
+ return "chat-portlet"
+ }
+
+ ad_proc -public get_pretty_name {
+ } {
+ return "#chat-portlet.pretty_name#"
+ }
+
+ ad_proc -public link {
+ } {
+ return ""
+ }
+
+ ad_proc -public add_self_to_page {
+ {-portal_id:required}
+ {-page_name ""}
+ {-package_id:required}
+ {-extra_params ""}
+ {-force_region ""}
+ {-param_action:required}
+ } {
+ add the portlet element to the given portal
+ } {
+ return [portal::add_element_parameters \
+ -portal_id $portal_id \
+ -page_name $page_name \
+ -pretty_name [get_pretty_name] \
+ -portlet_name [get_my_name] \
+ -key package_id \
+ -value $package_id \
+ -force_region $force_region \
+ -extra_params $extra_params \
+ -param_action $param_action
+ ]
+ }
+
+ ad_proc -public remove_self_from_page {
+ {-portal_id:required}
+ {-package_id:required}
+ } {
+ Removes a chat PE from the given page or the package_id of the
+ chat 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 "chat-portlet"
+ }
+
+}
Index: openacs-4/packages/chat-portlet/www/chat-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/www/chat-admin-portlet.adp,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/www/chat-admin-portlet.adp 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,22 @@
+<%
+ #
+ # Copyright (C) 2004 University of Valencia
+ #
+ # 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/packages/chat-portlet/www/chat-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/www/chat-admin-portlet.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/www/chat-admin-portlet.tcl 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2004 University of Valencia
+#
+# 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_page_contract {
+ The display logic for the chat admin portlet
+
+ @author agustin (Agustin.Lopez@uv.es)
+ @creation-date 2004-10-10
+ @version $Id: chat-admin-portlet.tcl,v 0.1 2004/10/10
+
+} -properties {
+}
+
+array set config $cf
+set user_id [ad_conn user_id]
+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 chat for admin purposes"
+}
+
+set package_id [lindex $list_of_package_ids 0]
+
+set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
+
+ad_return_template
Index: openacs-4/packages/chat-portlet/www/chat-portlet-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/www/chat-portlet-oracle.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/www/chat-portlet-oracle.xql 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,48 @@
+
+
+
+oracle8.1.6
+
+
+
+ select rm.room_id,
+ rm.pretty_name as pretty_name,
+ rm.description as description,
+ rm.moderated_p,
+ rm.active_p,
+ rm.archive_p,
+ acs_permission.permission_p(room_id, :user_id, 'chat_room_admin') as admin_p,
+ acs_permission.permission_p(room_id, :user_id, 'chat_read') as user_p,
+ (select site_node.url(site_nodes.node_id)
+ from site_nodes
+ where site_nodes.object_id = obj.context_id) as base_url
+ from chat_rooms rm,
+ acs_objects obj
+ where rm.room_id = obj.object_id
+ and obj.context_id IN ($sep_package_ids)
+ order by rm.pretty_name
+
+
+
+
+
+ select rm.room_id,
+ rm.pretty_name as pretty_name,
+ rm.description as description,
+ rm.moderated_p,
+ rm.active_p,
+ rm.archive_p,
+ acs_permission.permission_p(room_id, :user_id, 'chat_room_admin') as admin_p,
+ acs_permission.permission_p(room_id, :user_id, 'chat_read') as user_p,
+ (select site_node.url(site_nodes.node_id)
+ from site_nodes
+ where site_nodes.object_id = obj.context_id) as base_url
+ from chat_rooms rm,
+ acs_objects obj
+ where rm.room_id = obj.object_id
+ order by rm.pretty_name
+
+
+
+
+
Index: openacs-4/packages/chat-portlet/www/chat-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/www/chat-portlet-postgresql.xql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/www/chat-portlet-postgresql.xql 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,48 @@
+
+
+
+postgresql7.1
+
+
+
+ select rm.room_id,
+ rm.pretty_name as pretty_name,
+ rm.description as description,
+ rm.moderated_p,
+ rm.active_p,
+ rm.archive_p,
+ acs_permission__permission_p(room_id, :user_id, 'chat_room_admin') as admin_p,
+ acs_permission__permission_p(room_id, :user_id, 'chat_read') as user_p,
+ (select site_node__url(site_nodes.node_id)
+ from site_nodes
+ where site_nodes.object_id = obj.context_id) as base_url
+ from chat_rooms rm,
+ acs_objects obj
+ where rm.room_id = obj.object_id
+ and obj.context_id IN ($sep_package_ids)
+ order by rm.pretty_name
+
+
+
+
+
+ select rm.room_id,
+ rm.pretty_name as pretty_name,
+ rm.description as description,
+ rm.moderated_p,
+ rm.active_p,
+ rm.archive_p,
+ acs_permission__permission_p(room_id, :user_id, 'chat_room_admin') as admin_p,
+ acs_permission__permission_p(room_id, :user_id, 'chat_read') as user_p,
+ (select site_node__url(site_nodes.node_id)
+ from site_nodes
+ where site_nodes.object_id = obj.context_id) as base_url
+ from chat_rooms rm,
+ acs_objects obj
+ where rm.room_id = obj.object_id
+ order by rm.pretty_name
+
+
+
+
+
Index: openacs-4/packages/chat-portlet/www/chat-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/www/chat-portlet.adp,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/www/chat-portlet.adp 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,70 @@
+<%
+ #
+ # Copyright (C) 2004 University of Valencia
+ #
+ # 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.
+ #
+%>
+
+@context;noquote@
+#chat.Chat_main_page#
+
+
+[#chat.Create_a_new_room#]
+
+
+
+#chat.There_are_no_rooms_available#
+
+
+
+ <% set num_rooms 0 %>
+
+ <%
+ set can_see 0
+ if {($rooms(active_p) eq "t" && $rooms(user_p) eq "t") || ($rooms(admin_p) eq "t")} {
+ set can_see 1
+ set num_rooms [expr $num_rooms + 1]
+ }
+ %>
+
+
+ @rooms.pretty_name@ |
+
+ [ HTML | java ]
+ |
+
+
+ [#chat.room_admin#]
+
+
+ (NO #chat.Active#)
+
+ <%
+ if {$inside_comm_p eq "1"} {
+ set desc [string range $rooms(description) 0 50]
+ } else {
+ set desc $rooms(keyclub)
+ }
+ %>
+ |
+ @desc@
+ |
+
+
+
+
+ #chat.There_are_no_rooms_available#
+
+
+
Index: openacs-4/packages/chat-portlet/www/chat-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/www/chat-portlet.tcl,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/chat-portlet/www/chat-portlet.tcl 14 Mar 2006 12:23:38 -0000 1.1
@@ -0,0 +1,63 @@
+#
+# Copyright (C) 2004 University of Valencia
+#
+# 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_page_contract {
+ The display logic for the chat portlet
+
+ @author agustin (Agustin.Lopez@uv.es)
+ @creation-date 2004-10-10
+ @version $Id: chat-portlet.tcl,v 0.1 2004/10/10
+
+} -properties {
+ context:onevalue
+ user_id:onevalue
+ room_create_p:onevalue
+ rooms:multirow
+}
+
+array set config $cf
+set list_of_package_ids $config(package_id)
+set user_id [ad_conn user_id]
+set sep_package_ids [join $list_of_package_ids ", "]
+
+if {[llength $list_of_package_ids] == 1} {
+ set single_p "t"
+} else {
+ set single_p "f"
+}
+
+set context [list]
+set shaded_p $config(shaded_p)
+set chat_url "[ad_conn package_url]/chat/"
+set community_id [dotlrn_community::get_community_id]
+set room_create_p [ad_permission_p $user_id chat_room_create]
+set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0]
+if {[exists_and_not_null community_id]} {
+ #We are in portal for one class or community
+ set inside_comm_p 1
+ db_multirow rooms rooms_list {}
+} else {
+ #We are in user portal
+ set inside_comm_p 0
+ db_multirow -extend { keyclub } rooms rooms_list_all {} {
+ set keyclub [dotlrn_community::get_community_description -community_id [dotlrn_community::get_community_id_from_url -url $base_url]]
+ if {$keyclub eq ""} {
+ set keyclub $description
+ }
+ }
+}
+ad_return_template
+