Skip to content

Embedded webapp access to EasySOA from Eclipse

fenrhil edited this page Jul 26, 2012 · 13 revisions

This page gathers information needed to create an webapp designed to be embedded in an Eclipse browser and enabling access to EasySOA features. Some more information is available on the EasySOA consortium mailing list (in french)

Why?

This technique is considered in the EasySOA project in two separate cases (Service connector settings retrieval and Talend Open Studio integration). In both cases, it has the same purpose: allow to extract information from EasySOA in an Eclipse plug-in whithout coupling the plugin to the whole EasySOA model. This kind of "uncoupling layer" is needed because the EasySOA model is frequently subject to changes (at the moment we write these lines, i.e. 2012/07/05).

What?

Ultimately, the webapp shall enable:

  • Automatic authentication to Nuxeo
  • Listing of the services available to the authenticated user
  • Multiple-criteria search among the available services
  • Selection of a set of services to be extracted from the browser to be processed in Eclipse.

Status

Several projects were created in the EasySOA-Incubation repository. They are children of the easysoa-registry-query project. For now, they're only "experimental" projects, focusing more on the exploratory part ("how to do this?") than on the actual achievement of the wanted features.

Technical issue #1: Embed a web UI in Eclipse

Our main technical issue is not only to display a web page in Eclipse, but chiefly to extract information from this page: once the user selected some EasySOA Core objects, we want to know which objects were selected.

It seems the e4 project has carried out an in-depth study of this issue.

To sum up, SWT offers a browser widget. To extract information from this widget, we have several solutions

  1. Use browser listeners, which can listen to several types of events, such as "the URL is about to change/just changed" or "an authentication is required".
  2. Use Javascript-to-Java mappings, which allows to inject a Java function in the browser and expose it as a javascript function to the page. This is somewhat limited, though, since it only allows to exchange simple information, structured either as Doubles, Strings, Booleans or arrays of these types.

In the first case:

  • The user would select objects on the web page, then validate his choice
  • The webapp would redirect the browser to another page, containing raw information about the selection
  • Our Eclipse plugin would detect this change thanks to a listener (by using a URL pattern, or maybe by detecting a content-type change)
  • The Eclipse plugin would then extract information from the page and close the browser

In the second case:

  • The user would select objects on the web page, then validate his choice
  • The webapp would redirect the browser to another page, containing mainly javascript manipulating the information we want
  • The javascript would call our injected Java function with the information we want as arguments
  • The Java function would then extract information from its arguments and close the browser

Technical issue #2: technology of the webapp accessing EasySOA

Nuxeo offers several solutions to access its content through a web UI.

WebEngine

The Nuxeo Webengine is (according to Nuxeo) "a simple yet powerful rendering engine based on Freemarker and JAX-RS". It is a Nuxeo technology, so we can expect full compatibility with the Nuxeo platform. On the downside, it targets front-office applications, thus it does not provide any pre-defined look-and-feel. In particular, the Nuxeo theming system is not available out-of-the-box.

JSF/Seam

For a full integration to Nuxeo, our custom pages should use the same framework as Nuxeo itself: JSF and Seam. Using this technology, we can benefit from pre-existing features such as navigation through the documents tree, a system of document selection that is persistent throughout the session, a themed UI, ...

Detailed documentation

There is entrypoints in the Nuxeo documentation about registering:

  • a new JSF view, which is a full, dynamic XHTML page (*.xhtml extension), or a static non-XHTML document (any other extension).
  • a new Nuxeo ContentView, which is only some part of the page, the one describing the currently displayed document. Faceted search uses content views.
  • new Nuxeo Layouts and Widgets, which are parts of a ContentView.
  • a new Nuxeo Action, which results in a link or a button on the interface, performing either a call to a bean (when attribute "link" is like "#{bean.method()}") or a redirection to some other page (when attribute "link" matches the "from-outcome" part of a "navigation-case", i.e. a JSF view).
Clone this wiki locally