Chapter 3. Using iSeries Access for Web 61
3.5.4 Home page example: Customer view
Figure 3-50 shows a customer view of the home page for our boat company. It contains a
number of links to iSeries Access for Web functions. Each link is discussed in the following
sections. This home page demonstrates one way to implement each service listed. There are
often multiple different ways to accomplish a task using iSeries Access for Web.
Figure 3-50 Home page: Customer view
62 iSeries Access for Web V5R2 and WebSphere Host Publisher V4.0
View available boats
This link shows the contents of a database table. A caption is specified to customize the table
heading. See Figure 3-51.
The source for this link is:
<a href="/webaccess/iWADbView?table=BOATS.BOATS&caption=Available Boats">View available
boats</a>
Figure 3-51 Viewing a database table
See boat details
This link starts a 5250 session to run a traditional 5250 application. A better solution is to use
Host Publisher to modernize this application. See Chapter 6, Using Host Publisher Studio to
develop J2EE applications on page 141, for more information.
You can use the Change User Profile (CHGUSRPRF) command to change the initial program
to your company's application. You may also want to use the Change System Value
(CHGSYSVAL) command to change the Display sign on information (QDSPSGNINF) system
value to 0. This prevents the sign on information from being displayed before the initial
program is started.
Another startup option is to use the
initmac parameter on the iWA5250 link. The initmac
parameter identifies a macro to run after starting the session. If a session already exists when
the link is chosen, the most recently accessed session is displayed and the macro is not run
again.
Chapter 3. Using iSeries Access for Web 63
The source for this link is:
<a href="/webaccess/iWA5250">See boat details</a>
Figure 3-52 Running a traditional 5250 application
64 iSeries Access for Web V5R2 and WebSphere Host Publisher V4.0
Order a boat
This link uses a database table insert to enter order information. See Figure 3-53.
The source for this link is:
<a href="/webaccess/iWADbInsert?table=BOATS.ORDERS">Order a boat</a>
Figure 3-53 Inserting a record into the database table
This Weeks Special
This link uses the file download support to display a video clip of the boat. Pictures of the
boats interior can also be stored in the integrated file system.
The source for this link is:
<a href="/webaccess/iWAFileDownload?filepath=/boats/carver.mpg">here</a>
Chapter 3. Using iSeries Access for Web 65
Great Deals
This link uses a database query to return a subset of the contents of a database table. The
SQL Wizard was used to build a query that retrieves all boats costing less than $75,000 and
orders them by increasing price. The resulting statement is:
SELECT
"BNAME", "BFEET", "BYEAR", "BCOST", "BNT01"
FROM
BOATS.BOATS
WHERE
( (BOATS.BOATS."BCOST" < 75000) )
ORDER BY
"BCOST"
The HTML SQL output type is used to display the results. The HTML output type supports a
template file to display a custom header and footer around the results. In this example, the
template created in 3.5.3, Template example on page 58, provides a consistent look. If you
use the same template for database queries and general page content, you need to change
the Template tag setting from <!-- TABLE1 --> to %%CONTENT%%. The template tag setting
is an HTML output type setting in Run SQL.
This example uses a public shortcut to run the database query. Any user with access to the
server can run the query, but only the user who created the request can modify or delete it.
See Figure 3-54.
The source for this link is:
<a href="/webaccess/iWADbExec/sqloutput.html?access=*PUBLIC&request=bargains">View our
selection of modestly priced boats.</a>
Figure 3-54 Displaying the database query results

Get iSeries Access for Web V5R2 and WebSphere Host Publisher V4.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.