This document discusses IBM Rational Host Access Transformation Services (HATS) which transforms traditional text-based interfaces into web, portlet, rich client or mobile device interfaces. It provides an overview of HATS capabilities including creating macros, integration objects, web services and using HATS with other IBM technologies like SQL, Toolbox for Java and Program Call Markup Language.
2. About Us: Strongback Consulting
•IBM Advanced Business Partner
–Rational, WebSphere, Lotus, Information Management SVP certified
–Strongly focused on Enterprise Modernization and application lifecycle management
–Key Industries Served: Finance, Insurance, Travel, Logistics, Healthcare, Manufacturing, Government
–Rational Design Partner for HATS and other Rational enterprise modernization technologies
Discover us at: http://www.strongback.us
Subscribe to us at http://blog.strongbackconsulting.com
Socialize with us on Facebook & LinkedIn http://www.facebook.com/StrongbackConsulting http://www.linkedin.com/company/290754
3. About HATS
•IBM® Rational® Host Access Transformation Services (HATS) transforms traditional text-based interfaces into web, portlet, rich client or mobile device interfaces.
•Supports 3270, 5250 and virtual terminal (VT) applications
•Allows for extending these applications as standard web services.
•Rules based engine to transform your existing, proven applications to a modern UI.
•Extend 3270, 5250, and VT green screens as standard Web services.
•Broadens the reach of IBM i applications with support for mobile web access from devices such as smartphones, tablets, and handheld computers.
•Provides standard JSR 286 and JSR 168 portlet support, including built-in inter-portlet communication.
2
4. About HATS
•With Rational HATS you can easily convert traditional text-based host application screens to user-friendly GUIs.
3
5. HATS Toolkit
•Rational IDE environment
•Wizard driven service accelerators
•Visual page designers
•Visual macro editors
4
6. HATS: The Tactical Advantage
•Rational HATS allows you to reuse and repurpose your existing assets.
–Out of the box
–Additional ROI on your existing applications
–Low cost and low risk: No need to rewrite or refactor existing applications
•Cuts training costs.
–Increase productivity and reduce training costs and data entry errors with workflow and navigation improvements
•Extend your reach.
–Extend host application to new users who do not directly have access to the host system.
•Very Fast Time To Market
–A large financial company went from start to production in 39 days
–Smaller companies could have an application ready in an afternoon
5
7. HATS: The Strategic Advantage
•Extend your existing applications and assets
•Find new streams of revenue for your legacy applications
–Applicable to ISV’s, service providers
•Use to abstract your systems into web services short term to protect long term architectures
–Easy to create web services
–Web services “hide” the underlying technology
•Integrate with external resources
–Any resource!
•Portalization
–Integrate at the glass with other enterprise systems
6
8. Extending with Web Services
•The W3C defines web services as: “a software system designed to support interoperable machine-to- machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.”
•The W3C also states:
–REST-compliant Web services, in which the primary purpose of the service is to manipulate XML representations of Web resources using a uniform set of "stateless" operations; and
–arbitrary Web services, in which the service may expose an arbitrary set of operations.
•Provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
•SOAP…. REST…. XML… JSON… HATS does it all.
7
9. SOAP Web Services
•SOAP: Simple Object Access Protocol
•XML-based protocol to let applications exchange information over HTTP or JMS (or really ANY transport).
•Often described by a WSDL: Web Services Description Language
–WSDL is an XML-based language for describing Web services and how to access them.
–Makes services easier for clients to consume.
•SOAP is highly extensible, but you only use the pieces you need for a particular task.
8
11. Creating a web service using HATS
•Create a standard HATS project
•Create macros
•Create Integration Objects
•Create Web Services (REST or SOAP)
•Deploy to WebSphere
12. Key Function in Macros
•Skip-screen
•Skip-screen macros are navigational macros that move the user from one screen to another screen without displaying intervening screens.
•Prompt
•Prompt macros contain events to request input from users during the host session.
•They can also set prompts from a user list.
•For example, you can use a prompt macro to ask a user for their user ID and password before logging them into a host application.
•Extract
•Extract macros contain events to extract host screen information as a string, data as a table or even a global variable.
•You can use an extract macro to connect to a directory-type host application and extract the results of doing a search in the directory.
13. Create a Macro
•Utilize the Host Terminal Emulator to record your macro.
•Utilize the Visual Macro Editor (VME) to edit your macro.
–Add prompts (the inputs of your web service)
–Add extracts (the outputs of your web service)
12
15. Host Terminal
•Used for Host Navigation to create:
–Screen Customizations
–Screen Captures
–Transformations
–Macros
•Allows Macro Recording and Editing
•Allows Macro Playback and Testing
Open
Play
Record
Stop
Save
Resume
Prompt
Extract
Record Loop
Prompt All Fields
Extract All Fields
Step Into
Step Over
Step Return
Step Over
16. Visual Macro Editor
15
•Allows you to visually see your macro flow
•Easiest way to update existing macros
•Drag / drop functionality
19. Macro Editing
•Tabbed Editor – description, timing, name
•Advanced Editor
•Create/edit macro variables
•SQL calls
•Macro Navigator (in Host Terminal)
•Recording macros
•Appending to macros (less preferred method)
•Debugging / testing macros
•Visual Macro Editor – Most of your editing
•Editing Actions
•Rename screens
•Re-ordering screen flow
•Drag/drop screens onto the editors
20. Integration Objects
•Reusable, JEE, Java Beans that encapsulate interaction with a host system.
•Can be created from Macros
19
Integration Object Java Beans
21. Integration Objects
•Created automagically!
•Select the macro, right click and select Create Integration Object
•Once created, the Integration Object will appear in the HATS Project View in the Source -> IntegrationObject folder
20
22. From Integration Objects to Web Service Support Files
•Utilize wizard from context menu Right click on the Integration Object and select Create Web Service Support Files
21
23. Create Web Service Support Files
This is a web service, which may contain a collection of operations. Choose the name of your service to reflect this.
22
24. More
Select the Integration Objects you wish to include in this service.
Each Integration Object will reflect one operation of your service.
Click the properties button to alter the input and outputs selected for each operation.
23
25. Selecting Properties
The selected properties will determine the inputs and outputs of your service.
See the hPub properties? These are used internally by HATS and can be safely excluded.
24
26. Web Service Support Files
25
The artifacts created will reside in the Source -> webserviceclasses folder.
27. Create a SOAP Web Service
26
From the project explorer, right click on the web service support file you created. Select Web Services -> Create Web Service from the context menu.
This will launch the Web Service wizard. This wizard allows you to generate a WSDL file and also lets you deploy the service to an application server.
Optionally, it also allows you to create a sample client for the service.
28. More
Construct your web service as a Bottom up Java Bean Web Service. A bottom up service is built using your existing Java bean and this wizard will generate the WSDL and other Java classes to facilitate the service.
Other options available:
-Generate a client
-Select a server runtime
-Change the EAR for deployment
27
29. Service Endpoint Interface
The service endpoint is the client’s view of the service, hiding the session bean from the client.
Here you can modify the interface to use, the deployment scope, the soapAction field for the generated WSDL and whether to map to WSDL 1.1 MIME types.
28
30. Web Service Java Bean Identity
Here you can modify the WSDL file name and select which methods to expose via your service.
In our example, the getNestedBeanNames method is not a method we want to expose.
Once complete, click Finish to create your WSDL and service 29
32. RESTful
Like the SOAP services before, you can begin creating REST based services from an Integration Object.
Right clicking on the Integration Object in the projects view allows us to select Create RESTful Service Files from the context menu. This will launch the wizard to create our interfaces.
31
33. Producing REST Web Services with HATS
Specify the class and package names.
32
34. Producing REST Web Services with HATS
Choose the Integration Object and the HTTP method type.
Then select the input and output parameters.
33
35. Configuring the JAX-RS Resource Method
Here we can define a great many properties of our service interface:
-Method Name
-URI suffix
-Mime type that is produced
-Add, edit or remove parameters
Below you see the JAX-RS annotation signature for the method the wizard will produce.
34
36. Producing REST Web Services with HATS
Here we could add additional methods.
Click Finish to complete the wizard and generate the JAX-RS resource.
35
38. The HATS Lifecycle
37
Business Logic Macros
HATS Runtime
Servlet
Filter
Servlet
Listener
Servlet Context
Servlet Request
JEE
Web server
HTTP
39. HATS Business Logic
•Business Logic:
–Java code that can be invoked when ANY HATS event occurs.
–Include and manipulate HATS global variables
•HATS Events:
–Application startup
–Screen recognition
–Error
38
41. Introducing The IBM Toolbox for Java
A set of Java classes that allow you to use Java programs to access data on your IBM I servers via their host servers as access points. With these you can utilize:
•Database -- JDBC (SQL) and record-level access (DDM)
•Integrated File System
•Program calls (RPG, COBOL, service programs, etc)
•Commands
•Data queues
•Data areas
•Print/spool resources
•Jobs and job logs
•Messages, message queues, message files
40
42. Obtaining the Toolbox
41
•The IBM Toolbox for Java Jar files are installed in the integrated file system of IBM i, under directory /QIBM/ProdData/OS400/jt400/
•IBM Toolbox for Java is also available in an open source version. You can download the code and get more information from the JT Open Web site.
44. Where and How could I use the toolbox in HATS?
44
Terminal Connection
45. Program Call Markup Language
•A tag language that allows one to call IBM I server programs.
•XML based syntax that fully describes the input and output parameters for the program.
•Extensible Program Call Markup Language (XPCML). XPCML enhances the functionality and usability of PCML by offering support for XML schemas.
•Allows you to write less code; your calls to the server, utilizing the IBM Toolbox for Java, handles the interaction and provides the interface.
•Also available to be consumed from within the server environment by other host programs.
•Available since IBM I v5r3
45
49. Consuming PCML with HATS
•Utilize within Business Logic to call out to other host programs.
–Retrieve other records
–Lookup data that could be inserted into your host application
•Use within Screen Customizations
–Retrieve result sets for a search
–Get a list of values a user could select to auto populate other fields
49
50. SQL Integration with IBM i
•The IBM Toolbox for Java JDBC driver allows you to use JDBC API interfaces to issue structured query language (SQL) statements to and process results from databases on the IBM i.
–JDBC is an API that enables Java programs to connect to a wide range of databases.
50
Hats Application
JDBC Driver
IBM i
51. SQL: Structured Query Language
•A programming language designed for managing data held in relational database management systems.
51
SELECT Book.title AS Title, COUNT(*) AS Authors FROM Book JOIN Book_author ON Book.isbn = Book_author.isbn GROUP BY Book.title;
Title Authors
---------------------- -------
SQL Examples and Guide 4
The Joy of SQL 1
An Introduction to SQL 2
Pitfalls of SQL 1
52. Utilize SQL within Business Logic
Problem: Your host applications often have short, cryptic record identifiers and often the description is not included with them on the current screen.
Solution: Use HATS Business Logic and JDBC to query the database for the full description that you store in a global variable. Then utilize that variable within the Screen Customization.
52
54. Calling RDBMS From Macros
•Use the Advanced Editor
•Insert raw SQL
•Save result set to macro variable
•Macro variable only exists for the lifecycle of the macro
•Use result set to enter data on to later subsequent screens
54
55. Using servlet filters
•For security
•For further integration
•Intercept inbound request or outbound response
•Authentication to an external LDAP registry
•Single Sign On
–Could be used in conjunction with Enterprise Identity Manager (EIM)
55
57. Resources
•Check out all our links for our presentations, including this one
–https://delicious.com/strongback/tag_bundle/Innovate2013
–“one link to rule them all”
57
58. About Us: Strongback Consulting
•IBM Advanced Business Partner
–SVP certified
–Strongly focused on DevOps, enterprise modernization and application lifecycle management
–Key Industries Served: Finance, Insurance, Healthcare, Manufacturing, Government
–Rational Design Partner
Discover us at:
http://www.strongback.us
Subscribe to us at
http://blog.strongbackconsulting.com
Socialize with us on Facebook & LinkedIn http://www.facebook.com/StrongbackConsulting
http://www.linkedin.com/company/290754