Chat on the RAP
The vision of single sourcing is upon us and has huge potential to vastly reduce the amount of code we need to write where similar functionality is to be delivered on both a web browser and a rich desktop client.
I’ve put together a fairly primitive chat room that uses the rich ajax platform we’ve all been hearing a lot about. If you’d like to install it and have a look at the code you can follow the steps below.
Install the Rich Ajax Platform, taken from http://www.eclipse.org/rap/gettingstarted.php:
For Eclipse 3.4 or later...
- With Eclipse up and running, select the Help > Software Updates... menu entry.
- Select the Available Software tab and click the Add Site... button.
- In the upcoming Add Site dialog, enter enter the RAP Update Site URL http://download.eclipse.org/technology/rap/update-site. Click OK to create the new update site entry.
- The entry you just created now appears in the update site list. Select its check box and click Install....
- The Install wizard will let you review the selected items to install, confirm with Next to continue the installation.
- Accept the terms in the license agreement and click the Finish button.
- The feature and plug-ins will now be downloaded from the site and installed locally. Note that you may be prompted to confirm if it is ok to install unsigned jar files.
- Confirm the following prompt to restart Eclipse.
After Eclipse restarts, a welcome page is displayed. Select the Rich Ajax Platform (RAP) section and choose Install Target Platform on the following page. In the upcoming dialog confirm the default values, which starts the target installation process.
Running the Project
Once RAP is downloaded, import galang.research.rap.app.1.1.zip from
- Click file -> import -> Existing Projects into workspace
Select archive file, Click browse, lockate galang.research.rap.app.zip on your local pc, click finish:
Your eclipse should look something like this after the import has finished:
Right click the galang.research.rap.app.launch , click run as , click galang.research.rap.app, click send message and you should get the following. Notice the validation messages working just like they do in RCP.
Start up Internet Explorer/Other, copy and paste the url and append &theme=org.eclipse.rap.dw.demotheme to see RAP themes in action and to simulate another chat client. Feel free to leave a comment if you have any trouble installing. Ill try to answers as soon as I can.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)