migrating 4gl to genero a case study tom smith fourth generation software waiug/seiug washington...
TRANSCRIPT
Migrating 4GL to Genero
A Case StudyTom Smith
Fourth Generation Software
WAIUG/SEIUG Washington 2006
2
Introduction
Tom SmithSenior Tools Developer
Fourth Generation Software
3
Agenda
Our GoalsOur Goals
The Planning ProcessThe Planning Process
The Conversion ProcessThe Conversion Process
Question & AnswerQuestion & Answer
Differences from Four J’s BDLDifferences from Four J’s BDL
Technical Topics and ExamplesTechnical Topics and Examples
4
Our Starting Point
Software companyTool (RAD/CASE)Accounting PackageSingle code stream
5
Our Goals
Goal #1: Standard Windows UI Other goals:
Major Update NOT Rewrite Clean Code Customer Migration Path
6
Big Concessions
Not Backward Compatible Drop Text UI
7
Key Features Required
Standard Windows Key StrokesWindows Look & FeelTop MenuTool BarsRight Click
8
Informix 4GL
9
Four J’s BDL
10
Four J’s Genero
11
The Planning Process
Levels of Conversion
Level 1: Almost no conversion
12
The Planning Process
Levels of Conversion
Level 2: Minimum conversion
13
The Planning Process
Levels of Conversion
Level 3: Extended conversion
14
The Planning Process
Levels of Conversion Level 4: Full conversion
Do Extended conversion plus: Localized strings TEXTEDIT COMBOBOX RADIOGROUP CHECKBOX FOLDER/PAGE ( screen tabs)
GROUP STRING
15
The Planning Process
Analysis Scope Programming Consistency Generated Code? Can Code Changes Be Automated. Retain Dual Environments? Convert all-at-one-time?
16
The Conversion Process
Low level code (libraries) UI statements: Window/form:
OPEN WINDOW, OPEN FORM... Interactive instructions:
MENU, INPUT, INPUT ARRAY, CONSTRUCT and DISPLAY ARRAY
4gl and 'C' routines. Remove references to 'PROMPT' and 'DISPLAY AT'
statementsHigh level code (applications)TestDeploy
17
Differences from Four J’s BDL
What Has NOT changed Language structure Tools:
fgl2p, fglform, fglcomp, fgllink, fglmkrun, fglrun, fglschema (fgldbsch), fglWrt
Environment variables
18
Differences from Four J’s BDL
What HAS changed Style Sheets FGLPROFILE
19
What you need to now about XML
XML<endangered_species> <animal> <name>Tiger</name> <weight>500</weight> <subspecies> <name>Siberian</name> <region>Russia</region> <population>445</population> </subspecies> <subspecies> <name>Bengal</name> <region>India</region> <population>3159</population> </subspecies> </animal> <animal> <name>Black Rhino</name> <subspecies> <name>Southern Black Rhino</name> <region>Zimbabwe</region> <population>1365</population> </subspecies>
<subspecies> <name>Southwestern Black Rhino</name> <region>Namibia</region> <population>740</population> </subspecies> </animal></endangered_species>
endangered species
animalanimal
subspecies subspecies
name region population
siberian
445russia
name weight
tiger 500
The 'DOM' (Document Object Model) tree.
20
Initial considerations
What tools do you need ?Will automating a task save time ?Where to use Style Sheets ?XML based Style Sheets:
Styles: 4st Action defaults: 4ad ToolBar: 4tb TopMenu: 4tm
21
Technical Specifics
How to change an application's form filesOPEN WINDOWON ACTIONLocalized strings
22
How to change an application's form file
• After
DATABASE standard
SCREEN{:: Ordinary Text, fields and arrays:}
ATTRIBUTES:INSTRUCTIONS:
SCHEMA standardLAYOUTVBOXGRID{:: Ordinary Text and fields:}END -- GRIDTABLE{:: Arrays - Single-line:}END -- TABLESCROLLGRID{:: Arrays - Multi-line:}END -- SCROLLGRIDEND -- VBOXEND -- LAYOUT
ATTRIBUTES:INSTRUCTIONS:
• Before
23
DATABASE standard
SCREEN SIZE 20 BY 80{------------ Test Example ----------
Code...:[A0 ] Name...:[A1 ] Address:[A2 ] City-State-Zip:[A3 |A4|A5 ] Date...:[A6 ]
Contact Description[A7 ][A8 ][A7 ][A8 ][A7 ][A8 ][A7 ][A8 ]}
SCHEMA standard
LAYOUTVBOXGRID{ Test Example
Code...:[A0 ] Name...:[A1 ] Address:[A2 ] City-State-Zip:[A3 |A4|A5 ] Date...:[A6 ]}END -- GRIDTABLE{ Contact Description[A7 ][A8 ][A7 ][A8 ][A7 ][A8 ][A7 ][A8 ]}END -- TABLEEND -- VBOXEND -- LAYOUT
How to change an application's form file
SCREEN section
• After• Before
24
How to change an application's form file
Tables section: Unchanged.Attributes section:
A0 = tsthead.ccode;A1 = tsthead.cname;A2 = tsthead.caddress;A3 = tsthead.ccity;A4 = tsthead.cstate;A5 = tsthead.czip;A6 = tsthead.cdate;A7 = tstdetl.ctype;A8 = tstdetl.cdescription;
ATTRIBUTESA0 = tsthead.ccode;A1 = tsthead.cname;A2 = tsthead.caddress;A3 = tsthead.ccity;buttonedit A4 = tsthead.cstate, image="gn_arrdn.png", action=ac_zoom;A5 = tsthead.czip";dateedit A6 = tsthead.cdate;A7 = tstdetl.ctype;A8 = tstdetl.cdescription;
Instruction section: Unchanged:Delimiters: Remove
buttonedit field:
dateedit field:
• After• Before
25
How to change an application's form file
Problem areas:
What if:
Contact Description[A7 ] [A8 ]
One space
This results in:
The column heading should not be: 'Contact Description'. The rule is that at least two (2) spaces must separate column titles.
26
How to change an application's form file
Fix 1: Two spaces
Contact Description [A7 ] [A8 ]
This results in the correct:
Fix 2: TABLE (WIDTH=46){ [A7 ][A8 ] [A7 ][A8 ] [A7 ][A8 ] [A7 ][A8 ]}:::A7 = tstdetl.ctype, TITLE="Contact";A8 = tstdetl.cdescription,TITLE="Description";
27
How to change an application's form file
BUTTON Standard push button with a label or a picture.Replaces WIDGET="BMP"
BUTTONEDIT Line edit box with a button on the right side.Replaces WIDGET="FIELD_BMP"
CANVAS Area reserved for drawing.Replaces WIDGET="CANVAS"
CHECKBOX Boolean entry with a box and a text label.Replaces WIDGET="CHECK"
COMBOBOX Text edit box with a button that opens a list of values.Replaces WIDGET="COMBO"
DATEEDIT Line edit box with a button that opens a calendar window.EDIT Simple line edit box for data input or display.GROUP Attributes of a GROUP container specified with a layout tag.IMAGE Area where a picture file can be displayed.
Replaces WIDGET="IMAGE"LABEL Area reserved to display a value.PROGRESSBAR Progress bar widget to display an integer value.RADIOGROUP Field presented with a set of radio buttons.
Replaces WIDGET="RADIO"SCROLLGRID Attributes of a SCROLLGRID container specified with a layout tag.TABLE Attributes of a TABLE container specified with a layout tag.TEXTEDIT Multi-line edit box for data input or display.
28
How to change an application's form file
sh =FORMONLY.shipto, widget="BMP", config="shipto.bmp Control-P";
BUTTON sh : ac_shipto, image="shipto.bmp";
• After
• Before
29
OPEN WINDOW
open window w_shiptod at y_pos, x_pos with form "ship_oe" attribute (blue, border)
OPEN WINDOW w_shiptod AT y_pos, x_pos WITH FORM "ship_oe" ATTRIBUTES(TEXT="OE Shipto",STYLE="gn_main")
• After
• Before
30
OPEN WINDOW
Previously the system-wide 'Style' 'Style sheet' was loaded with: CALL ui.Interface.loadStyles("gn_default") [gn_default.4st]
<Style name="Window.gn_main"> <StyleAttribute name="windowType" value="normal" /> <StyleAttribute name="startMenuPosition" value="menu" /> <StyleAttribute name="ringMenuPosition" value="bottom" /> <StyleAttribute name="ringMenuButtonSize" value="shrink" /> <StyleAttribute name="ringMenuButtonSpace" value="tiny" /> <StyleAttribute name="sizable" value="yes" /> <StyleAttribute name="hideToolBar" value="0" /> <StyleAttribute name="hideStatusBar" value="0" /> <StyleAttribute name="actionPanelPosition" value="bottom" /> <StyleAttribute name="position" value="center" /> <StyleAttribute name="statusBarType" value="lines2" /> </Style>
31
ON ACTION
ON ACTION replaces ON KEY" and "ON COMMAND"
on key (control-p) CALL zmShipto()
ON ACTION ac_shiptoCALL zmShipto()
• After
• Before
32
ON ACTION
A program-wide 'ToolBar' 'Style sheet' was loaded with: CALL fmMain.loadToolBar("gn_shipto") [gn_shipto.4tb]
<ToolBar name="custom" buttonTextHidden="1"> <ToolBarItem name="ac_shipto" image="gn_shipto.png" text="Ship To"/></ToolBar>
A program-wide 'TopMenu' 'Style sheet' was loaded with: CALL fmMain.loadTopMenu("gn_shipto") [gn_shipto.4tm]
<TopMenuGroup text="Custom"> <TopMenuCommand name="ac_shipto" text="Ship To" /></TopMenuGroup>
A program-wide 'Action Defaults' style sheet was loaded with: CALL fmMain.loadActionDefaults("gn_shipto") [gn_shipto.4ad]
<ActionDefaultList name="custom"> <ActionDefault name="ac_shipto" acceleratorName="Control-p"/></ActionDefaultList>
33
Localized strings
Localized strings.
Form File[lb01]: [nm ]:LABEL lb01 : TEXT=%"lb_cust_name";
$ fglform -m test.per > test.str
CodeATTRIBUTES(TEXT=%"cust_maint",ERROR %"no_record"$ fglcomp -m test.4gl >> test.str
$ vi test.str"lb_cust_name"="Customer name""cust_maint"="Customer Maintenance Screen""no_record"="No record satisfies query"
$ fglmkstr test.str test.42s