Now that you know what a WebFOCUS Maintain application is and how it works, you are ready for a step-by-step view of the development process. This section summarizes the steps.
A good way to get started immediately developing WebFOCUS Maintain applications is by using Update Assist. All you need is a Master File for the data source for the application you want to create. For more information, see the Developing Reporting Applications manual.
Your first step is to create the project file for the application. The project file keeps track of all the pieces of the application: procedures, forms, images, scripts, data source descriptions, and so on.
WebFOCUS Developer Studio opens.
or
Right-click Projects on localhost, and click New Project.
The Create a Project - Step 1 of 2 dialog box opens.
The Create a Project - Step 2 of 2 dialog box opens.
WebFOCUS Maintain creates a briefcase for your project with four components, HTML Files, Maintain Files, Master Files, and Procedures, and places it in the Explorer.
For a more complete overview of setting up your project, see Setting Up Your WebFOCUS Maintain Project in the Developing WebFOCUS Maintain Applications manual.
The purpose of most WebFOCUS Maintain applications is to manipulate data in a data source. Before WebFOCUS Maintain can do this, it has to know what the data in the data source looks like. It does this using a data source description (also known as a Master File).
There are two methods for putting a data source description into your project, depending on whether it already exists:
If a data source description is in your project path, you can easily add the data source description to your project.
Note: You can easily add directories to your project path by right-clicking the project, clicking Properties to open the Properties dialog box, and clicking the Directories tab.
If the data source description is not in your project path, open WebFOCUS Environments (at the bottom of the left pane of the Explorer window). It contains your local WebFOCUS development server (localhost), as well as any other WebFOCUS Servers you have set yourself up to access. Open the WebFOCUS Server where the data source description resides and find it (usually in Data Servers\EDASERVE\Applications). Then drag it into your project folder.
Your next step is to plan which platform should run each piece of logic in your application. This is called logically partitioning the application.
In general, you must classify each piece of logic into one of two types:
If you have more than one WebFOCUS Server in your environment, you must determine on which server each piece of data access logic needs to run.
Logically partitioning the application enables you to place each procedure on a different WebFOCUS Server easily. The Maintain language contains a special command, CALL, which enables one procedure to run another procedure at any WebFOCUS Server.
To create a procedure, follow these steps:
Your next step in developing an application will probably be to create the front end, meaning the user interface with which the end user interacts. Your user interface is made up of forms, which you develop using the Form Editor.
To create a form:
One of your procedures is designated as the starting procedure, which means that WebFOCUS Maintain runs this procedure to run your application. You probably want the opening form of your application to be in this procedure (although it does not have to be here). You use the project Properties dialog box to specify the starting procedure.
WebFOCUS Maintain supplies you with a form (named Form1) in every procedure and supplies the code to display this form immediately after running the application. Using the name Form1 in the initial form of your application is recommended.
After you have created your forms, edit them using the Form Editor.
Here is a brief overview of how to create forms using the Form Editor:
These controls represent various graphic elements that you are probably familiar with (text boxes, radio buttons, and check boxes).
To place a control on the form, first click the control on the Maintain Controls Palette. Then move your cursor to the form and click and drag a rectangle that defines the size of the control.
After you place controls on a form, you can easily move them around and resize them. The Form Editor also contains many alignment tools that enable you to place your controls exactly where you want them.
Properties define how form and control appear, and how they behave at run time.
To change a property, select it in the list and then click the box at the right and type a new value. To change some of the properties, you must open a dialog box. Do this by double-clicking the property name.
You can also set many of these properties at run time by dragging and dropping them into an open text-editing window.
An event can be anything done by the end user such as opening a form, clicking a button, or typing text in a field. You use the Event Handler editor to assign these events to some action, such as retrieving data from a data source, opening another form, writing data to a data source, or verifying a value.
You can open the Event Handler editor in one of the following ways:
After you open the Event Handler editor and select a combination of a control and an event, you can assign one of the following actions:
For more information on the Form Editor, see Using the Form Editor, Developing and Using Forms, Defining Events and Event Handlers, and Developing and Using Controls in the Developing WebFOCUS Maintain Applications manual.
How to: |
Your next step in developing the application is to create the data access logic, meaning the code that extracts data from the data source, manipulates it, and writes it back to the data source.
You code all of your data access logic using the Maintain language. The Maintain language is a robust yet simple, object-based 4GL. It is consistent across all platforms while incorporating the functionality of a 3GL and the data access capabilities of SQL.
You must specify which data sources you want a procedure to access before writing any code to read or write to that data source.
Specify which data sources you want a procedure to access.
You can easily obtain context-sensitive help by selecting any keyword and pressing F1. Notice also that your procedure code is color-coded.
How to: |
After you have written the front-end and data access procedures, you must set them up to call each other, and pass data back and forth. Since all variables are local, meaning defined only within the context of a procedure, you must pass these variables back and forth.
For example, suppose you have an application running on a Windows web server that accesses accounting data on UNIX and inventory data on MVS. A procedure called GetAccData accesses the data on the UNIX machine and a procedure called GetInvData accesses the data on the MVS machine. Both of these procedures pass the data back to the procedure Start on the Windows machine, which displays a form with this data.
For more information, see Command Reference in the Maintain Language Reference manual.
How to: |
WebFOCUS Maintain enables you to incorporate many other types of files into your application. Here are some of the most common:
JavaScripts and VBScripts can perform local validation. Local validation enables validating user interaction on a webpage without having to return to the web server.
You can include script libraries, and then assign functions in the script libraries to event handlers in the Event Handler editor.
For more information, see Defining Events and Event Handlers in the Developing WebFOCUS Maintain Applications manual.
If the WebFOCUS procedure already exists, you can simply include it in your application.
You could also type in the syntax. See the description of EXEC in Command Reference in the Maintain Language Reference manual.
For more information, see Using WebFOCUS Procedures in Your Application in the Developing WebFOCUS Maintain Applications manual.
After you have created all of your application procedures, it is time to test them. If you test your application locally before deploying it, you can determine whether an application works without worrying about the WebFOCUS Server environment.
Note: If you decide to test your application locally, you must have your data source residing locally. If you cannot easily obtain local versions of your data, skip this step.
To test your application, click the Deploy and Run scenario button on the Exploring toolbar.
If there are any errors, they are listed in the Run tab of the Output window. To find the erroneous code, double-click the syntax in the Run tab, and WebFOCUS Maintain automatically opens the appropriate editor at the line with a problem.
How to: |
Your next step is to deploy your project files, which means moving the components of the project to the appropriate WebFOCUS Servers and web servers for execution. Your deployment scenario determines where your project components should be moved to in order for your application to work. You can have as many deployment scenarios as you wish, so you probably have one deployment scenario using a test WebFOCUS Server, and another deployment scenario that deploys to the production WebFOCUS Server.
Note: The Local Deploy deployment scenario, along with any deployment scenarios you created, appears in the list of deployment scenarios. Local Deploy deploys your application to your local WebFOCUS Server. You cannot edit Local Deploy.
The components of your project appear on the left. A list of the WebFOCUS Servers to which you have access appears on the right.
See Partitioning and Deploying Project Files in the Creating Reporting Applications With Developer Studio manual for more information.
Your project is now ready to be deployed and run.
For more information on deployment, see Partitioning and Deploying Project Files in the Creating Reporting Applications With Developer Studio manual.
Now that you have set up the deployment scenario, you can deploy and test your application.
For more information, see Running WebFOCUS Maintain Applications and Debugging WebFOCUS Maintain Applications in the Developing WebFOCUS Maintain Applications manual.
WebFOCUS |