Objective
Provide a response html which would list all the bookshelves
available.
Prerequisite
Download library cgidev2
from our site
www.easy400.net
and install it on your iSeries 400 (AS/400)
Example
See our example.
Resources
- The bookshelves file is file
BCT01A
in library
CGIDEV2
.
This file is a logical file based on physical
BCT01
.
Please look at
BCT01 and at
BCT01A DDS.
Perform as follow:
- Signon on AS/400 as QPGMR
- Develop your skeleton html member
- strpdm
on source file
mycgilib/htmlsrc
and add member
lab22a,
source type
html
- Write the following html sections
- /$top
to start the html (HTML, HEAD, BODY)
- /$tabstr
to start a table
- /$tabrow
to define the table row
which contains the
/%variable_name%/
for a bookshelf
- /$tabend
to end this table
- /$end
to end the html
- Develop your ILE-RPG CGI program
- enter command
cgidev2/crtcgisrc srcmbr(lab22a) srclib(mycgilib) option(3)
to create the default ILE-RPG module source for this program
in
mycgilib/qrpglesrc
- complete this source:
you should issue all the previously defined html sections;
section tabrow should be issued as a variable line
(subfile line) for each input record (bookshelf)
from file
BCT01A.
- compile the module
- create the CGI program
- to test your CGI program,
in the command line of your internet browser
enter
http://.../mycgilib/lab22a.pgm
Further steps (optional)
- Add an anchor to each bookshelf.
This anchor would allow to display all the books on a given
bookshelf.
The anchor should be like
<A HREF="/centaur2p/cnt02.pgm?action=start&xbct01nbr=/%XBCT01NBR%">/%XBCT01DES%/</A>
where
-variable /%XBCT01NBR%
should contain the ID of the bookshelf
(field BCT01NBR)
-variable /%XBCT01DES%
should contain the description of the bookshelf
(field BCT01DES)
- Extend the html response of your program
to include the full initial page of Centaur2.
Lab solutions
Type |
Run it |
html |
rpg |
Basic |
X |
X |
X |
Complete |
X |
X |
X |
|