Forum OpenACS Development: dotlrn chat

Collapse
Posted by carlos delgado on
hello
I have installed the ChaT Package, but in the moment to enter to a chat room, the following message appears:

"could not reach chat server"

Do I need to install any chat server???

any idea about does it happend??

carlos

Collapse
2: Re: dotlrn chat (response to 1)
Posted by Rodrigo Proença on
Hi Carlos,

The Chat package use a Java CHat Server. To make it work, you need a JRE on server machine, compile all .java archives in the folder /packages/chat/java, put the path of JAVA/bin on the nsd-postgres. Perhaps one proxy between the computers blocks the comunication, the default port is 8000, then use the HTML chat client.

To start Java server use the command: java -classpath [acs_root_dir]/packages/chat/java adChatServer start 8000 (this procedure is in /chat/tcl/chat-procs.tcl
ad_proc -private chat_start_server )

Collapse
3: Re: dotlrn chat (response to 1)
Posted by Iuri Sampaio on
I'm on the same situation of him but a little diferent.
I've installed and start the caht server and everything, The chat session is working pretty fine but only untill the third level of subgroups, bellow the third level the chat session just doesn't work and i get this message

"could not reach chat server"

That's weird and i have no clue what's going on! :)

iuri

Collapse
4: Re: dotlrn chat (response to 1)
Posted by Rodrigo Proença on
I rewrite the chat package using only TCL without using the JAVA server. If you want i can send for you.

All messages are recorded on database and have two interfaces: Pure HTML whithout auto refresh and a javascript popup windows whith auto refresh (not finish, only work fine on firefox)

Rodrigo

Collapse
5: Re: dotlrn chat (response to 1)
Posted by Dario Roig on
Hi,
Good work.

We in the University of Valencia are using the packages chat, dotlrn-chat and chat-portlet, you could send us the code of the chat server written in tcl

Thank you

Collapse
6: Re: dotlrn chat (response to 1)
Posted by Ben Koot on
Rodrigo,

I have been using http://cbox.ws/ for about 2 years. It has some interesting features that would add value to the OACS javascript. Maybe you can "borrow" some. If you're interested let me know, and I'll send you my log in so you can look under the hood.

Just a thought

Ben

Collapse
10: Re: Re: dotlrn chat (response to 6)
Posted by Rodrigo Proença on
Ben,

I replace a java chat server with Gustaf Neumann xowiki ajax chat (now requires xotcl-core). This is a simple hack of xowiki code, we made an exercise to test the ajax scripts but it can be useful

look at the modified version in the file-storage. features:
-two user interfaces: ajax cliet with auto-refresh and simple HTML version to work on any browsers;
-log messages on db to make transcriptions;
-.lrn integration adding applets and portlets to clubs/class portals.

Comments, suggestions?

Collapse
Posted by Emmanuelle Raffenne on
Hi Rodrigo:

I've installed chat-ajax and xotcl-core. I'm using dotlrn on openacs 5.2.2 (at localhost:8000). When I go to AJAX chat I receive a "file not found" and in the error log:

Error: error flushing "sock19": connection refused
error flushing "sock19": connection refused
while executing
"flush $w"
(procedure "chat_receive_from_server" line 11)
invoked from within
"chat_receive_from_server 127.0.0.1 8200"

I revise my hosts.allow/deny in case, port 8200 is not filtered.

Any idea?

Collapse
Posted by Rodrigo Proença on
Hi Emmanuelle,

Thank you for the interest and sorry for the bug. I leave old archives with JAVA SERVER references in this release. After make a fresh install using dotlrn 2.2 tarball to test i can reporduce your error and clean some code to remove this references.

I sent new version on same folder to replace to older.

After intall chat applet and xotcl-core i receive this error message when I enter in a room

::template::login: unable to dispatch method 'chat_id' during '::template::login chat_id'
::template::login ::xotcl::Object->configure
::chat::Chat ::xotcl::Class->create
::chat::Chat ::xotcl::Class->unknown
invoked from within

To solve this, just add this lines to /packages/acs-bootstrap-installer/bootstrap.tcl

...
# LARS: Load packages/acs-automated-testing/tcl/aa-test-procs.tcl
ns_log Notice "Loading acs-automated-testing specially so other packages can define tests..."
apm_bootstrap_load_libraries -procs acs-automated-testing

+# GN: Should be loaded before user packages such they can use
+ # the xotcl infrastructure
+ if {[file isdirectory $root_directory/packages/xotcl-core]} {
+ apm_bootstrap_load_libraries -procs xotcl-core
+ }

Collapse
13: Re: dotlrn chat (response to 12)
Posted by Gustaf Neumann on
Please note, that when you install xotcl-core, you need two patches in addition to xotcl-core as described in http://media.wu-wien.ac.at/download/README-xotcl-core

cd /tmp
wget http://media.wu-wien.ac.at/download/acs-api-documentation-procs.patch
wget http://media.wu-wien.ac.at/download/acs-bootstrap-installer.patch

cd .../packages
patch -p 0 < /tmp/acs-api-documentation-procs.patch
patch -p 0 < /tmp/acs-bootstrap-installer.patch

Actually, i think these patches do no harm even when xotcl is not installed. As TIPed, they will be in oacs 5.3 anyhow. Would anyone object when i would add these patches to oacs 5.2 and commit these changes?

Collapse
14: Re: dotlrn chat (response to 12)
Posted by Emmanuelle Raffenne on
Rodrigo,

Thanks for the fix. I downloaded the new version, with it the connexion error disappear but I still had the "file not found". I edited tcl/chat-ajax-procs.tcl and remove the leading path:

--- chat-ajax-procs.tcl.OLD 2006-03-03 20:58:23.000000000 +0100
+++ chat-ajax-procs.tcl 2006-03-03 20:59:54.000000000 +0100
@@ -124,10 +124,10 @@
set file [open [acs_root_dir]/$path]; set js [read $file]; close $file
set location [util_current_location]
set path [site_node::get_url_from_object_id -object_id $package_id]
- set login_url $path/ajax/chat?m=login&$context
- set send_url $path/ajax/chat?m=add_msg&$context&msg=
- set get_update "chatSendCmd(\"$path/ajax/chat?m=get_new&$context\",chatReceiver)"
- set get_all "chatSendCmd(\"$path/ajax/chat?m=get_all&$context\",chatReceiver)"
+ set login_url ajax/chat?m=login&$context
+ set send_url ajax/chat?m=add_msg&$context&msg=
+ set get_update "chatSendCmd(\"ajax/chat?m=get_new&$context\",chatReceiver)"
+ set get_all "chatSendCmd(\"ajax/chat?m=get_all&$context\",chatReceiver)"
return "\
<script type='text/javascript' language='javascript'>
$js

and it works fine now.

Collapse
7: Re: dotlrn chat (response to 1)
Posted by Jade Rubick on
Rodrigo,

I'd be interested in the Tcl chat as well. Are you willing to put it in CVS, or have someone else do so?

We'd love to use this.

Collapse
8: Re: dotlrn chat (response to 1)
Posted by Rodrigo Proença on
Hi,
i produced an updated version of CHAT TCL in the file storage. I only change some procedures to write the messages on database and comment the javaserver broadcast. The package work with dotlrn-chat and chat-portlet too.

Ben, send me a login to your site to see the features and help me to make a javascript intrface more simple and functional.

Rodrigo

Collapse
35: Re: Re: dotlrn chat (response to 8)
Posted by gustaf neumann on
There is now an updated version of the chat package in CVS oacs-5-2. It uses either ajax-chat (based of the stuff that i have develoed for xowiki-chat, now moved to xotcl-core) or alternatively the java-chat (depending on a parameter). Peter Alberer did the integration and implemented the list of active users. Earlier versions had some troubles with Safari, but now the major browsers seems to work well. As a new feature, it uses now different colors for displaying users.

If you use it, please get as well a fresh copy of xotcl-core from CVS head.

Collapse
9: Re: dotlrn chat (response to 1)
Posted by Ben Koot on
Done, you've got mail ;-)
Cheers
Ben
Collapse
15: Re: dotlrn chat (response to 1)
Posted by Ryan Gallimore on
Questions:

1. is this XOTcl solution available for oacs 5.1.4 ?
2. Does it display chat messages instantly, or does it refresh the page like html chat?
3. Are there good docs out there to install xotcl?

Thanks!

Collapse
16: Re: Re: dotlrn chat (response to 15)
Posted by Rodrigo Proença on
Hi Ryan,

1. is this XOTcl solution available for oacs 5.1.4 ?
A: Yes, XOTcl is available for oacs 5.1.4. Chat package requires xotcl-core 0.33 and on my tests work on this oacs version.

2. Does it display chat messages instantly, or does it refresh the page like html chat?
A: Yes, the AJAX interface instantly refresh the messages on clients browsers.

3. Are there good docs out there to install xotcl?
Gustaf Neumann has posted a link to documentation http://media.wu-wien.ac.at/download/README-xotcl-core.

To make chat package work without dotlrn, you need comment some lines on /chat/www/room-new-2.tcl

#set comm_id [dotlrn_community::get_community_id]
#if {$comm_id ne ""} {
# chat_user_grant $room_id [dotlrn_community::get_community_id]
#} else {
#-2 Registered Users
#chat_user_grant $room_id -2
#0 Unregistered Visitor
#chat_user_grant $room_id 0
#-1 The Public
chat_user_grant $room_id -1
#}

Collapse
17: Re: Re: Re: dotlrn chat (response to 16)
Posted by Gustaf Neumann on
I have put an updated version of the install instructions to

https://openacs.org/xowiki/pages/en/xotcl-core

I removed that part describing libthread from the mentioned
README-file; libthread is not required for xotcl-core and xowiki.

As Rodrigo mentioned, the ajax-chat is a copy of the xowiki ajax chat; i would actually recommend to install xotcl-core and xowiki and use the ajax-chat from there, since when i make some updates there, they won't show up in the copy in dotlrn-chat. A few days ago, i fixed e.g. a problem with UTF-8 characters.

Collapse
Posted by Rodrigo Proença on
good news Gustaf,

the documentation and fix for UTF-8 characters. I removed the encode part of ajax-chat to resolve this but it lost the HTML tags in messages.

In next release i will place the xowiki dependence to use the ajax-chat from there and add a verification for dotlrn installed package.

Collapse
Posted by Gustaf Neumann on
Great!
Collapse
Posted by Ryan Gallimore on
I fixed it. I had the wrong aolserver path. :P
Collapse
19: Re: dotlrn chat (response to 1)
Posted by Ryan Gallimore on
I followed your directions and XoTcl installed to 5.1.5 without error via the APM. But when I browse to /xotcl I get the following error:

invalid command name "::xotcl::Class"
while executing
"::xotcl::Class allinstances"
invoked from within
"lsort [::xotcl::Class allinstances]"
invoked from within
"foreach cl [lsort [::xotcl::Class allinstances]] {
if {!$all_classes && [string match "::xotcl::*" $cl]} continue

append output "a nam..."
("uplevel" body line 62)
invoked from within
"uplevel {
ad_page_contract {
Show classed defined in the connection threads

@author Gustaf Neumann
@cvs-id $id:$
} -query {
{all_class..."
(procedure "code::tcl::/var/lib/aolserver/vmdemo/packages/xotcl-core/www..." line 2)
invoked from within
"code::tcl::$__adp_stub"
invoked from within
"if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init tcl $__adp_stub
..."
("uplevel" body line 3)
invoked from within
"uplevel {

if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init t..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare "
(procedure "template::adp_parse" line 30)
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 5)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info..."

Collapse
20: Re: Re: dotlrn chat (response to 19)
Posted by Gustaf Neumann on
Ryan wrote:
...I followed your directions and XoTcl installed to 5.1.5 without error via the APM. But when I browse to /xotcl I get the following error:

invalid command name "::xotcl::Class"
while executing
...


Hmm, in my instruction, https://openacs.org/xowiki/pages/en/xotcl-core installing from apm is not mentioned. A couple of weeks ago, i switched from releasing via .apm to releasing via CVS due to various requests from the community. The actual version of the various xotcl modules is in CVS head, and not in the .apm files.

However, this is not likely to be the problem you are facing, the error message does not seem to be version dependent. "::xotcl::Class" is a built-in command xotcl, so in your installation xotcl is not loaded. This points to a problem in step 1 from the above installation instructions.

Collapse
23: Re: dotlrn chat (response to 1)
Posted by Ryan Gallimore on
Ok. I have XoTcl and XoWiki installed.

How do I install the ajax-chat package itself?

Collapse
24: Re: dotlrn chat (response to 1)
Posted by Ryan Gallimore on
Is there a postgresql version of the chat package that works with xotcl? Where can I find it?

Thanks.

Collapse
25: Re: dotlrn chat (response to 1)
Posted by Ryan Gallimore on
Found it:

Download https://openacs.org/storage/download/ajax%20chat%20package?file%5fid=401203

Then copy the chat subfolder to your packages directory, and install it via the APM.

Works great!

Collapse
26: Re: dotlrn chat (response to 1)
Posted by Ryan Gallimore on
I've made some minor tweaks to chat including:

1. Link highlighting
2. Chatter lists (currently only updated on room entry).
3. Number of people in each room.

Gustaf: Can you help with achieving real time user lists with ajax?

Ryan

Collapse
27: Re: Re: dotlrn chat (response to 26)
Posted by Peter Alberer on

hi ryan,

i have uploaded a modification of the ajax-chat package with a real-time user list to the file storage. the link is https://openacs.org/storage/view/openacs_packages/chat_module%5C/chat-2.tgz

i have changed some other things in the package as well, there is now a german translation of most of the keys.

Collapse
28: Re: Re: Re: dotlrn chat (response to 27)
Posted by Carl Robert Blesius on
Good timing Peter.

We are making a java chat (the Arsdigita Java client) vs. AJAX backed chat decision for .LRN 2.2 at the .LRN meeting in the morning and user lists was one of the only things missing.

Could you come to the .LRN meeting in the morning on IRC?

https://openacs.org/irc/

Next Meeting is at 22:00 hours (in Vienna)

http://www.timeanddate.com/worldclock/fixedtime.html?year=2006&month=3&day=14&hour=21&min=0&sec=0

We also need to get you to commit changes to the code base rather than uploading files (file storage is suboptimal if we want to work on this together). We can discuss this in the morning as well.

Carl

Collapse
Posted by Caroline Meeks on
Carl wrote on March 13, 2005

We are making a java chat (the Arsdigita Java client) vs. AJAX backed chat decision for .LRN 2.2 at the .LRN meeting in the morning and user lists was one of the only things missing.

Could I get a pointer to the results of this discussion please?
Collapse
Posted by Peter Alberer on
Result was that both solutions should be working in parallel (users should be able to choose a parameter value on the package instance). The ajax version needs xotcl and displays a warning if the default client is set to ajax and xotcl is not available.

The current status is that i have merged the changes from the ajax version with the version that was in cvs.

Collapse
29: Re: dotlrn chat (response to 1)
Posted by Peter Alberer on
Hi carl,

unfortunately i arrived to late at the chat room yesterday evening. has there been made a decision on the subject?

i would be glad to commit something to the cvs but i cannot be sure if everything i do and change in the package is what others want. probably some parts should be commited, others not.

for example i have removed the functionality to edit a protocol before saving it. i do not think it is necessay to edit a protocol. a protocol should state exactly what has happened, if someone can edit it, who knows what has actually happened in the chat?

So who makes decisions about
- the development plan for the package and
- what is useful to all of the community?

Collapse
30: Re: Res: Re: dotlrn chat (response to 29)
Posted by Emmanuelle Raffenne on
Peter,

.LRN meeting is today, tuesday march 14th at 22h (Vienna time).

I hope you'll be able to join so we can discuss all this tonight.

Collapse
31: Re: Re: dotlrn chat (response to 29)
Posted by Malte Sussdorff on
Peter, you could always encapsulate the functionality you don't need in a parameter, e.g. "AllowEditP".
Collapse
32: Re: Re: Re: dotlrn chat (response to 31)
Posted by Carl Robert Blesius on
Allowing modification of a chat protocol by end users introduces all kinds of social issues.

Let's keep it simple for now and let people that want to modify public record use sql.

End users that want to edit the protocol can use their computer's clipboard and publish it somewhere else in the system.