Modularity

Module: Integrating JBoss Seam and Openbravo

The Openbravo Seam module integrates Seam with Openbravo, making it possible to develop Seam applications on top of Openbravo. The OB Seam module is a special module in that it provides custom implementations of specific Openbravo core (DAL) classes. This is a good example of the extendability provided by Openbravo modularity!

The OB Seam module implements two specific Seam/Openbravo integration points:

  • Session/Transaction handling
  • User context as a Seam component.

Session/Transaction handling: Openbravo uses a so-called open-session-in-view pattern (one Hibernate session per HTTP request), while Seam mainly uses an EntityManager (is equivalent to a Hibernate session) per conversation. The OB Seam module makes it possible to use these two concepts next to eachother. Openbravo Seam automatically detects that a Hibernate session is opened as part of a Seam conversation or independently from a Seam conversation. In the latter case the session-in-view pattern is automatically applied, in the first case Seam takes care of transaction handling.

The user context as a Seam component: the module makes the OBContext object available through the OBUserContext component. The module contains an example of a Seam authenticator which authenticates a user/password against the Openbravo user database, the authenticator adds the Openbravo role in the Seam identity object.

The OB Seam module is shipped with a small example app (developed with RichFaces/JSF) which allows a user to login with his/her Openbravo account and then view the content of all tables available for the current role of the user. The user can switch role to view the content of other tables. The table view is a paging grid with a detail view.

After installing the module (read the install tips here) and starting Openbravo you can reach the example app through this url:
http://localhost:8080/openbravo/web/org.openbravo.base.seam/page/show-entities.xhtml.
Make sure that the browser has enough horizontal space (the grid/detail are layed out horizontally) then login using your Openbravo login/pwd (for example: Openbravo/openbravo).

To help you getting started, there is a short developers manual available here.

The module is available through the central repository. I invite you to try it out, it should be easy to extend the example app. As always feel free to share your experience with us!

Update April 2010

To facilitate the download size, the original Seam module has been split in several modules:

  • Base Seam: the original Seam module now provides the main backend integration with Openbravo but no jsf/user interface parts.
  • Seam Richfaces: provides the JSF and Richfaces parts of Seam.
  • Seam Test: provides the Seam test environment.
Previous post

ERP 2.50: experimenting with PostgreSQL 8.4 and OpenJDK 6

Next post

Openbravo ERP 2.50 MP8 released

No Comment

Leave a reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>