Software Documentation

CFAgent (Alpha 0.1 release)

There are four parts to deal with in CFAgent
  • CFAgent Administrator
  • CFAgent Master
  • CFAgent Customer
  • CFWeb Client

Installation

Install the jar files in your preferred directory and include them in your classpath.
If you download the source code, please compile them first and follow the instructions
given below. All the property files required by different applications are also explained in this
document. You need jdk1.4 to run the applications.

The files are currently distributed as gzip files:
  • CFAgent (Admin, Master and Client) is distributed as cfagent.tar.gz
  • ChatForte (The basic collaboration framework) is distributed as chatforte.tar.gz
  • CFWeb (Web client for CFAgent) is distributed as cfweb.tar.gz
  • Fortes (ChatForte, CFAgent, CFWeb) is the combination of all the packages and is
    distributed as fortes.tar.gz
Compile all the source code downloaded using
javac -d <classpath directory> -classpath <classpath directory> *.java

CFAgent Administrator

    Administrator is responsible for starting/stopping the server, registering new masters, creating sessions and other admin related things. A GUI is provided for this purpose. Start the program as follows

   java -classpath <path of cfAgentAdmin.jar or classes directory> com.cfagent.system.CFAgentServer  <path of chatforte config file> <path of cfagent config file>

If you have downloaded the source code, please compile them first and make sure that the following packages are included in your classpath

com.chatforte.comm
com.cfagent.comm
com.chatforte.ex
com.chatforte.system
com.cfagent.system

   The config files are where the system properties are stored. These properties relate to database information such as drivers, which database implementation to be used (file based database, mysql database or your own implementation), username, password and lots of other things such as debugging options, logo pointers and what kind of message are supported by the system, what kind of information to use for refining customer queries etc. These files are the chatforte.props file and cfagent.props file that can be found under com/cfagent/system.The menus will take you to different screens that provide different features. Some of the screens are not supported as of now.

CFAgent Master

   Master is equivalent to the customer service representative for online customer service. Master is responsible for answering to customer queries after they are transferred to the session conducted by the master. Master is also responsible for setting different security permissions to the session on top of what the administrator has already set. This facility is currently not supported. Start the master program as follows

  java -classpath <path of cfAgentMaster.jar or the classes directory> com.cfagent.master.CFAgentMaster

If you have downloaded the source code, please compile them first and make sure that the following packages are included in your classpath

com.chatforte.comm
com.cfagent.comm
com.chatforte.ex
com.chatforte.peer
com.cfagent.peer
com.cfagent.customer
com.cfagent.master

The master interface expects two files in the directory where the program is invoked. These files are peer.config (general configuration similar to the one used by the system as mentioned above) and peermessages.info (what messages are supported at the master's end). This interface is very similar to the one used by the client except for the security features and registration (the masters are registered only by the admin and hence can only login using the supplied username and password).

CFAgent Client


   The customer can use the interface to ask questions/queries. When the queries cannot be answered by the corresponding representatives (automatic or manual), the customer will be transparently transferred to different sessions that addresses their topic of interest. To start this program

  java -classpath <path of cfAgentCustomer.jar or the classes directory> com.cfagent.customer.CFAgentCustomer

Currently the master and the client code are Java applications and will be changed to Java applets in the next version.

If have downloaded the source code, compile the source code first.

The customer code is dependent on the following packages
com.chatforte.comm
com.cfagent.comm
com.chatforte.peer
com.cfagent.peer
com.cfagent.customer
com.chatforte.ex

Please make sure that the classes for the above packages appear in your classpath

The client interface expects two files similar to the one expected by the CFAgent Master.

CFWeb

This has been tested using Tomcat 4.0.1. Please carry out the following steps to deploy the same

If you download cfWeb.war, simply copy it under webapps directory which should get you going.

If you download the source code,  then compile the source code

  • Create cfweb directory under webapps
    The tree under cfweb should look like the following
    cfweb/WEB-INF
    cfweb/WEB-INF/classes
    cfweb/service 
  • Copy web.xml distributed under the source code (com/cfweb/controller) into
    cfweb/WEB-INF
    If web.xml is not distributed under the above directory, copy the following into an empty file and name it as web.xml

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">

    <web-app>

        <!-- Define servlets that are included in the chatforte application -->

        <servlet>
            <servlet-name>
                chatforte
            </servlet-name>
            <servlet-class>
                com.cfweb.controller.CFWebController
            </servlet-class>
        </servlet>

        <servlet-mapping>
            <servlet-name>
                chatforte
            </servlet-name>
            <url-pattern>
                /chatlet
            </url-pattern>
        </servlet-mapping>

    </web-app>


  • The required classes should be present under cfweb/WEB-INF/classes
    The servlet code is dependent on the following packages
    com.cfweb.controller
    com.chatforte.comm
    com.cfagent.comm
    com.cfagent.customer
    com.chatforte.peer|
    com.cfagent.peer
    com.chatforte.ex
  • Copy the .jsp files under the distributed source code (com/cfweb/view) under
    cfweb/service (or) symbolically link the cfweb/service directory to
    com/cfweb/view directory. 
  • This is very critical. You must copy peer.config under webapps/cfweb and refer to peermessages.info by its absolute path in peer.config file. i.e. You need to change the value of MESSAGEINFO attribute to the absolute path of the file (peermessages.info). In addition, the jsp code might refer to localhost:8080 in all of its code, which you need to change to your hostname and port. Otherwise the CFWeb client will not work

Invoke CFWeb using the following URL

http://<yourhost>:<port>/cfweb/service/CFWebRegistration.jsp

Note : You must have your CFAgent Administrator running before starting your tomcat engine to use CFWeb.

From this point onwards, you will be automatically taken to other screens if everything is successful.

MySQL Database Backend

In order to deploy MySQL backend, do the following

  • Install MySQL database 
  • Create a database for storing and retrieving information
  • Create atleast one database user for the database created in the above step
  • Load the tables specified in two files namely chatforte chatforte_mysql.sql and cfagent_mysql.sql into your
    database
  • Make the following modifications in chatforte.props file
    • Leave the following line as is if you would like to use the MySQL DB
      DBPROVIDER=chatforte.system.ChatForteDBMysqlImpl|
      NOTE: The other two implementations for the DB (ChatForteDBImpl and ChatForteDBSerialImpl)
      do not implement a lot of the DB methods that are required and my sincere advise for not using them right now.
    • Change the DBNAME=chatforte line to the name of the database that you have created in step 2.
    • Change the DBURL=jdbc:mysql://localhost to wherever your database backend is hosted
    • Change the DBUSER and DBPASSWD lines according to the corresponding username and password
      that you have created
    • Change the DBDRIVER to whatever jdbc driver that you use to access the MySQL database

The above steps should get you started with the MySQL backend.

Refining Customer Queries

This portion explains you how to refine the customer queries in order to utilize the automated response to its fullest potential. The future versions of CFAgent will improvise on this feature further.

There are currently four files that are available to let the user take the full control of this feature.
  • prepositions.txt  (this file consists of all the prepositions that can be removed from the customer query)
  • misc.txt (this file consists of question words, alphabets and other words that are irrelevant)
  • domaindemux.txt (this file lists out different words that can be put as one word)
  • domainmux.txt (this file lists out different synonyms of a single word that can be used to make the query
    address much broader category)

Please take a look at the above files to understand more about this concept.

The following lines in the cfagent..props should change if you wish to store your words in a different file
PREPOSITION=./prepositions.txt
CFMISC=./misc.txt
DOMAINDEMUX=./domaindemux.txt
DOMAINMUX=./domainmux.txt

System Properties File

The system properties file is stored under com/cfagent/system in chatforte.props file and properties specific to CFAgent is stored under com/cfagent/system in cfagent.props file.

The content of these files is explained below

DEBUG=FILE (For logging purposes. If you don't want file logging, please leave it empty or simply enter CONSOLE instead of FILE)

LOGDIR=./logs (You need to create this directory under chatforte/system, if you enable the file logging service. Otherwise you will get  the following error "Unable to set File Logger Service!. Check system properties file")

LOGFILENAME=chatforte (You need to provide this property if you enable file logging service. Right now, the logging will be distributed among 20 files starting from chatforte0 to chatforte19, one per execution)

DBPROVIDER=chatforte.system.ChatForteDBMysqlImpl (This is the default implementation for MySQL database backend. The instructions for setting up MySQL backend is given above. The other implementations do not work at present.)

DBNAME=chatforte (The database name for archiving and retrieving information)

DBURL=jdbc:mysql://localhost (The jdbc url for the database driver chosen)

DBUSER=blah (Username for the database access)

DBPASSWD=foo (Password for the username to access database)

DBDRIVER=com.mysql.jdbc.Driver (The jdbc driver to access the database backend)

MESSAGEINFO=./systemmessages.info (This is very important. Through this, the CFAgent system knows which version of the message to be used for the protocol communication. Please DO NOT EDIT/DELETE  this file)

LOGO=./chatfortelogo.jpg  (The ChatForte logo. If you would like to use someother logo here,  you are welcome to do it)

TIMEOUT=600000 (Currently not used)

# The following are specific to CFAgent application (cfagent.props)

PREPOSITION=./prepositions.txt  (Ref to Refining Customer Queries section)

CFMISC=./misc.txt  (Ref to Refining Customer Queries section)

DOMAINDEMUX=./domaindemux.txt  (Ref to Refining Customer Queries section)

DOMAINMUX=./domainmux.txt  (Ref to Refining Customer Queries section)

Client Properties File (Customer and Master)

This file is named peer.config under customer and master directories
The file content is explained below

MESSAGEINFO=./peermessages.info (This file stores the message versioning for protocol communication. Please DO NOT EDIT/DELETE this file)

LOGO=./chatfortelogo.jpg (The logo that appears on the default screen. You can replace this with whatever logo you wish)

LOGDIR=./logs (This is required if you enable file logging instead of console logging. You must create this directory, if you want to avoid any errors in starting the client/master application)

LOGFILE=cfclient (This is the name of the log file where the logging information is stored)

DEBUG=FILE (If you want to disable file based logging, leave it empty or simply enter CONSOLE)

TIMEOUT=600000 (This is timeout for how long the customer/master connection can remain idle before it is disconnected from the CFAgent server. This is given in milliseconds.)

SOCKET_WAIT=20000 (This is the timeout for the socket connection to the server. If the server does not respond within this time limit, no connection will be made and no more waiting on the socket. This is also given in milliseconds)

Miscellaneous

The confusion due to source code overlap between different packages (ChatForte, CFAgent and CFWeb) have been resolved since this release.