Design Flow
Developers who wish to create their own O4W applications create a routine whose name begins O4W_ and register it through the O4W Security module [*IMAGE/DETAILS LATER*]. This routine is similar in design to an OpenInsight "commuter module"; it will be called by different "events" involved in the web development cycle. The subroutine must take 3 parameters:
SUBROUTINE O4W_MYROUTINE(CtlID, Event, Request)
All web applications will receive the "CREATE" event when they are first invoked. Unlike a traditional OpenInsight form, the layout of your O4W web page will be created dynamically in this stored procedure. The stored procedure should build the web application during the CREATE event, optionally specifying other "events" that it wishes to be notified of; it will then be invoked by these other events (for example, button clicks), at which time it can dynamically generate new content or take any other action that is appropriate.
When building the web page with O4W, there are several functions that must be performed. These include:
- creating "styles" to control the look of the page;
- creating the display elements of the page;
- creating any "input controls" on the page;
- specifying the actions that the page may generate
Styles are the heart of modern web development. Styles control the look of the different pieces of the web page, including fonts, colors, alignment, and more. Groups of styles can be bundled together into "style sheets", which may be added to your O4W application. O4W toolkit functions also allow you to create style information "on the fly", and either use it for a single display element (for example, a particular block of text) or for groups of elements (for example, for all text).
When first creating your web page, you will normally specify a 'template' containing HTML code that defines the general layout of your web page. This template can contain other scripts, stylesheets, etc., which will all be included in your final output. Any web design tool (or even notepad) can be used to create this template. O4W requires the placement of 3 special "tags" within the template, along with one optional "tag", so that it can accurately place your programmatically-generated output. The required tags include %HEAD% (located in the header section), %BODY% (located in the main body), and %FOOTER% (where you wish any footer banners to appear). You can optionally also specify a location, and type, for any menu you wish to create - specify %MENU-H% for a horizontal menu, %MENU-V% for a vertical menu, or %MENU% (for a menu with the default orientation, controlled by the O4WCONFIG "MENUDIR" record), wherever you wish such a menu to appear (generated by a call to O4WMenu).
Display elements are the actual items to show on the web page. This includes plain text, headers, tables, links, images, and anything else that the user will see on the page. For each of these, it is possible to associate a style.
A particular type of display element is the "input control." An input control (for example, a textbox) allows the user to enter information on the web page. Input controls can have actions associated with them so that your program (or special functions built into the web page itself) can react to the users input.