ChatNow! Client Reference
Overview

The ChatNow! client included with ConferenceRoom 2.0 represents a departure from the standard chat client style of the 1.9.x series client. The ChatNow! client is not designed to be a powerful interface, but rather a highly customizable, embeddable user interface. With it's simplistic, modular plug and play approach and extensive graphic options, page designers can create a chat interface optimized for their needs. ChatNow is available only for the ConferenceRoom Enterprise Edition Server.

ChatNow.class The full ChatNow! package actually consists of several applets which function as modules, the most important of which is the actual ChatNow applet. This module is the core engine of ChatNow, and handles all the communication between the chat server and the embedded modules on the web page. It must always be included on a web page and you must always set a NAME attribute in the <APPLET> tags so that the modules may find it. It is an invisible applet, so it will not affect your page layout. You should also give it WIDTH=0 HEIGHT=0 attributes. You should define this applet very early in your web page source, before any of the modules so that it can be loaded before them. Once loaded, the ChatNow applet will establish a connection with the server as a Guest nick and wait for other modules to begin controlling it.

Important notes:
Applet params and PRM files:
Normally, applets take their settings from param statements but with ConferenceRoom before and now with ChatNow!, our applets can have a companion prm file. This file simply lists the params in a more simplified structure. For example, when specifying params in the HTML where the applet is created you would use:
<PARAM NAME="server" VALUE="irc.webmaster.com">

However, in a PRM file you would use:
server=irc.webmaster.com

Not only will using PRM files save typing, it also lets you specify applet params on the server itself, without worry that someone could hijack your chat code and put it on their own server. With most Java applets, someone can simply copy the HTML that creates the applet, change some params to their liking, and put it on their own web page. They essentially get a free copy of the applet, running off your own server. WebMaster, Inc. does this for their backpack service, allowing people to use our resources to put their own registered chat room on their page.
The default PRM files are always read if available, so the params you set in them will always be used. By using PRM files, you can set params and not have to worry about someone changing them as params specified in HTML will not normally override those set in a PRM file. There is an optional override param that will allow you to specify params that can be set from HTML. In the ChatNow! package, the ChatNow class and each module can use PRM files. Each has a default file, and another can be specified with the ssp param. The default file must be named specifically, and can be either in the folder where the Java code (the ChatNow.zip file) exists, or in the folder where the HTML page exists, or both. As per Java security restrictions, the PRM file located with the HTML must be on the same server as the Java code. If both locations are used, the settings in the two files will be combined, with the PRM file located with the HTML taking precedence. An additional file may be specified with the ssp param which must also reside on the same server, and will take precedence over both of the default files. The naming convention for the default PRM files are ChatNow.prm for ChatNow.class and Module.prm for each Module.class. Capitalization is important.

PRM file related params for the ChatNow applet and it's modules are:
Applet params for the ChatNow applet are:

There are a few internal commands that are not sent to the server but have special meaning to ChatNow!:

Internal commands are a way for modules to crosstalk, for example the AutoReply module can issue a cmd_sound command to make CNSoundPlayer play a sound related to a particular server reply, a private message perhaps.

There are a few external commands that are accessible from JavaScript:

Module Descriptions

All modules share a few standard applet params:

HistoryModule.class

This module is designed to show the text of a chat room. Normally you would always want to include this module, as it generally shows what is going on. You can have any number of these on a page, and can 'tune' them to specific rooms if necessary. You also have several graphical options available to customize the look of the module, and take steps to embed it into the page.
Applet params specific to the HistoryModule module are:

There are a few internal commands that are not sent to the server but have special meaning to HistoryModule:

There are a few external commands that are accessible from JavaScript:

UsersModule.class

This module is designed to show users in a chat room. You can also tune this to a specific room like HistoryLog. Some of the graphical options are the same as well. Another feature is that UserLog allows you to customize what happens when you click on a nickname. Build your command, and when you want to insert the nickname that was clicked, use %n.
Applet params specific to the UsersModule module are:

There are a few internal commands that are not sent to the server but have special meaning to UserModule:

There are a few external commands that are accessible from JavaScript:

RoomsModule.class

This module is designed to show available rooms. Some of the graphical options are the same as well. Another feature is that RoomLog allows you to customize what happens when you click on a room. Build your command, and when you want to insert the room that was clicked, use %r. To insert the topic, use %t. To insert the number of users, use %n.
Applet params specific to the RoomsModule module are:

Input.class

This module provides a place to type commands and talk in rooms. It can also be directed to send to a specific room or nickname, and you can have more than one on a page.
Applet params specific to the RoomLog module are:

AutoCommand.class

This module is designed so that you can extend the command set and tailor automatic reactions to specific situations, for example adding a personalized help command. This module has no visual feedback and can be hidden away like ChatNow.class. You may use several commands for the same code or match. It is recommended you use a specific command prefix with an underscore character to avoid creating collisions with actual server commands, otherwise your command will also be sent to the server which may not recognize them. The ChatNow! applet and it's modules use CMD_ as a prefix, and commands with this prefix are never sent to the server. Any command containing an underscore character '_' will never be sent to the server. All commands are received in uppercase form. The AutoCommand applet WILL receive the same commands you send, so take care not to create any infinite loops!
This module has 100 available of a single param:

The format of a command param is:
[cmd];[target];[data];[my command]
Asterisk, '*' may be used for standard pattern matching. Examples are:

There are a few internal commands that are not sent to the server but have special meaning to AutoCommand:

There are a few external commands that are accessible from JavaScript:

AutoReply.class

This module is designed so that you can tailor automatic reactions to specific situations, for example automatically joining a room when you connect to a server. This module has no visual feedback and can be hidden away like ChatNow.class. You may use several replies for the same code or match.
This module has 100 available of a single param:


The format of a reply param is:
[code];[from];[to];[body];[my reply]
Asterisk, '*' may be used for standard pattern matching. Examples are:

There are a few internal commands that are not sent to the server but have special meaning to AutoReply:

There are a few external commands that are accessible from JavaScript:

CNSoundPlayer.class

This module will play incoming or outgoing sounds. Like AutoResponse.class, it has no visual feedback and should be hidden on the page with a 0 width and height.
Applet params for this module are:

There are a few internal commands that are not sent to the server but have special meaning to CNSoundPlayer:

There are a few external commands that are accessible from JavaScript:

TopicBar.class

This module will show a topic and optionally users for a particular room similar to the top lines of the HistoryModule and UsersModule. However, you can place this anywhere on the page.
Applet params for this module are:

There are a few external commands that are accessible from JavaScript:

Submit.class

This module can be used to allow a user to submit a question to a particular target, as well as fill in some key information about the user, such as name, location, etc. It can be either embedded on the page, or accessible as a popup window from a button.
Applet params for this module are:

There are a few external commands that are accessible from JavaScript: