SmartFoxServer AJAX API(Beta) Readme

About

SmartFoxServer AJAX API is Google Web Toolkit (GWT) module that allows you to create cross-browser AJAX multi user applications using Java. SmartFoxServer AJAX API requires the BlueBox installed and active.

NOTE: Please note the following:

Quick Start

You can found quick start guide here .

Usage

You can use the SmartFoxServer AJAX API in the same way as any other GWT module:

  1. Add sfs_ajax_api_dir/api/sfs_ajax_api.jar to your classpath where sfs_ajax_api_dir is the folder where you have unpacked the SmartFoxServer AJAX API
  2. Your module must inherits it.gotoandplay.smartfoxserver.SFS_API module:
    <inherits name="it.gotoandplay.smartfoxserver.SFS_API" />
  3. To test application in hosted mode you need BlueBox running on localhost:8080. If BlueBox is running on different host and/or port you need to make a change in the SmartFoxServer AJAX API source code. In it.gotoandplay.smartfoxserver.server.BlueBoxProxy class change:
    private static final String BLUE_BOX_URL = "http://127.0.0.1:8080/BlueBox/HttpBox.do"; 
    with the correct address.

SmartFoxServer AJAX API and SmartFoxServer AS3 API

SmartFoxServer AJAX API is based on SmartFoxServer AS3 API so you can use the SmartFoxServer AS3 API documentation as reference. There are some differences you should know about:

Examples

There are two examples – chat application and white board. The chat application shows some basic SmartFoxServer functionalities as public and private messaging, room creation. The white board application is a more complicated and shows how SFS can be used with the new <canvas> tag so more complicated graphics features can be added. Also it demonstrates the usage of server side extensions.

How to install the examples

To install the sfsChat example just copy the content of the sfs_ajax_api_dir/examples/sfsChat/www to sfs_install_dir/Server/webserver/webapps/root where:

To install the whiteBoard example follow these steps (whiteBoard example uses server side extension so some additional steps are required):

  1. Copy the content of the sfs_ajax_api_dir/examples/whiteBoard/www to sfs_install_dir/Server/webserver/webapps/root where:
  2. Copy the content of the sfs_ajax_api_dir/examples/whiteBoard/sfsExtension to sfs_install_dir/Server/sfsExtensions
  3. Add the following xml snippet to the zones configuration in the SmartFoxServer configuration xml file:
    <Zone name="whiteBoard" uCountUpdate="false" maxUsers="50" customLogin="false">
    	<Rooms>
    		<Room name="Lobby" maxUsers="50" isPrivate="false" isTemp="false" autoJoin="true" uCountUpdate="false">
    			<Extensions>
    				<extension name="xt" className="whiteBoardExtension.as" type="script" />
    			</Extensions>
    		</Room>
    	</Rooms>
    </Zone>