The Company
Products
Solutions
Services and Support
Customers
Partners
News
Events
Home >> News >> WebFOCUS Newsletter >> May 2003 >> Update Assist: Prototype an Application in 10 Minutes

Update Assist: Prototype an Application in 10 Minutes

By Bob Jude Ferrante

In the last issue of the WebFOCUS Newsletter we discovered that with Update Assist, even a developer without a lot of application development experience can create an application to update any existing database.

But what if the database doesn’t exist? What if we need to create a quick data dictionary and generate a new application, from soup to nuts? Can it be done in five minutes?

Actually the answer is no. It takes a little longer because you have to design the databases you will use, as well as using the Update Assist wizard to generate your application. Designing a database is a complex task. So let’s say it will take, er, 10 minutes!

That’s right. With WebFOCUS Release 5, even prototyping closed-loop applications from scratch is a warm spring breeze.

Building a Prototype with Update Assist

Update Assist works alongside the tools in the Developer Studio workbench for creating master and database files. With these tools at hand, you can design a complete application prototype from scratch in just minutes.

For our simple prototype today, let’s do a simple e-commerce-style application consisting of a customer contact list and a linked order table for a company that sells something near and dear to my heart – PDAs.

We’ll also add three lists to the application to simplify order entry for your salespeople – a list of state codes so we know where the customers are, a product list, and a list of sales representatives.

Before You Start

The tutorial here assumes you are using Developer Studio 5.2.1. If you’re completely new to Release 5’s Update Assist capabilities, please review my article "Maintain in a Minute: New Update Assist" in the February issue of the WebFOCUS Newsletter.
We’re using 5.2.1 because it has a new Dynamic List validation feature that lets you use external databases or flat files to generate content for drop-down lists. Dynamic lists give you the ability to have drop-downs whose content changes as linked data changes, without having to touch your deployed applications to add items to your lists. The items are added – you guessed it – dynamically. If you have release 5.2.0, you can add the contents of those lists manually using the Static List validation feature.
We’ve set up three flat files and metadata that contain the lists to be used for this tutorial so you can plug them right in to the application. You can download them from the 042003FERRANTE.ZIP file at: www.informationbuilders.com/assistfiles

Part 1: Design the Databases

1. Start Developer Studio. From the Object Explorer, create a new Project. Call it ECOM.

2. Now unzip 042003FERRANTE.ZIP into this folder. You should have three sets of flat files/Master File descriptions: STATES, PRODUCTS and SALESREPS. Add these Master File descriptions to your new project.

3. Click the Master Files folder. Right-click the right pane of the Explorer and select New > Master File. Give the Master File a name – let’s call it PROTOTYPE. Developer Studio displays the File Tool.

4. Define your fields as in the table shown in Figure 1.

Segment/Field Name Title Format
CUSTADD Segment
CUSTID Customer ID A10
CUSTNAME Customer A24
CUSTADD1 Address line 1 A30
CUSTADD2 Address line 2 A30
CUSTID Customer ID A10
CITY City A24
STATE State A2
ZIP Zip code A5
ORDERS Segment
ORDCODE Order ID A11
PRODCODE Product code A11
ORDDATE Date ordered MDYY
ORDREP Sales rep A24
ORDAMT Order amount D12.2

Figure 1

5. Select File > Save. Developer Studio saves the Master File description. Leave the window open. Create a FOCUS database for the Master File description by selecting File > Create Database. WebFOCUS Developer Studio displays a browser window that tells you the file was created in your project directory. Close theFile Tool. Now you’re back in the Object Explorer. We’ve got one more thing to do.

Part 2: Generating the Application

Now that your data is set up, you need to generate the prototype application:

1. Right-click the PROTOTYPE Master File description and select Update Assist. Start creating your update application. (For a refresher, see my article in the February issue of the WebFOCUS Newsletter.)

2. At the Update Assist Wizard’s step 2 of 6 panel, right-click and select Rename on both the CUSTADD segment (rename it to Customer Info), and the ORDERS segment (rename it to Place an order). Don’t click Next yet; stay at step 2 of 6.

3. For each field listed in the following table, click the Validation column and choose Dynamic List. For each, select the Master File description and list fields as shown in the table in Figure 2.

Segment/Field Select MFD... Select List Field...
Customer Info/State STATES ROOT_SEG.FIPSCODE
Place an order/Product code PRODUCTS ROOT_SEG.PCODE
Place an order/Sales rep SALESREPS REPS.REPNAME

Figure 2

4. Continue through the wizard, selecting Key Values Selected Via Tree for navigation (the top left option) and any "skin" you prefer. Don’t change any other options, just click Finish to compile, deploy and run your project.

When the project runs, note that the drop-down lists won’t be populated yet – you have to tell WebFOCUS where to find the flat files used in the project, so you must change some code. We will use the new APP FILEDEF command to do this – this way we won’t have to change the FILEDEFs after we’ve deployed the application.

5. Click on your project’s Procedures folder. Right-click the LISTFILL.FEX file. Hey, how did that file get there? LISTFILL.FEX, as its name suggests, is a FOCEXEC that extracts the data for dynamic lists. It’s automatically generated by Update Assist anytime you select the Dynamic List option.

Select Edit > Source. Now add these lines of code to the top of LISTFILL.FEX:

SET PCOMMA=ON
APP FILEDEF STATES DISK ECOM/STATES.DAT
APP FILEDEF SALESREPS DISK ECOM/SALESREPS.DAT
APP FILEDEF PRODUCTS DISK ECOM/PRODUCTS.DAT

Close and save LISTFILL.FEX.

6. Now let’s run the application again. Click the HTML Files folder. You’ll see the two HTML files that Update Assist generated. Right-click Prototype.htm and select Run on Web Server. WebFOCUS Developer Studio opens a browser window, where you can see the navigation bar for your prototype application.

You’re done with the development steps. But don’t close the browser. Now you can add some data.

Part 3: Running the Prototype and Adding Data

When you use an Update Assist-generated application with an empty database, for all empty data segments, Tree navigation displays a dot for the null segment. You can right-click on the dot to enter new data for that segment. In the example shown we’ve already done a New action to enter our first customer record (Big Stores Inc.) and are now adding a new PDA purchase order for them (see Screen 1).

Screen 1

Note: If you choose combo box navigation, the combo boxes display a New command that you may choose to enter new records. (With Edit Box navigation, you’re always on your own – you have to type key codes in at all times.)

Conclusion

As you can see, with Update Assist, prototyping even relatively complex applications, which provide lots of helpful user prompts and feedback is a snap.

In our next installment, we’ll show you how to integrate Update Assist-generated forms into your WebFOCUS Reporting environment to create complete closed-loop applications.

Here are the tutorial files available for download from www.informationbuilders.com/assistfiles:

FILE=products, SUFFIX=COM
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
  FIELD=PCODE, ALIAS=PC, USAGE=A11, ACTUAL=A11,
    TITLE='Product code', $
  FIELD=PNAME, ALIAS=PN, USAGE=A34, ACTUAL=A34,
    TITLE='Product name', $

FILE=STATES, SUFFIX=COM
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
  FIELD=FIPSCODE, ALIAS=CODE, USAGE=A2, ACTUAL=A2, $
  FIELD=STATE_NAME, ALIAS=NAME, USAGE=A30, ACTUAL=A30, $

STATES

AL,Alabama
AK,Alaska
AZ,Arizona
AR,Arkansas
CA,California
CO,Colorado
CT,Connecticut
DE,Delaware
DC,District of Columbia
FL,Florida
GA,Georgia
OK,Oklahoma
HI,Hawaii
ID,Idaho
IL,Illinois
IN,Indiana
IA,Iowa
KS,Kansas
KY,Kentucky
LA,Louisiana
ME,Maine
MD,Maryland
MA,Massachusetts
MI,Michigan
MN,Minnesota
MS,Mississippi
MO,Missouri
MT,Montana
NE,Nebraska
NV,Nevada
NH,New Hampshire
NJ,New Jersey
NM,New Mexico
NY,New York
NC,North Carolina
ND,North Dakota
OH,Ohio
OR,Oregon
PA,Pennsylvania
RI,Rhode Island
SC,South Carolina
SD,South Dakota
TN,Tennessee
TX,Texas
UT,Utah
VT,Vermont
VA,Virginia
WA,Washington
WV,West Virginia
WI,Wisconsin
WY,Wyoming

PRODUCTS

HPIPAQH1910,iPAQ h1910 pocket pc
HPIPAQH3955,iPAQ 3955 pocket pc
HPIPAQH5455,iPAQ h5455 pocket pc
PALMTUNGSTN,Palm Tungsten handheld
PALMZIRE000,Palm Zire handheld
RIMBKBRY857,Blackberry model 857 (pager)
RIMBKBRY957,Blackberry model 957 (PDA)
RIMBBRY5810,BlackBerry model 5810 (GSM/GPRS)
RIMBBRY6210,BlackBerry model 6210 (GSM)
RIMBBRY6510,BlackBerry model 6510 (NexTel)
RIMBBRY6710,BlackBerry model 6710 (WorldBand)
RIMBBRY6750,BlackBerry model 6750 (CDMA)
SNYCLIESJ22,Sony CLIE SJ22 handheld
SNYCLIETG50,Sony CLIE TG50 handheld
SNYCLIENZ90,Sony CLIE NZ90 handheld

SALESREPS

Barney Rubble
Boris Badinov
Bullwinkle J. Moose
Daphne Blake
Elmer Fudd
Eric Cartman
Fred Flintstone
Fred Jones
George Jetson
Homer Simpson
Kenny McCormick
Kyle Broflovski
Natasha Fatale
Norville "Shaggy" Rogers
Ren Hoek
Snidely Whiplash
Stan Marsh
Stimpson J. Cat
Velma Dinkley