As you may know RAP (Remote Application Platform) is a technology that allows you to run an Eclipse RCP application over the web.
In order to obtain this goal you have to setup a specific RAP Target Platform, for instance the one that RAP itself provides once you install it.
However when you want to use an Eclipse RCP framework over the RAP Platform, you generally have to deal with dependencies, since not all Eclipse frameworks are ready-to-use with RAP, especially those related with the SWT layer.
EMF Parsley provides a proper RAP Target Platform that allows you to start leveraging Parsley potentials to the web the same way you have learned to do with desktop (RCP) development.
To begin with, you need to install the RAP Tools into the IDE. This can be accomplished with the following steps:
After having installed EMF Parsley as described here and created a new workspace, you can setup the EMF Parsley RAP Target Platform in the following way:
You will end up with a RAP-enabled workspace, enhanced by EMF and Parsley!
Here is the fastest way to get a working web application with all the stuff put togheter:
What you will get is a web application that allows you to interact with the model instance as you would do in a desktop (RCP) environment.
In this web application you can see two views:
Of course, since this is a web application, you can also open a browser on another pc or device on the same network and type the address, replacing 127.0.0.1 with the IP of the machine where the application was launched.
The EMF default XMI persistence is certainly very handy to start with, but as soon as you want a more production-ready EMF persistence architecture, well, CDO is for sure the way to go. In fact with CDO you basically have an EMF model instance shared between clients, that also allows the clients to be synchronized with the model changes.
In this example, in order to keep things simple, we will use CDO with an in-memory store (MEMStore) whose contents will be lost once the server is stopped. However CDO can be configured for usage with RDBMS, Object-oriented or NO-SQL databases (see here for details)
To start with we need a CDO Server running and we can obtain it with an example plugin that can be used both in an RCP and in a RAP workspace.
Now we can create the web application that will use the CDO server just started.
The plug-in projects created are:
Then let's start the application
If you happen to see this
just press the refresh button and should see the following
Now feel free to open the same address from more browsers window (yes, on different machines or devices, possibly) and see the power of this technology stack at work!