Showing posts with label rich ajax platform. Show all posts
Showing posts with label rich ajax platform. Show all posts

Saturday, December 6, 2008

GGBLOG – Single Source OSGi Enterprise Architecture Pattern

The following article documents an architectural solution to a problem which I’ve encountered in many enterprise computing environments.

Problem:

There are a wide variety of deployment artifacts which cannot be reused between different deployment environments. Copies of the artifacts are taken and modifications are made to enable compatibility for each different execution environments. Component dependencies on different deployment environments cause the code base to diverge over time and become specific to a particular execution environment. This causes the enterprise code base to grow exponentially for only a linear increase in functionality.

Solution and Consequence:

Utilise OSGi as the execution back plane for service, web and desktop applications. This solution delivers a unified approach to the creation, deployment and management of enterprise bundles. The consequence is that a linear relationship is formed between adding enterprise functionality and the size of the code base that enables it.

Structure:

The diagram below shows the architectural structure of this pattern.

Example Strategy and Code:

Example code is available for download at:

https://sourceforge.net/project/showfiles.php?group_id=228168&package_id=301845

Download OSGiEAPattern.zip

The example strategy and code makes use of:

1) Equinox as the OSGi execution environment,

2) Rich Ajax Platform as the rich web application

3) Rich Client Platform as the rich desktop application,

4) Apache CXF as the Web Service consumer

5) JAX-WS as the service layer

Installing the example code:

Pre requisites:

1) Install eclipse 3.4 (http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR1/eclipse-java-ganymede-SR1-win32.zip)

2) Install the Rich Client Platform (http://www.eclipse.org/rap/gettingstarted.php)

Running the Rich Desktop Application

Start eclipse and new workspace.

Click window -> prefererences -> Plug in development -> target platform -> tick group plug-ins by location, Select or ensure that the target platform location is the standard directory and not pointing to the rich ajax platform plugins.

Click File -> import -> Existing projects into workspace:

Click next -> select archive file -> browse and select the OSGiEAPattern.zip which you can download from https://sourceforge.net/project/showfiles.php?group_id=228168&package_id=301845

Deselect galang.research.rap.hello and click finish

Select Run configurations -> select OSGi -> select new –> deselect workspace and target platform -> tick galang.research.esb -> add required bundles, you should now have 13 bundles selected

Click Run then double click plugin.xml within galang.research.rcp.hello -> click overview

click Launch eclipse application and type in your name and click “Call web service”

Running the Rich Web Application

Ensure that you have installed the Rich Ajax Platform.

http://www.eclipse.org/rap/gettingstarted.php

Start eclipse and a new workspace.

Click window -> prefererences -> Plug in development -> target platform -> tick group plug-ins by location, Select or ensure that the target platform location is the pointing to the rich ajax platform plugins which is located at [ECLIPSE_HOME]/ configuration/org.eclipse.rap.target-1.1.1/eclipse

Click File -> import -> Existing projects into workspace:

Click next -> select archive file -> browse and select the workspaces.zip which you can downloaded from

https://sourceforge.net/project/showfiles.php?group_id=228168&package_id=301845

Download OSGiEAPattern.zip

Deselect galang.research.rcp.hello and click finish

Right click galang.research.rap.hello.launch

type in your name click Call web service

If you have any questions or want to work with me to implement a strategy for this pattern based on your java technology stack feel free to drop me a line (glenn.galang@gmail.com).


Related Articles:

OSGi

http://ggalangblog.blogspot.com/2008/11/ggblog-light-weight-reporting-server-on.html

RAP

http://ggalangblog.blogspot.com/2008/11/ggblog-chat-on-rap.html

RCP

http://ggalangblog.blogspot.com/2008/11/ggblog-dynamic-jface-xml-tableviewer.html

Sunday, November 23, 2008

GGBLOG – Chat on the RAP

I thought I’d check out the rich Ajax platform and see how well my RCP skills carry across. My first impressions are that I’m feeling pretty much at home 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.



Once RAP is installed into eclipse, download and import galang.research.rap.app.zip from

https://sourceforge.net/project/showfiles.php?group_id=228168&package_id=300103.

- 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 answer as soon as I can.