Archive

Archive for the ‘Eclipse RAP’ Category

Eclipse RCP/RAP and Remoting with JAX-RS, Spring Data JPA and CXF DOSGi [step4]

juin 18, 2012 8 commentaires

In [step3] we have managed our UserService on Client and Server side with JAX-RS and Apache CXF DOSGi.

Embedding an HTTP server in Equinox

At this step the server side works with the HTTP Server Jetty which is an OSGi bundles. This mode is called Embedding an HTTP server in OSGi container : it means that HTTP server and WEB application are OSGi bundles. The OSGi container starts the HTTP server bundle. Embedding an HTTP server in Equinox explains how this mean is done with Equinox.

You can resume « embedding an HTTP server in OSGi container » like this :

OSGi container -> HTTP Server (bundle) -> WEB Application (bundle).

Equinox in a Servlet Container (ServletBridge)

It works great but sometimes you have not the luck to have an HTTP Server which supports OSGi like Apache Tomcat. For instance in our case, when we wished to deploy our XDocReport RAP Application on CloudBees, whish provides an Non OSGI HTTP Server Apache Tomcat.

Fortunatly, Server-Side Equinox provides Embedding OSGi container in a servlet container mode : it means that it’s a WEB Application which contains the OSGi container (and another bundles) which start the OSGi container. Equinox in a Servlet Container explains how this mean is done with Equinox.
You can resume « embedding OSGi container in a servlet container » like this :

HTTP Server -> WEB Application -> OSGi container.

To manage this mode you must create a classic WAR which hosts your OSGi plugins and ServletBridge. In this article we will explain how to create a WAR with our UserService on server side with the Eclipse Plug-In Libra WAR Product which was created for creating WAR from RAP Application launches. But it can be used too with OSGi launches (like we need in this article).

To create a WAR of CXF DOSGi application (server side), you must :

  • register your JAX-RS service with HttpService :
    <!-- HttpService -->
    <entry key="org.apache.cxf.rs.httpservice.context" value="/UserService" />
    
  • create a WAR which hosts OSGi bundles and ServletBridge. WAR Product gives you the capability to create a *.warproduct file from a launch (RAP, RCP, OSGi lanches, etc). This *.warproduct file is used to export it into a WAR to generate WAR.

At the end of this article we will create the the cxf-dosgi-jpa.war WAR. I have deployed this WAR on the CloudBees to see it on action. You can test for instance go at http://cxf-dosgi-war.opensagres.cloudbees.net/UserService/user/findAll to see JSON of the all users.

Lire la suite…

Publicités

Create a WAR from RAP Application with Libra WAR Product [step3]

juin 13, 2012 2 commentaires

In [step2] we have created WAR Product files from RAP launches. In this article we will generate WAR by using the export WAR feature of the WAR Product to generates two WARs:

We will deploy generated WARs in a non OSGi HTTP Server Apache Tomcat. You can see the online demo of the rap-jpa.war created with WAR Product deployed on CloudBees which provides an Apache Tomcat at http://rap-war.opensagres.cloudbees.net/eclipsespring.

We will see in this article that projects of eclipsespring_step10.zip contains 2 problems when WAR will be exported and deployed:

  • .qualifier must not used in the Host of fragments.
  • pay attention with build.properties of Plug-in /Fragments which must include the whole files (META-INF, fragment.xml, plugin.xml, etc).

Those 2 errors are interesting because it works with RAP launch but not with WAR Product.

Lire la suite…

Catégories :Eclipse RAP, Libra, WAR Product

Create a WAR from RAP Application with Libra WAR Product [step2]

juin 13, 2012 3 commentaires

In the [step1] we have installed (My) WAR Product Plug-in. In this article we will create two WAR products from the 2 RAP launches:

  • RAP Client – JPA Dao launch starts RAP Application which displays paginated users list from Database Derby (it uses JPA implementation for Dao).
  • RAP Client – Mock Dao launch starts RAP Application which displays paginated users list from Java Map (it uses Mock implementation for Dao).

At the end of this article we will have 2 WAR Products :

In the next article [step3] we will generate two WARs from the two WAR Products created in this article by using the Export WAR action.

Lire la suite…

Catégories :Eclipse RAP, Libra, WAR Product

Create a WAR from RAP Application with Libra WAR Product [step1]

juin 12, 2012 5 commentaires

In the Eclipse RCP/RAP with Spring DM, Spring Data JPA and Remoting [step10] article we have created a RAP Application which displays list of user with pagination :

Now we wish create a classic WAR of the RAP Application to deploy the RAP Application with any HTTP Server (which doesn’t support OSGi, like Apache Tomcat). This WAR will be created by using the Libra WAR Product.

You can see the online demo of the rap-jpa.war created with WAR Product deployed on CloudBees which provides an Apache Tomcat at http://rap-war.opensagres.cloudbees.net/eclipsespring.

Lire la suite…

Catégories :Eclipse RAP, Libra, WAR Product

Eclipse RCP/RAP with Spring DM, Spring Data JPA and Remoting [step10]

avril 16, 2012 6 commentaires

In [step9] we have displayed the User List with pagination by using Nebula Pagination Control and Spring Data JPA. As Nebula Pagination Control supports RAP, it’s possible with few modifications of the fr.opensagres.richclient to support WEB mode too with Eclipse RAP:

At the end of this article we will have an Application which supports:

The sources of the fr.opensagres.richclient Plug-In will be the same: it’s called Single-Sourcing.

Lire la suite…

Eclipse RCP/RAP with Spring DM, Spring Data JPA and Remoting [step0]

avril 5, 2012 3 commentaires

XDocReport project provides a modular Eclipse RCP/RAP XDocReport application where you can develop your own module with Eclipse Plugin to manage your domain with CRUD Form and generates some reporting. The online RAP demo provides for instance a Resume module to manage resume (create/update/search resume and generate report resume):

This application is based on :

  • Eclipse RCP to provide Fat Rich Client.
  • Eclipse RAP to provide the same application in WEB mode
  • Eclipse Gemini Blueprint to use Spring on OSGi context. This project is the donation of the Spring DM project to Eclipse
  • Spring Data JPA is used to implement our DAO with JPA. This Spring project is very impressive because you need not code your JPA Query. You must just follow some convention name with your methode DAO interface and that’s all! Spring Data JPA implements (at runtime) for you the JPA DAO.
  • Eclipselink used as JPA Implementation.

You can find sources from this Eclipse RCP/RAP application on Git.

Our 2 next goals is :

  • manage remoting to provide too Client (RCP Client) and Server (Services on server side) architecture. To do that we have several solutions like :
  • use Eclipse E4 instead of Eclipse RCP as soon as Eclipse RAP will support Eclipse E4.

We spent much time to study how to manage those technologies together but today we like this architecture. Goal of my « Eclipse RCP/RAP with Spring DM, Spring Data JPA and Remoting » articles is to explain step by step how to develop a simple Eclipse RCP/RAP with those Spring technologies, shares several rules that we have discovered with Spring on OSGi context, and manages 2 architectures :

To follow those articles, you must know OSGi, Eclipse RCP:

You can read the next article [step1] which explains how to initialize Spring DM.

Eclipse Nebula Pagination Control

janvier 6, 2012 13 commentaires

In business application with large data, display data in a table with navigation page can be really helpful. In our XDocReport project, we need this feature in our Eclipse RCP/RAP XDocReport application for instance to select resumes to open in the Search Resume Dialog :

This last screenshot is the resume search dialog in WEB context (Eclipse RAP). Here a screenshot in fat client context (Eclipse RCP) :

After several search, it seems that there is no project which provides a SWT pagination control, which works with Eclipse RCP and RAP. So we decided to develop this control and give our code to Eclipse Nebula Project. Today Nebula Team are voting if the project will be accepted or not. Pagination control was accepted by Nebula and today it is stored on Eclipse Nebula Git.

If you are intersted you can read the original bug 367064.

Lire la suite…