HATS in WebSphere Portal
Content
- Overview
- Create a base HATS application
- Generate portlets from HATS applications
- Work with a HATS portlet
- Export your HATS portlet
- portlet considerations and limitations
Overview
HATS applications can now run directly within WebSphere Portal as portlets, enabling WebSphere Portal and HATS to interact directly. HATS Business Logic classes are able to use the WebSphere Portal APIs, and HATS JSPs are able to include WebSphere Portal JSP tag libraries.
A HATS portlet project is targeted at transformation oriented applications.
To allow a HATS project to run as a portlet, the structure and content of the HATS project must be altered to meet the portlet specification. The HATS studio automates the process of converting a regular HATS project into a portlet. The WebSphere Portal Toolkit is a prerequisite for this conversion process. The toolkit must be installed on the same machine as HATS Studio.
Before or after installing the Portal Toolkit, download and install the latest HATS Refresh Pack.
There a 2 ways in which one can generate a HATS portlet:
- You can create a new one using the HATS Create a Project wizard and designating that the project should be created as a portlet.
- You can generate one from an existing HATS application. This ensures that the time spent on creating your HATS application will not be wasted when one moves it to WebSphere Portal.
For existing HATS V4 applications, migrate your application to HATS V5 before generating your portlet.
For more information, see Using IBM WebSphere Host Access Transformation Services V5
Create a base HATS application
To create the base HATS application, follow these steps:
- Start HATS Studio...
Start | Programs | IBM WebSphere HATS | HATS Studio- In the white space area of the HATS Project View, right-click and select New HATS Project.
- The Create a Project wizard opens. In the Create a Project panel, type the name for the new HATS project and a description for the project. You may want to change the name of the Enterprise Application project name. The default is HATS.ear. The name that you enter is also shown in the WAS when the application is deployed on WebSphere. Click Next.
- In the Create a Project - Connections Settings window, specify the connection properties for the HATS application. For Host name, we specify iseriesd.dfw.ibm.com and for Type, we select 5250. For the other settings, leave the default values. Click Next.
You can edit connection properties in the project setting view.
- On the Create a Project - Select Default Template window, select the template you want to use. We select Swirl.jsp. Click Finish.
The HATS Project Wizard completes the creation of the HATS project. You see the new HATS project in the HATS Project View of HATS Studio.
Generate portlets from HATS applications
To generate your portlet from an existing HATS project, right click on your project in the HATS Project View and select Generate Portlet. A dialog will be presented, allowing you to designate the name for the new project and select the types of files that will be automatically converted during the creation. A HATS portlet project will be created from the selected project. Once the portlet is created, additional customization can be done.
To generate a portlet when creating a new HATS application, select HATS > New > Project on the HATS Studio toolbar to launch the Create a Project wizard. Select the Create as Portlet check box on the first panel of the wizard then finish creating your project as normal. This will generate a single HATS portlet project although the HATS .ear will not be created in this case. This function is available so that you do not have to create a regular HATS application, then generate a protect from it.
Work with a HATS portlet
A HATS portlet project is still a HATS project meaning all the HATS wizards and editors can continue to be used on the project. A HATS portlet project is also a portlet project which also means all the WebSphere Portal Toolkit editors and runtime configuration can be used on the project. A HATS portlet project appears in the tree with a different icon . When working with a HATS portlet, there are a few things consider:
- A HATS portlet project can no longer run in the server configured for the regular HATS Run On Server because that it was using the WebSphere Application Server runtime. The WebSphere Portal Toolkit comes with its own methods for debugging a portlet as it is being developed in a WebSphere Portal runtime (such as test environment and preview portlet function).
- A HATS project from which a portlet was generated is developed independently from the portlet; after generating, changes in one project will not be reflected in the other. You can always generate a new HATS portlet from a HATS project to reflect changes made in the latter.
- You cannot convert a HATS portlet project back into a regular HATS project.
Export your HATS portlet
To export a HATS portlet for deployment, you can use the built in WebSphere Studio Export wizard. Select...
File | Export | WAR file | NextSelect the desired portlet project from the Web Project drop-down list and enter the target file name for the exported WAR in the Destination drop-down. Click Finish.
Once you have exported your HATS portlet, you will need to install it into WebSphere Portal using the Administrative Portlets.
HATS portlet considerations and limitations
The following is a list of considerations and limitations when dealing with HATS portlets:
- HATS applications which use JSP flow of control will not work properly in WebSphere Portal. Portlets are servlet-driven entities and require the use of actions encoded into URLs to drive the navigation. Because of this, the Forward to URL action will not work in a Portal environment.
- The HATS Studio tools for creating and working with portlets is only available once the WebSphere Portal Toolkit Version 5.0.2 has been installed into WebSphere Studio.
- A HATS portlet application can not be run outside of WebSphere Portal. For example, you cannot run a HATS portlet application on WebSphere Application Server.
- The WebSphere Portal Administration Portlets only allow installation of portlet applications as Web application archives (.war). HATS only has one project per .war therefore, you cannot export a set of HATS applications as a portlet application
- Cookies are required to authenticate within WebSphere Portal, so you need to run HATS in WebSphere Portal with cookies enabled.
- The HATS applet will not work in portal.
For more information and help regarding the WebSphere Portal Toolkit, select the Help drop-down menu on the HATS Studio toolbar and pick Help Contents. Click Portlet developer information from the help list on the left to access documentation for portlet developers.
Home