Home > EBX.Platform Module

EBX.Platform Module

An EBX.Platform module allows the packaging of an adaptation model with its resources: included XML Schema documents, Java classes, etc.

On a J2EE application server, an EBX.Platform module is equivalent to a standard J2EE Web application. This provides features such as class-loading isolation, WAR or EAR packaging, Web resources exposition, hot-redeployment. In addition, if your user application is a Web application, it is possible to merge the EBX.Platform module with your application, in order to simplify the deployment.

Structure

An EBX.Platform module contains the following files:

  1. /WEB-INF/web.xml

    This is the standard J2EE deployment descriptor. It must ensure that the EBX.Platform module is registered when the application server is launched (see Registration section ).

  2. /WEB-INF/ebx/module.xml

    This mandatory document defines the main properties and services of the module.

  3. /www/

    This optional directory contains all external resources (accessible by a public URL). This directory is optional, localized and structured by resource type (html, images, jscripts, stylesheet). External resources in this directory can be referenced in adaptation models (type osd:resource ).

Overview of an EBX.Platform module integrated into a Web application:

Declaration

A module is declared by means of the document /WEB-INF/ebx/module.xml . For example:

<?xml version="1.0encoding="UTF-8"?>
<module xmlns="urn:ebx-schemas:module_2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ebx-schemas:module_2.2 http://schema.orchestranetworks.com/module_2.2.xsd">
              <name>moduleTest</name>
              <locales>
                            <locale isDefault="true">it</locale>
                            <locale>en-US</locale>
              </locales>
</module>

The associated schema provides a documentation on each property. Here is a summary of the main ones:

Element

Description

Required

name

Defines the unique identifier of the module on the server instance. The module name usually corresponds to the Web application's name (the name of the directory).

Yes.

publicPath

If a specific path (different from the above module's name) identifies the web application in the public URLs, defines this path. This path is added to the URL of an external resource of the module, in the case of absolute URL computing. If this field is not present, the public path is the module's name defined above. 

No.

locales

Defines the locales supported by the schema(s) of the module. This list must contain all the locales that can be found in the schemas within the module, and that we want to expose to the end user (EBX.Manager will not be able to display labels and messages in a language that is not declared in this list). If the element is not present, the module's default localization is considered to be "en-US".

No.

services

Declares the UI Services. For more information, see UI Services section .

No.

beans

Declares the reusable Java beans components. For more information, see workflow package .

No.

Registration

In order to be identified by EBX.Platform, a module must be registered at runtime, when the application server is launched. For a Web Application, every EBX.Platform module must:

  1. contain a Servlet whose standard method init invokes ModulesRegister.registerWebApp(…) , see Java code example at the end of this section;

  2. declare this servlet in the deployment descriptor /WEB-INF/web.xml , in the standard way;

  3. ensure that this servlet will be launched at server startup by adding the following standard element to the deployment descriptor: <load-on-startup>1</load-on-startup> .

Example of a J2EE deployment descriptor ( /WEB-INF/web.xml file):

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC 
   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <servlet>
       <servlet-name>InitEbxServlet</servlet-name>
       <servlet-class>com.foo.RegisterServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
    </servlet>
</web-app>

Notes:

Java code example of a servlet that registers/ unregisters the module to/from EBX.Platform:

package com.foo;
import javax.servlet.*;
import javax.servlet.http.*;
import com.onwbp.base.repository.*;
/**
  */

public class RegisterServlet extends HttpServlet
{
              public void init(ServletConfig config) throws ServletException
              {
                            super.init(config);
                            ModulesRegister.registerWebApp(this, config);
              }
              public void destroy()
              {
                            ModulesRegister.unregisterWebApp(thisthis.getServletConfig());
              }
}

Home > EBX.Platform Module