Create a basic HATS project
Contents
- Overview
- Start HATS Studio
- HATS Welcome page
- Start HATS functions
- HATS tips
- Develop your HATS project
- Create a HATS project
- Preview your project
Overview
This section shows how to create a simple, working HATS application that uses default values.
All of the steps in developing a HATS application are performed using the WebSphere Studio workbench. The workbench is the user interface and integrated development environment from which you launch wizards to create resources, view lists of resources, and use editors to modify resources. It also contains help information about both HATS and WebSphere Studio.
When you start WebSphere Studio, you see a single window in which one or more perspectives are displayed. A perspective is a collection of views and editors that allow you to create, edit, view, and run resources which belong to a specific type of project--in this case a HATS project. More than one perspective can be open at a time, although you can only view and work with one at a time.
At the far left of the WebSphere Studio window is a shortcut bar that allows you to open new perspectives and move between perspectives that are already open. The name of the active perspective appears in the title of the window, and the toolbar contains icons associated with the active perspective.
Start HATS Studio
To start the HATS Studio...
Start | Programs | IBM WebSphere HATS | HATS Studio.This starts WebSphere Studio with the HATS perspective open. The HATS perspective includes two main areas:
- The HATS Project View, which lists your HATS projects in an expandable tree view
- The editor window, which initially contains the HATS Welcome page. You will also use editors in this window to work with HATS resources. Below the editor window is a task list, which records information about the tasks you perform, and which can be useful for debugging.
The first time you start the HATS Studio, you will see a HATS tip, welcoming you to HATS and giving pointers about getting started. Use the check boxes on the tip windows to control how many tips you see.
If you start WebSphere Studio and the HATS perspective does not appear, you can open the HATS perspective by clicking...
Window | Open Perspective | Other | HATSIf you close or rearrange some of the windows in the HATS perspective, your arrangement is saved. When you return to HATS Studio later, it will be restarted the way you left it. To restore the original HATS windows, close the HATS perspective and reopen it, or click Window > Reset Perspective.
HATS Welcome page
The HATS Welcome page tutorial guides you through the process of developing a Web application using HATS. As you develop the application and customize it, it is known as a project. When you assemble the project into a J2EE-compliant .ear file, it becomes a WebSphere application. The application is transferred to the WebSphere Application Server and installed on a user specified server.
Each section on the Welcome page can be expanded by clicking the plus-sign icon. Each section contains links that start HATS functions, as well as links to relevant information in Getting Started and represents a stage in the process:
- Create your first project links to the Create a Project wizard and introduces the Run on Server function, which enables you to preview the project.
- Modify the template helps you update the template you chose as your project default.
- Edit the default rendering and global rules describes the conversion rules used by the default transformation, and provides information on the related function, global rules.
- Customize a screen introduces the host terminal screen and the Create a Screen Customization wizard. You can create a simple transformation to see how it changes your host screen.
- Work with macros and Integration Objects explains how macros can be used in your projects, and introduces Integration Objects. Integration Objects are also macros, but they are in a Java wrapper. You can create Integration Objects from macros in your projects.
- Explore advanced functions of HATS deepens your knowledge about basic HATS concepts and introduces the project editor.
- Prepare your project for production shows you how to assemble the project into a WebSphere application and transfer it to WebSphere Application Server.
- View the library of online information for HATS provides links to the HATS documentation as well as the HATS Web site.
As you use other HATS functions, the Welcome page is covered by editors or other tools. Each page in the editor window is given a tab at the top to enable you to move from one page to another. You can return to the Welcome page by clicking the Welcome to HATS tab, or by clicking the Welcome page icon in the main toolbar. You can double-click any tab to toggle that tab's page between its initial size and a full-screen view.
Start HATS functions
HATS Studio provides several ways to start each HATS function. You can:
- Right-click a HATS resource and select the function you want from the context menu.
- Click a HATS icon on the main Studio toolbar or on the toolbar associated with an editor. These icons are described here.
- Click on the HATS menu on the toolbar and select from the list of available functions.
- Click on the HATS Tools menu on the toolbar (these are primarily for insert functions in a JSP editor).
- Click a link on the Welcome page.
In many cases, you can start a HATS function in a way that creates linkage between HATS resources. For example, you can create a screen customization based on a screen capture by right-clicking on the screen capture and selecting...
New HATS | Screen CustomizationThe screen customization's properties will default to those of the screen capture.
HATS tips
To turn HATS tips on/off...
Window | Preferences | HATS | Show HATS tips
Develop your HATS project
To develop a HATS project using default values...
- Create a HATS project, with default values, using a wizard in the HATS Studio.
- Preview the project by using the Run on Server function.
- After creating the HATS project and previewing it, customize your application.
- Assemble the application and transfer the server.
Create a HATS project
Begin on the Welcome to HATS page. If the Welcome to HATS page is not displayed, click the Welcome to HATS tab at the top of the editor pane.
- Click the link to launch the Create HATS Project wizard.
- In the New Project window:
- Type the name of the application you are creating.
You cannot use double-byte characters in the names of HATS files, or GB18030-specific characters in the names of HATS resources. This is not a HATS restriction; it exists because of the .
- Type a description of the application. This is optional; you can keep notes here or use it however you want.
- Leave the Use default location, the Use default Enerprise Application project, and Add administration support boxes checked.
- Click Next.
- In the Connection Settings window:
- Type the name of the host where the host application is located. This can be a hostname, a domain name (such as myhost.mycompany.com), an alias, or an IP address.
- If your host is an iSeries machine, change the type to 5250.
- Accept the default values for the other fields on this panel.
- Click Next.
- In the Select Default Template window, use the drop-down list to review the templates that are provided with HATS. Choose one to use as a starting point for your project. Click Finish. You will see a progress bar as HATS creates the project.
You have created a simple HATS project.
Preview your project
Begin on the Welcome page. If the Welcome to HATS page is not displayed, click the Welcome to HATS tab at the top of the editor pane.
- In the HATS Project View on the left side of the screen, single-click the name of the project you just created.
- In the Welcome page, click Preview your HATS project using the Run On Server.
- The Server Selection window opens, where you select the server on which to run your application. Select Use an existing server, and select the WebSphere Test Environment server.
WebSphere Studio creates an internal server to show your project. You will see a progress bar as the server is established. When you preview your project, you are using the WebSphere Studio Run on Server function. This function runs your project on your local machine, on a copy of the WebSphere Application Server product that is embedded in WebSphere Studio. This server is also called the WebSphere Test Environment.
HATS displays a Web page on which you can see what your application will look like. The Web page is divided into two main areas:
- The template, which usually covers the top and left sides of the Web page, comprising a graphical banner and navigation links. The template area usually remains the same for all or most of the Web pages in your project, giving your users a consistent appearance.
- The application area which presents the transformed host application. The content of the application area is different on each Web page in the project.
When you preview a newly created HATS project, you see what your host application looks like when the default transformation is applied. This transformation is part of each project and uses default rendering to provide an automatic conversion of your host application pages into Web pages. Part of what you will do with the HATS Studio is to design transformations that will improve the conversion of your host application pages into meaningful, usable Web pages.
When you preview your project, the Web browser opens in the HATS perspective. If you make changes to your project, do not open another Run on Server window to view the updates; instead, click the Refresh button on the Web page that is already displayed.
Some of the changes you make may not appear when you use the Run on Server function until you rebuild the project or restart the server. You can turn on the workbench preference by clicking Window > Preferences > Workbench > Perform build automatically on resource modification. This will cause your project to be rebuilt when you make changes, so that the changes will appear immediately when you use the Run on Server function.
To view the application as the end user would see it, copy the URL from the HATS browser into a browser. The Web browser in the HATS Studio opens with a URL similar to the following: http://localhost:9080/myapp/. To enable other users to see the Web page from a different machine, give them a URL containing the TCP/IP address of the machine that is running HATS Studio. For example, change the URL http://localhost:9080/myapp/ to http://myworkstation.mycompany.com:9080/myapp/.
Next, you'll want to modify your HATS project. For example, you'll want to put your own company name into the template, and you'll want to define widgets (fields, input areas, and other GUI controls) in the application area. As you develop your HATS application, you can use the preview screen to test it and to see how it will look to an end user. Here's the sequence of steps you'll typically follow:
- Create the HATS project.
- Preview it.
- Make changes based on what you saw in the preview.
- Refresh the preview screen.
- Repeat until you're satisfied.
Continue with the instructions in Customize your HATS project.
Home