Examples of DFHMDX
These examples show how to code DFHMDX keyword parameters to customize the generation of HTML templates from BMS maps.
You can code your own version of the DFHMSX macro. See Customizing with the DFHMSX macro for a summary on how you can customize HTML templates. Refer to the following examples to help you code DFHMDX in your customizing macro.
The following example shows a customizing macro definition. DFHMSX is simply coded as is with no parameters. It invokes DFHMDX. The first invocation of DFHMDX sets defaults for the values to be applied to subsequent invocations of DFHMDX by specifying * for the map set name and map name. Later invocations override or add to the parameters for specific maps in the map set. The continuation characters are in column 72, and the continued text is resumed in column 16.
MACRO
DFHMSX
DFHMDX MAPSET=*,MAP=*, *
F1='Help',F3='Exit',F4='Save',F9='Messages'
DFHMDX MAPSET=DFHWB0,MAP=*, *
TITLE='CICS Web Interface', *
F3='Messages'
DFHMDX MAPSET=DFHWB0,MAP=DFHWB02, *
TITLE='CICS Web Interface Enable', *
F3='Save'
MEND
When CICS® creates the templates for each of your BMS map definitions, it calls the customizing macro specified on the SYSPARM parameter in the DFHMAPT procedure. If the SYSPARM parameter does not specify a customizing macro name, DFHMSX is used. Each macro is processed in sequence, and, if applicable, the parameter values are stored. Where a duplicate parameter is specified for a particular map or map set, the new value replaces the previous value for that map or map set only.
- The first DFHMDX macro in this example specifies
MAPSET=*,MAP=*andF3='Exit'. This value of F3 applies to every map set and map for which a different value is not specified in a subsequent DFHMDX macro. - The second DFHMDX macro specifies
MAPSET=DFHWB0,MAP=*andF3='Messages'. This value of F3 applies to every map in map set DFHWB0 for which a different value is not specified in a subsequent DFHMDX macro. - The third DFHMDX macro specifies
MAPSET=DFHWB0,MAP=DFHWB02andF3='Save'. This value applies only to map DFHWB02 in map set DFHWB0.
- ENTER and CLEAR keys
- PA1, PA2, and PA3 keys
- Function keys F1 to F24
- HTML reset
DFHMDX MAPSET=*,MAP=*,F3='Exit',ENTER='Continue'Here are further examples showing how you can customize the HTML template generated from a BMS map.
- Support the application to use keys that are not in the standard
output You can add a button to the map AD001 as follows:
where Fxx is the new function key number that you want to specify. The web client displays a button with the legend "Resubmit". If the user clicks this button, it is reported to the application as Fxx.DFHMDX MAP=AD001,Fxx='Resubmit' - Suppress the HTML Reset function You can suppress the Reset function for the map AD001 as follows:
The web client displays a page that does not contain a Reset button.DFHMDX MAP=AD001,RESET=NO - Change the appearance of the buttons, or the text associated
with them You can change the legend on the F1 button as follows:
The web client displays a button with the legend "Help". If the user clicks this button, it is presented to the application as F1.DFHMDX F1='Help' - Provide an HTML title for the HTML page You can add a title to a displayed map as follows:
The web client displaysDFHMDX MAP=DFHWB01,TITLE='CICS web interface'CICS web interface
as the title of the page. - Provide a masthead graphic for the HTML page Write a DFHMDX macro for the map that is to have the masthead. For example:
The web client uses the specified masthead, or showsDFHMDX MASTHEAD=(/dfhwbimg/masthead.gif,'CWI')CWI
as the masthead if it cannot find the graphic file. - Change the color of the background, or specify a special background Write a DFHMDX macro for the map that is to have a special background. For example:
The web client uses the specified file as a background for the page.DFHMDX MAP=AD001,BACKGROUND=/dfhwbimg/texture4.jpegTo change the color of the background, use the BGCOLOR parameter.
- Modify the BMS colors To modify the BMS colors, write a DFHMDX macro like the following:
The web client shows BMS blue text in HTML aqua (the same as BMS turquoise) and BMS yellow text in bright orange.DFHMDX MAP=AD001,BLUE=AQUA,YELLOW=#FF8000 - Suppress parts of the BMS map You can suppress a field in a map as follows:
The displayed page does not contain the field at row 5 column 2, nor the field at row 6 column 2, nor any of the fields in row 7 of the map.DFHMDX MAP=AD001,SUPPRESS=((5,2),(6,2),(7,*)) - Add web client control functions If you want a JavaScript function to be called when a page is loaded, use the ONLOAD parameter of the DFHMDX macro in your customization macro. For example, if you code:
JavaScript functionDFHMDX MAP=AD001,ONLOAD='jset(''CWI is wonderful'',''Hello there!'')'jset()is invoked with the given parameters when the page is loaded.To complete this customization, add the definition of thejsetfunction to the header of the HTML page with a DFHWBOUT macro. You must put the macro invocation before the first DFHMDF macro in the BMS map definition. Here is a sample:DFHWBOUT '<script language="JavaScript">' DFHWBOUT 'function jset(msg,wng)' DFHWBOUT ' {window.status = msg; alert(wng)}' DFHWBOUT '</script>'When the page is loaded, the status area contains the message
CWI is wonderful
, and an alert window opens that contains the messageHello there!
. - Add text that appears only on the HTML page, but is not part
of the BMS map Put DFHWBOUT macros in the BMS map definition at the point where you want the text to appear. For example:
produces the following lines in the HTML template:DFHWBOUT '<p>This text illustrates the use of the DFHWBOUT macro,' DFHWBOUT 'which can be used to output text that should only appear' DFHWBOUT 'in HTML templates, and will never appear in the' DFHWBOUT 'corresponding BMS map.'<p>This text illustrates the use of the DFHWBOUT macro, which can be used to output text that should only appear in HTML templates, and will never appear in the corresponding BMS map. - Add HTML header information to the HTML page Put DFHWBOUT macros in the BMS map definition before the first occurrence of DFHMDF. For example:
produces the following lines in the head section of the HTML template:DFHWBOUT '<meta name="author" content="E Phillips Oppenheim">' DFHWBOUT '<meta name="owner" content="epoppenh@xxxxxxx.yyy.co* m">' DFHWBOUT '<meta name="review" content="19980101">' DFHWBOUT '<meta http-equiv="Last-Modified" content="&WBDATE&W* BTIME GMT">'<meta name="author" content="E Phillips Oppenheim"> <meta name="owner" content="epoppenh@xxxxxxx.yyy.com"> <meta name="review" content="19980101"> <meta http-equiv="Last-Modified" content="23-Dec-1997 12:06:46 GMT">DFHMSD sets the values of &WBDATE and &WBTIME to the time and date at which the macro is assembled.
- Use country-specific characters in JavaScript and HTML You can be modify the default US code page 37, which is used to produce the template, for different code pages. For example:
specifies the substitutions needed. You must enter the characters on a terminal on which the code page corresponds to the SERVERCP on the DFHCNV call.DFHMDX OPENSQ=[,CLOSESQ=],OPENBR={,CLOSEBR=},EXCLAM=! - Make fields right-aligned in the HTML page You can align the data in a field as follows:
DFHMDX MAPSET=MAPSETA,MAP=AD001,RALIGN=((3,5),(*,15),(*,3),(6,7),(*,83))In this example, data will be aligned in all the following fields:DFHMDF POS=(3,5),LENGTH=4,INITIAL='TEXT',ATTRB=PROT DFHMDF POS=(5,80),LENGTH=3,INITIAL='123',ATTRB=PROT DFHMDF POS=(2,10),LENGTH=5,INITIAL=' EXT',ATTRB=ASKIP DFHMDF POS=(4,8),LENGTH=7,INITIAL='INITEX ',ATTRB=PROT DFHMDF POS=(1,1),LENGTH=2,XINIT='C1C2',ATTRB=ASKIP DFHMDF POS=(6,7),LENGTH=4,XINIT='0E44850F',ATTRB=PROT,SOSI=YES DFHMDF POS=(2,9),LENGTH=6,XINIT='0E448544830F',SOSI=YES,ATTRB=PROT DFHMDF POS=(2,9),LENGTH=6,XINIT='448544834040',PS=8,ATTRB=PROT - Make numeric fields right-aligned You can make all fields with the NUMERIC attribute right-aligned in their HTML table cells as follows:
DFHMDX MAPSET=MAPSETA,MAP=AD001,NUMALIGN=YES