Target Audience: CAST Administrators
Summary: This document provides a guide based on CAST’s field experience on how to configure GWT based applications using CAST AIP. These configurations are used all versions of CAST AIP 8.2.x and above for GWT offering (see Reference Materials below for links) to overcome limitations such as missing links. The applicability of this guide should have assessed for newer versions of CAST AIP and Extension.
Introduction to GWT
This section gives a brief overview of the framework.
In a nutshell,
- Google Web Toolkit (GWT) is a development toolkit to create RICH Internet Application(RIA).
- GWT provides developers option to write client side application in JAVA.
A GWT application consists of following four important parts out of which last part is optional but first three parts are mandatory:
- Module descriptors
- Public resources
- Client-side code
- Server-side code
Versions of GWT Supported by CAST
File Types expected for CAST Analysis
This section highlights all the file types that can be expected to be delivered if the application has implemented this framework.
How to identify the implementation of GWT:
This section details the approach for identifying the presence of GWT in the code delivered.
A module descriptor is the configuration file in the form of XML which is used to configure a GWT application. A module descriptor file extension is *.gwt.xml, where * is the name of the application and this file should reside in the project's root. Following will be the module descriptor Helloworld.gwt.xml for a Helloworld application. This xml contains the Entry Point class and the source-path.
The most important public resource is host page which is used to invoke actual GWT application. A typical HTML host page for an application might not include any visible HTML body content at all but it is always expected to include GWT application via a <script.../> tag as follows:
For example Entry Point code will be used as client side code and its location will be specified using <source path="path" />. A module entry-point is any class that is assignable to EntryPoint and that can be constructed without parameters. When a module is loaded, every entry point class is instantiated and its EntryPoint.onModuleLoad() method gets called. A sample HelloWorld Entry Point class will be as follows:
The server side part of your application and its very much optional. If you are not doing any backend processing with-in your application then you do not need this part, but if there is some processing required at backend and your client-side application interact with the server then you will have to develop these components.
Every user interface considers the following three main aspects which is added to the client side part code and these classes can be set as Entry Point classes in CAST:
- UI elements : Thes are the core visual elements the user eventually sees and interacts with. GWT provides a huge list of widely used and common elements varying from basic to complex which we will cover in this tutorial.
- Layouts: They define how UI elements should be organized on the screen and provide a final look and feel to the GUI (Graphical User Interface). This part will be covered in Layout chapter.
- Behavior: These are events which occur when the user interacts with UI elements. This part will be covered in Event Handling chapter.
This section gives a brief overview of GWT.
GWT UI Elements:
The GWT library provides classes in a well-defined class hierarchy to create complex web-based user interfaces. All classes in this component hierarchy has been derived from the UIObject base class as shown below:
How to configure GWT in CAST AIP:
This section describes all the CAST configuration steps to be followed in order to configure GWT based application.
Reference for other patterns of GWT
Pattern 1 – GWT
1. Architecture Diagram:
1.1. Code Snippet:
1.2.. Representative Code Flow
JSP -> GWT Client Module -> GWT Place -> GWT Activity/View -> GWT RequestFactory Proxy -> GWT RequestFactory Service -> Hibernate -> Database(extends ContentView, start from step 5)
2. CertificationPlace.java (....\com\....\tfx\client\mvp\CertificationPlace.java)
Pattern 2 – GWT
Server manager Configuration:
Pre Analysis Configuration:
This section gives an overview of the Enlighten diagram.
This section describes the CMS Configuration which is required to set for GWT.
This section describes the TCC configuration which needs to be set.
- Standard Configuration
a. Classes which extends Widget
- Custom Configuration
a. GWT View classes which extends ContentView
b. Classes which extends WidgetDisplay
c. Classes which extends Composite
d. Classes which extends EntryPoint
e. Classes which extends BasePresenter
- Cast does not support GWT out-of-box.