TIBCO EBX®
Documentation > Developer Guide > Introduction
Navigation modeDocumentation > Developer Guide > Introduction

Packaging TIBCO EBX® modules

An EBX® module is a standard Java EE web application, packaging various resources such as XML Schema documents, Java classes and static resources.

Since EBX® modules are web applications they benefit from features such as class-loading isolation, WAR or EAR packaging, and Web resources exposure.

Module structure

An EBX® module contains the following files:

/WEB-INF/ebx/module.xml

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

/WEB-INF/web.xml

This is the standard Java EE deployment descriptor. It can perform the registration of the EBX® module when the application server is launched. See Module registration.

/META-INF/MANIFEST.MF

Optional. If present, EBX® reports the 'Implementation-Title' and 'Implementation-Version' values to Administration > Technical configuration > Modules and data models.

/www/

This optional directory contains all packaged resources, which are accessible via public URL. See Packaged resources.

Required files for Oracle WebLogic server:

/WEB-INF/weblogic.xml

WebLogic deployment descriptor file which activates the prefer-web-inf-classes policy, such as the following:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
  <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
  </container-descriptor>
</weblogic-web-app>

See weblogic.xml Deployment Descriptor Elements for more information.

Module declaration

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

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

See the associated schema for documentation about each property. The main properties are as follows:

Element

Description

Required

name

Defines the unique identifier of the module in the server instance. The module name usually corresponds to the name of the web application (the name of its directory).

Yes.

publicPath

Defines a path other than the module's name identifying the web application in public URLs. This path is added to the URL of external resources of the module when computing absolute URLs. If this field is not defined, the public path is the module's name, defined above.

No.

services

Declares user services using the legacy API. See Declaration and configuration of legacy user services. From the version 5.8.0, it is strongly advised to use the new user services.

No.

beans

Declares reusable Java bean components. See the workflow package.

No.

ajaxComponents

Declares Ajax components. See Declaring an Ajax component in a module in the Java API.

No.

Module registration

In order to be identifiable by EBX®, a module must be registered at runtime when the application server is launched. For a web application, every EBX® module must:

or:

Additional recommendations and information:

Deployment descriptor example

Here is an example of a Java EE deployment descriptor (/WEB-INF/web.xml):

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0">
	<servlet>
	   <servlet-name>InitEbxServlet</servlet-name>
	   <servlet-class>com.foo.RegisterServlet</servlet-class>
	   <load-on-startup>1</load-on-startup>
	</servlet>
</web-app>

Registration example

Here is an implementation example of the ModuleRegistrationServlet:

package com.foo;
import javax.servlet.*;
import javax.servlet.http.*;
import com.onwbp.base.repository.*;
/**
  */
public class RegisterServlet extends ModuleRegistrationServlet
{

	public void handleRepositoryStartup(ModuleContextOnRepositoryStartup aContext)
		throws OperationException
	{
		// Perform module-specific initializations here
		...
		
		// Declare custom resources here
		aContext.addExternalStyleSheetResource(MyCompanyResources.COMMON_STYLESHEET_URL);
		aContext.addExternalJavaScriptResource(MyCompanyResources.COMMON_JAVASCRIPT_URL);
		
		aContext.addPackagedStyleSheetResource("myModule.css");
		aContext.addPackagedJavaScriptResource("myModule.js");
		
	}
	
	public void handleRepositoryShutdown()
	{
		// Release resources of the current module when the repository is shut down here
		...
	}
	
		public void destroyBeforeUnregisterModule()
	{
		// Perform operations when this servlet is being taken out of service here
		...
	}

}

Packaged resources

The packaged resources are files and documents that can be directly accessed from client browsers and can be managed and specified either as osd:resource fields or via the Java API. They have various types and can also be localized.

Directory structure

The packaged resources must be located under the following directory structure:

  1. On the first level, the directory /www/ must be located at the root of the module (web application).

  2. On the second level, the directory must specify the localization. It can be:

    • common/ should contain all the resources to be used by default, either because they are locale-independent or as the default localization (in EBX®, the default localization is en, namely English);

    • {lang}/ when localization is required for the resources located underneath, with {lang} to be replaced by the actual locale code; it should correspond to the locales supported by EBX®; for more information, see Configuring EBX® localization.

  3. On the third level, the directory must specify the resource type. It can be:

    • jscripts/ for JavaScript resources;

    • stylesheets/ for Cascading Style Sheet (CSS) resources;

    • html/ for HTML resources;

    • icons/ for icon typed resources;

    • images/ for image typed resources.

Example

In this example, the image logoWithText.jpg is the only resource that is localized:

/www
 ├── common
 │   ├── images
 │   │   ├── myCompanyLogo.jpg
 │   │   └── logoWithText.jpg
 │   ├── jscripts
 │   │   └── myCompanyCommon.js
 │   └── stylesheets
 │       └── myCompanyCommon.css
 ├── de
 │   └── images
 │       └── logoWithText.jpg
 └── fr
     └── images
         └── logoWithText.jpg
Documentation > Developer Guide > Introduction