Overview of web components

You use web components to create, modify, and execute rules in a web browser. The Decision Center web components are provided as standalone components.

Web components are server-side Java™ components that have a graphical representation on an HTML client, normally a web browser. These components have been designed so that you can easily embed them in a servlet or in a JSP environment.

Web components can be displayed on the latest versions of Internet Explorer and Firefox. A web component that is embedded in a servlet or a JSP runs on all browsers without any browser-dependent code, although the HTML code that is dispatched to the client page is browser-dependent.

Web components consist of three Java packages:

  • ilog.webui.dhtml: The generic API, with its underlying framework, for manipulating web components in a servlet or a JSP environment.

  • ilog.webui.dhtml.components: The classes of generic web components, such as tabbed pane, table, or tree.

  • ilog.rules.webui: The classes of the components specific to rule editing (Rule Editor, decision table editor, decision tree editor).

Web component classes are located in <InstallDir>/teamserver/lib/jrules-teamserver.jar.

To make a standalone web application, you may also need the following JAR files, as shown in the servercomponents sample:

  • jrules-engine.jar

  • jrules-language.jar

  • jrules-ruleartifacts.jar

  • jsf-api-*.jar

  • commons-logging-*.jar

  • commons-httpclient-*.jar

  • commons-codec-*.jar

  • spring-*.jar

You can deploy any number of web components simultaneously, and embed the web components in your environment. Embedding a component requires a working knowledge of servlet/JSP technologies.

Note:

To use web components in a JSF page, you must call the web component APIs during the JSF rendering phase. You can use the following JSF tag to call the web component API in a method of a JSF Bean, which is called during the JSF rendering phase:

<%@ taglib uri="http://www.ilog.com/jrules/teamserver" prefix="teamserver" %>
<teamserver:webComponentPrinter invoke="#{MyBean.myWebComponent}"/>

The invoked method must take an argument of type IlxWPort.

You can customize the display of the web components in a browser using Cascading Style Sheets (CSSs). For more information about display customization, see CSS customization.

Generic web components

The following components are generic web components that resemble Swing APIs.

Component Description
Tree

Class: IlrWTree

This class implements a web-based version of the Swing JTree component. When loaded on a web browser it displays a set of data as a hierarchical outline. The model for this class is a Swing tree model (javax.swing.tree.TreeModel).

Message list

Class: IlxWMessageList

This class implements a simple web component that can display a list of text messages and message boxes when loaded on a web browser.

Action holder

Class: IlxWActionHolder

This class implements a hidden component that holds an action (an instance of the class IlxWAction). For more information about actions and action holders, see User-defined actions for the web components.

Menu bar

Classes:

These classes implement a menu bar that you can integrate in your web-based application.

The Menu Bar component contains a set of menus that are themselves made of a set of menu items.

Rule editing components

This section describes the components specific to rule editing, that is, the Web Rule Editor and the Web Decision Table Editor.

Note:

When using the web rule editing components, you must include the webcomponents.css file, available in skins/common/css.

The Web Rule Editor implements the class ilog.rules.webui.IlrWSyntacticEditor (see IlrWSyntacticEditor). This class implements the web-based version of the guided editor in Rule Designer. You can integrate it to your web application to provide business-rule editing capabilities.

Web Rule Editor

Several methods are inherited from IlxWComponent; they are part of the framework, like IlrWSyntacticEditor.print. The Web Rule Editor component offers the setBRLRuleElement method that allows you to set up the component. Several other methods are available with the Web Rule Editor. They are described in the Java API Reference Manual under ilog.rules.webui.

The Web decision table editor is similar to the editor in Rule Designer, but with fewer features. In particular, you cannot change the structure of a table. For information about the different features of the Web decision table editor and how to use them, see Editing decision tables.

The class IlrDTWTableComponent implements the web-based version of the decision table editor in Rule Designer. You can reuse it to display a decision table in a web application built using web components.

Web decision table editor

IlrDTWTableComponent is the main class of the Decision Table API. It acts as a container that holds the table itself and the editor. This class requires an auxiliary panel to hold the editor.