Building and depoying the OneSocialWeb Web client
Clone this wiki locally
This page addresses the needs of developers eager to play with the code of the OneSocialWeb web client. It describes how to import the various components in Eclipse, how to use GWT to compile the client, and how to install the compiled files to make them accessible in a web browser for testing.
The contents of this page reflect the steps I had to take in order to build/modify/use the OneSocialWeb client. So I’m to blame for any errors it contains, and as Perlists like to say TIMTOWDY.
The easiest way to compile and build the OneSocialWeb Web client is maybe to start from a working installation of an already installed Web client. Thus, in order to successfully build the OneSocialWeb Web client, you’ll need the following components :
- A working installation of Eclipse with the GWT plugins properly installed.
- A working installation of the OneSocialWeb Web client.
- The Git revision control toolkit.
Downloading the source code
As the web client module has several dependencies on other OneSocialWeb modules, all of these need to be available in Eclipse before the project can be built successfully. The easiest way to install these modules is through Git. It is recommended to start from a newly created empty directory in which the following commands will take care of the downloads :
git clone http://github.com/onesocialweb/osw-model.git
git clone http://github.com/onesocialweb/osw-lib-gwt.git
git clone http://github.com/onesocialweb/osw-web.git
The net result is the presence of three directories, each corresponding to one of the modules :
Creating the Eclipse project structure
In your eclipse workspace, the three projects can now be imported, one at a time, using General → File System as import source, and choosing each of the three directories as From Directory. It is recommended to import the modules in the following order :
(before importing you need to create three GWT projects, using File → New → Web Application Project – IMPORTANT: uncheck “Use Google App Engine”)
After importing osw-lib-gwt project, it is necessary to add project osw-model to the former’s Java Build Path project references. Similarly, project osw-web needs the two other projects to be referenced in it’s Java Build Path. And for all of them, it’s safer to add JUnit 4 (which should be present in almost all Eclipse installations) to the list of libraries, always in the Java Build Path. Although JUnit is not required to run and compile the client.
Compiling the client
Compiling the client with GWT is performed by selecting the osw-web project and using the Google → GWT menu item. In the dialog box that appears, a list of two entry points is displayed. Only one of them, OswClient – org.onesocialweb.gwt has to be kept, the other one Appfuse – org.appfuse.client must be removed. After it’s removal, the compilation stage should complete successfully.
Installing the client files
The easiest way to use the compiled files is to copy them directly “in-place”. The
war folder of the osw-web project contains an
OswClient subdirectory with a set of files generated by the compilation. If the document root of the currently working web client is
/var/www/onesocialweb, it is thus possible to erase it’s
OswClient subdirectory and to replace it with the
OswClient subdirectory of the
war folder in the osw-web project. Any changes made to the client should now be accessible with the URL of the previously installed web client.