RADE Web Application Composer

Web Application Editor

Working with the Web Application Builder

Building a Web Application with JDialog

Technical Article

Abstract

This article describes the use of the Web Application Editor embedded in IRAD 6.0.


Before You Start

Make sure you have:

Creating a Web Application

Before starting 

First of all, a Dynamic Web Project must be created by using the standard wizards of IRAD 6.0.

A Web Application can only be created in a CAAV5 workspace. There are 2 ways to create it:

The workspace must contain a framework containing your Web Application, a module for its associated java controller files and a package. They can be created using Java Interactive Dashboard tools (wizards in IRAD 6.0 are also provided by the JID RADE product for CAAV5 framework and module creation)

Using the IRAD 6.0 Wizard

The Web Application builder provides a wizard to create easily a new Web Application. To access this wizard, from the File menu, select New->Other...->CAA e-application/Web Application Builder file.

This wizard creates the following files:

The IdentityCard.h of your framework and the Imakefile.mk of your module are automatically modified to include your build dependencies.

At the end of the wizard process, all essential resources ( files ) required by a web application are available, and the user can now proceed with designing his application and thereby populating the files.

[Top]

Creating the Graphic User Interface

Web Application Builder provides you with a toolbox that enables you to create a web application. The tools contained in this toolbox are the following:

Processes and sub-processes

A Web Application is composed of a main process (necessarily a Wizard process) and can contain many sub-processes. You can call a sub-process from the main process but you cannot call a sub-process from another one. A sub process can be started from any page of the main process. When the sub-process has unrolled its execution, it returns to the page where it was called from. When the main process ends, you return where you started the Web Application.

There are 2 types of processes:

[Top]

Pages

When called, a process displays its starting page, and then follows sequentially through all the pages until the last page is reached, then the application returns to the calling process. When the last page of the main process is reached, the application finishes.

A page is characterized by its properties and events (You can perform actions on each of those events). To access this information, right-click the page in the Outline view, and select Properties.

Properties

Events on pages

  • Name : internal Jdialog name of the page
onCreate dispatched at the initialization of the application for each page composing your Web Application
  • Visibility : if checked the page will be shown at the execution
onDestroy When your Web Application finishes an 'onDestroy' event is dispatched for each page too.
  • Template : the name of the XMLDlg files where the UI of the page is stored
onShow dispatched from a page when the page appears on screen. It's a common way to initialize your page
  • Title : the NLS name of the page
onHide dispatched from a page when the page is replaced by another one. It is always dispatched before events such as : onNext, onPrevious, onOk, onApply, onCancel, onFinish.
onNext Those events are enabled depending of the position of the page and on the kind of the parent process. They are dispatched when the click of the corresponding button occurs.
onPrevious
onOk
onApply
onCancel
onFinish

Widgets

If you want to know more about widgets, see Working with DialogBuilder.

    The DialogBuilder lets you manipulate JDialog basic widgets, as well as your own custom widgets. 

    Setting widgets

    The properties of the widgets are available in Read/Write mode. To set a property with a constant value, you can either right-click the widget and select Properties from the Layout tab or from the Behavior tab, and set the property. If you want to read or write a property with a value computed at runtime, set it by creating data links in the Behavior tab.

    Inserting widgets

    Standard

    You can insert any widgets into the current page. To do so, proceed as follows:

    • click this widget in the toolbar or
    • select it from the Insert Menu.
    The layout manager is a "Grid layout" implementation. Grid Layout is a very common layout manager for many UI Builders. Grid layout is very powerful and should allow you to create almost any layout.

     The position of the widget is given by a grid layout. For more information about widgets and grid layout please refer to JDialog Documentation.

    Custom

    You can also insert your own custom widgets in your layout. A custom widget is a widget defined by the user in terms of render and behavior.

    To do so, proceed as follows:

    • Declare your own custom widgets so that they are available in the DialogBuilder
    • Create a new XMLWidget file and store it in the resources\widget directory of the runtimeview. This XMLWidget file must be stored in the runtimeview of the current workspace, or in the concatenation of its prerequisites workspaces.
      When creating this file, use the following syntax: <?xml version="1.0"?> <Widget Description="a comment to describe the widget" class="Complete name of the widget implementation class" />.

     For this new widget to be taken into account by the DialogBuilder, 2 images must be declared, one for the icon symbolizing the custom widget, the other for the layout in the DialogBuilder.

    • Add the following tags to the XMLWidget file:
      Icon="name of the icon located in resource\graphic so that the widget is displayed in the Insert menu in DialogBuilder" Preview="Name of an image located in the resource\graphic directory used by the DialogBuilder when the widget is inserted into the JDialog page"
    • From the Insert menu, select the Others sub-menu.
    • Select the widget you want to insert. All custom widgets found in the runtime view concatenation of your workspace are displayed and can be used from here. For more information about custom widgets refer to JDialog Documentation.

    For each XMLWidget file found in the runtime view of your workspace or in the runtime view of your prerequisite workspaces, the corresponding icon is added in the DialogBuilder Toolbar, allowing you to manipulate a custom widget the same way as any basic JDialog widget. When a custom widget is inserted in a window, the preview image declared in the XMLWidget file is used for the layout in DialogBuilder.

    Remember that: XMLWidget files must be located in the resources\widget directory, and the 2 images for the Icon and the Layout must be located in the resources\graphic directory of the runtime view. Don't forget to update your workspace's runtime view after creating your custom widget, by running mkCreateRuntimeView or mkrtv, in order to see it from within the DialogBuilder. 

    By default, the widget is inserted into the first empty cell found in the layout. If there are no empty cells, a new row is created at the bottom of the layout.

     

    Publishing widgets

    Publishing a widget enables you to use this widget in a behavior. It means that you will be able to assign a role to this widget event and to access and modify its properties in a behavior.

    To publish a widget, proceed as follows:

    1. Double-click the widget to access the Properties window.
    2. Assign it a variable name (use the Properties view or the Properties dialog box.) The variable name given to the widget appears in the Outline View along with the icon corresponding to its type.
    Behaviors can only modify the properties of published widgets. Widgets that are not published or simply not visible. The scope of a widget is the page of the wizard that contains it.

    Resetting a published widget

    You can reset published widgets. This deletes the variable name. In other words, the widget cannot be used in behaviors any longer but it still appears in the layout.

     

    Deleting a widget

    If you delete a widget from a behavior, you simply remove it from the graph. But it will not be deleted from the page layout. If you want to remove it permanently from the layout, select it  and delete it from the Layout tab. You will be asked to confirm the delete operation. A widget can potentially be used by all the behaviors of your application. Make sure before deleting a widget that no behavior is using it.

    To delete a widget, proceed as follows:

    1. Right-click the widget that you want to delete in the Outline view.
    2. Select Delete. A dialog box is displayed asking you to confirm the delete operation.
    Be careful when deleting a widget. Triggered behaviors on this widget will be deleted too if those behaviors are no more triggered by other widgets.

                    Grid Layout

                The layout manager provided by JDialog is a "Grid Layout" implementation. Grid Layout is a very common layout manager for many UI builders. Grid layout is 
                very powerful and should allow you to create almost any layout. For more information on how JDialog manages the Grid Layout, see Defining the command
                layout

[Top]

Defining Behaviors and Logic

We have seen previously how to create a Graphic User Interface. Now you are going to learn how to define 'behaviors' triggered by the user interface events and to define the logic of your application.

Behaviors

[Top]

[Top]

[Top]

[Top]

           Input and Output parameters

Web Applications support input and output arguments, which enables them to communicate with other applications. 

 

Input Parameter

Output Parameter

What is it? An input argument is an argument enabling users to use other parameters in inputs of their applications.

WAC applications support only a single argument which can be of 2 types:

  • String and String[]: Available only for Web applications not integrated into 3d com.
  • PortalUID and PortalUID[]: Available only for Web applications integrated into 3d com. a PortalUID is a universal identifier allowing you to identify any object in the portal interface
    PortalUID is automatically selected if the multi selection is not available for the Web application integrated in 3d com.
    PortalUID[] is automatically selected if the multiselection is available for the Web application integrated in 3d com.

An output argument is an argument enabling you to execute the following pre-defined actions:

  • display an error message

  • stack an other command

  • send an event to the hookup (Make sure that the API used to manage the hookup is CAA).

WAC applications support only a unique argument. This argument is a String which values are identified, and limited to a set of possible values. They correspond to of pre-defined actions requests, such as displaying a message box or an error message, stacking another command, …

Three different helpers are available to create the  3 types of output in the Build OutputParameter category.

Creating Input/Output parameters To create an input parameter, proceed as follows:
  1. If not already done, click the Behavior tab.
  2. In the Create Component menu, click Input Parameter () and click anywhere in the editor (grey area.)
  3. Select its type in the scrolling list and click OK. The input parameter is created.
To create an output parameter, proceed as follows:
  1. If not already done, click the Behavior tab.
  2. In the Create Component menu, click Output Parameter () and click anywhere in the editor (grey area.)
  3. Select its type in the scrolling list and click OK. The output parameter is created.

Ensuring the integration of your application into 3dcom

This step can only be performed at creation!

You can now integrate your web applications into 3d com. To do so, use the Integration with portal field in the Create XMLCtrl dialog box.

  1. Check the available check box. Multisel allowed for this and the Support history of recent object accessed options are enabled.
    • Multisel allowed for this command, if checked, enables you to select several files in 3dcom Modular.
    • Support history of recent object accessed: if the application was launched using a particular file, this file is logged in the list.
  2. Select the icon that will be associated to the application in portal.
  3. Click Add in the Object type field and enter the type of files that will be supported.

Running the Web Application using a standard browser

  1. Use the CAA Project -> Create->Update Runtime view...
  1. Deploy your application on your Websphere Application Server. To do so, use Run on server to deploy on a Test Server inside IRAD 6.0, or use the standard deployment procedure described in 3dcom Installation guide / Installing Version 5 / Integrating Modular 3d com into IBM Websphere Application Server to deploy on a production WAS.
  1. Run your server, and enter following URL in Internet Explorer:

        http://hostname:portnumber/RootURI/portal  

    http://localhost:9080/RootURI_ForYourProject/html/EApp/webappname  

where webappname is the name of the XMLCtrl generated file.

See Creating Your First Web Application for more details on this subject.

In the starter area (the banner on the left side of the screen), you can access a container named "WebApp Starter". This container displays the list of all Web Applications created with Web Application Builder tool, found in the runtime view. So you should see your particular Web Application in the list. Just double-click its name to run it in the portal.

[Top]


References

[1] JDialog Documentation Home Page
[2] JDialog Overview
[3] Creating Your First Web Application
[4] Creating an Application to be Integrated to Modular 3Dcom
[Top]

History

Version: 1.00 [July 2003] Document created
Version: 1.10 [August 2003]
Document updated
Version: 1.20 [May 2004]
Document updated
Version: 1.30 [July 2005]
Document updated
   

Copyright © 1994-2005, Dassault Systèmes. All rights reserved.