Forum OpenACS Q&A: chat module for OpenACS 4.5

Posted by David Kuczek on
"Is there any progress at all on a chat module for OpenACS 4.x? I
realize that lots of people hate it (based on this and other threads),
but I have a client who is interested in moving from 3.x to 4.x, who
absolutely must have the chat functionality. And regardless of what
you (or I) might think of the existing chat module, this client is
rather pleased with how it works, even though it's simple, limited,
and inefficient.

I would be more than happy to help an effort already in progress --
for something original, or as a front end to either Jabber or IRC. If
there isn't any such effort, then I may simply do a quick-and-dirty
port of the 3.x chat module into 4.x."

by Reuven Lerner


Hello Reueven,

I put your recent post to an old thread into a new one. Hope you don't

Are you talking about html + javascript chat of 3.2.5 or the Java chat
that was ported by Rocael to 3.2.5?

You have several options:

1. Port 3.2.5 html chat to 4.5

I don't think that it's ported yet...

2. Port 3.2.5 Java chat to 4.5

The Java chat is a port by Rocael from ACS 4.x to OACS 3.2.5 with some
enhancements. It shouldn't be too hard to port it back to OACS 4.5. I
think that Rocael wanted to do this, but realized that Jabber might be
the better way to go. Don't know if he changed his mind though.

3. See what Berklee is doing. They need a chat solution for their
deadline. (I *think* August 1st)

There are some thoughts on a chat module based on jabber in this thread.

4. Get in touch with Malte. He integrated Jabber into OACS. They are
using the java applet.

Hope this helps!

Posted by Reuven Lerner on
David, this is definitely a useful start.  Thanks for the summary.

Truth be told, this particular client has extremely simple needs: The chat client has to work on Windows (although other platforms would be nice), we need moderation of some sort, and the conversations must be stored in a database for later perusal and research.  (The site is to promote communication among Israeli Jews and Israeli Arabs, and the research associated with this chat requires logging.)

I really like the idea of using Jabber on the back end.  But based on reviewing the thread on that subject, it seems like there's a long way to go before that'll happen.  Using AIM is somewhat attractive, except for the fact that the logs won't be available to us.  And there are some legal issues associated with schoolchildren on the Internet that we don't want to deal with.  (Already, my modifications to OpenACS 3.x ensure that no one's last name ever appears outside of  administrative screens.)

Whatever Berklee comes up with will undoubtedly be fine for my needs -- but the notices from those folks seemed pretty ambiguous, and I'm not sure if I can wait until August 1st.

The most intriguing and realistic solution appears to be the Java applet.  To be honest, I thought that the "Java chat" that everyone referred to was from ACS 4.x in Java, rather than a Java applet that communicates with the server.  I just tested the applet, and it certainly appears to work well enough for my purposes.

Rocael, would it be possible to use your Java applet, turning it into an OpenACS 4.x package?  Is it available for download and modification from anywhere?  I'll gladly upload the resulting package to; I don't particularly care if it's not part of the main release, but I do need it sooner rather than later.

Posted by Reuven Lerner on
Oh, and one not-so-trivial requirement: The chat module has to support Unicode, so that people can write in English, Hebrew, or Arabic.  Java applets should support Unicode without any trouble (and I know for a fact that Tcl, AOLServer, and PostgreSQL all do), but I just wanted to name all of the requirements before someone suggests a potentially inappropriate solution.
Posted by Jonathan Ellis on
the download link Rocael posted in march is broken.  Can someone make a tarball available?
Posted by Michael Serio on
Berklee will most likely integrate an out-of-the-box java server/client solution short-term due to our time/resource constraints. A $500 package such as one provided by
will get us started. However, we expect to explore an open
source solution after our September launch. I would expect
we'll have something by the end of the year.
Posted by Jonathan Ellis on
what does volano have over NFC?
Posted by Tom Jackson on
I really like the idea of using Jabber on the back end. But based on reviewing the thread on that subject, it seems like there's a long way to go before that'll happen.

The jabber module I wrote can do this, I already wrote a groupchat recording bot. It only took a few hours, so it isn't a big deal. You can use any jabber client to post, and anyone without a jabber client could post through a web form and follow the discussion just like ACS chat, that is with javascript refresh.

If you want to look into it yourself, I think all my files are under .

To be clear, my module turns AOLserver into a jabber client. Anything a jabber client can do works. The easy part is that you can program whatever application you want to in tcl. With a little more effort, you could have AOLserver act as a jabber component, which would be the best situation. If you wanted to maintain persistent connections to AOLserver from a web browser, you could probably easily have the thing work without refresh. One thread could setup and maintain a connection to the jabber server sending the browser each new message. A different window would be used for responding.

Posted by Michael Serio on
what does volano have over NFC?

Good question - didn't know about NFC. I'll check it out. Thanks!

Posted by David Kuczek on
Has anyone been working with NFC Chat before?

It would really be nice to see it running with oacs!

Here is a quick FAQ on NFC:

It is talking about internationalization, database integration and database authentification.

There should be more on their project page:

Posted by Jonathan Ellis on
I worked enough on NFC to write a 12k client as an alternative to the 110k monster it comes with by default.  The protocol is fairly well defined although there were a couple gotchas I had to go read his code for.

Eventually I need to add an OpenACS authentication module, as well as channel ops controlled by OACS.  (Currently the first guy in the channel is the op, and you can hardcode a system-wide op, and that's probably fine for a lot of sites but I'd like to have more control.)  The server code is excessively interface-heavy but otherwise pretty well done.

Right now though I'm kind of burned out on java so I'm having fun with tmda in python.  (Unless Michael wanted to contract with me. :)

Posted by David Kuczek on
Hey Jonathan,

I just installed NFC and I could get the awt-client running with Tomcat and standalone. I didn't manage to work out your thin java client. I therefore have couple questions...

#1 Do you use httptunneling? If yes: how did you set it up?

#2 Do you use Tomcat? If yes: How can I use nfc.tcl with Tomcat, as I had to copy the client code to ~/webapps

#3 the procedures ad_group_id and replace are not part of oacs 3.2.5 but are being used by your code

#4 db_1row in ncf.tcl is not part of oacs 3.2.5

#5 the applet tag in nfc.tcl should have "archive=chatclient_cb.jar" instead of "archive=Client-nopackage"?!

#6 Is "code=Client.class" correct in nfc.tcl?

#7 Whenever I want to open your applet through nfc.tcl I get the following error: Exception: java.lang.ClassFormatError: Client(Bad magic Number)


Posted by Jonathan Ellis on
1. no
2. no, it's just an applet, you don't need a servlet container
3, 4. obviously you'll have to do something more appropriate to your version here.  (the replace function is available at the postgresql cookbook.)
5, 6. If you want it to work with the MS 1.1 VM you'll have to strip out all the package names from the 4 files used in the cb client and recompile.  If you can force all your users to download a modern JVM then you can use the normal jar unmodified.
7. Either your jar is corrupt or your server isn't sending it to the client properly.
Posted by David Kuczek on
Thanks Jonathan,

I still have some problems...

#1 Could you maybe post the code for ad_group_id

#2 In order to use the awt chatclient I followed the instructions and moved the entire web folder to my oacs 3.2.5 under /web/myserver/www/chat/web/. I have client.html chatclient_awt.jar and the folders "resoucres" and "WEB-INF" in there. The only files that would load your applet are nfc.tcl and chatclient_cb.jar which are alos located in the web folder. What 4 files are you talking about and how can I compile them? Any docs? Do you have a precompiled chatclient_cb.jar that I could test? Strangely everything works fine whenever I am using the regular awt chatclient. Well almost everything. The embedded version doesn't work. And thats what I kinda want... an easy embedded version for my users...


Posted by Jonathan Ellis on
look at the code -- all the ad_group_id call is doing is asking "is this person a member of a 3.5 group, if so, give him extra permissions."  so replace with whatever you want to distinguish your admins.  last_name = 'Kuczek' would be a simple one to get you started or just leave it out entirely.

you could wget the jar I use --

Posted by David Kuczek on
Hmmm... thanks for your jar-file, but I still get the error message: "Exception: java.lang.ClassFormatError: Client(Bad magic Number)" The other applet still works fine though. What could I have forgotten? How come the server can't connect to the client?

My applet code looks like this:

  <applet code=Client.class archive=Client-nopackage.jar width=100% height=100%>
    <param name=port value=7777>
    <param name=user value=\"test\">
    <param name=password value=\"test\">
    <param name=channel value=carnage>

Posted by Jonathan Ellis on
Everything I have read suggests this means the client is getting a corrupt jar.  Perhaps something in your web server configuration is causing this.