Chapter 15. The Web


Chapter 15. The Web!

Getting your forms on the Web takes us now into new territory. If you've gotten this far, you've already done a load of guerrilla work, so tackling another mini-guerrilla task will be nothing!

We're going to move away from the world of the Oracle database, SQL*Plus, and the database server world, to the world of browsers, "middle tier ," and a host of new terminology (such as applet ). You can do it, and believe me, when you're done, you'll be rather proud.

To make the quantum leap from your client/serverbased application to the world of the Web, you have to do several things:

  • Acquire a very basic understanding of what's going to happen and why.

  • Install Oracle9 i Application Server (9 i AS).

  • Slightly modify your forms application and move it to the 9 i AS server.

Regarding the Web technology, I'm going to give you just enough information here so that the next couple of pages make sense. To make your system work, and then to support it, you have to know some of the architecture, buzz-words, and how the parts fit together.

Briefly, here's what a three-tier system is:

  1. A client PC with a browser

  2. A Web server somewhere that the client PC talks to

  3. A database somewhere from which the Web server, or middle tier, grabs information and passes that information to the client

Because Oracle has given us a pretty good tool for creating three-tier systems, without much ado we're going to create one ourselves .

Let's see what we already have. We all have a client PC with a browser, right? We've already created a significant computer waiver exam database. And we've created a rather nice Forms-based GUI system for the user . What's next? Right! Build the middle tier , the Web server.

As I said, Oracle has handed us a great product, 9 i Application Server, that we can use for our Web deployment. 9 i AS is the latest in a series of Web products. It is Oracle's attempt to bundle all the parts into one package. One major feature is that 9 i AS includes the Apache Web server, the de facto industry standard. In addition, 9 i AS does automatic configurations and provides an easy way to test the installation.

Let's get started. In a nutshell , here are the steps:

  1. Install the 9 i AS Server software with Web features.

  2. Test the software.

  3. Test a quick and dirty form.

  4. Test the client PCs.

  5. Modify our forms system.

  6. Move our forms to the Web server.

I'll explain the details as we go along. Remember, we're going after the missing piecethe middle tier. This tier has to listen to both the client and the database server, and then do work for both. In effect, it is the middleman in the entire schema.

Warning

Unlike Oracle Web, the 9 i AS server has to be on its own machine. Do not put it on the same server with your database! If you do, it won't work and you'll end up having to redo everything.

Also make sure that no other Oracle products are installed. If you have any doubts , take a look at your registry under Local Machine Software , and also scan your drives looking for "Oracle," "ORA," or "ORAINST." Again, if there are any other products or residue, you will run into all kinds of problems during the installation. If necessary, completely rebuild your server. That's what I did!


Before you do anything with 9 i AS, you need a server, whether NT or W2K. So build or find one, and make sure it has nothing on it. You do not want to run any other Oracle or office-type applications with your 9 i AS server, or serious Web degradation will happen.

Now install your licensed 9 i AS CD, start it up, and after the standard, gray Universal Installer screen, you'll see this:

graphics/15fig01.jpg

If you select Yes , you'll get a bit more documentation as you go through the installation. Hit Next , and you'll see the standard Welcome screen, then a brief status bar followed by the selection screen. Choose the full-blown system, Enterprise Edition , to get the Forms server components :

graphics/15fig02.gif

graphics/15fig03.jpg

Warning

Notice that you need 3GB of disk space!


Next take the default directories for the various 8.06 and 8.07 components:

graphics/15fig03a.gif

graphics/15fig03b.jpg

For now, just select two products to install: (1) Oracle9iAS Forms Server and Oracle9iAS Reports Server and (2) Oracle HTTP Server in SSL Mode :

graphics/15fig04.jpg

Then for the next couple of minutes, watch the installation screens and status bars:

graphics/15fig05.jpg

graphics/15fig06.gif

Note that CPU usage may hit 100 percent or close to it at times:

graphics/15fig07.gif

Take the defaults for the portal screens, since we're not installing the portal product.

graphics/15fig08.jpg

graphics/15fig09.jpg

Skip over the "Wireless Edition" screens:

graphics/15fig10.gif

graphics/15fig11.gif

graphics/15fig12.gif

On the Summary screen, notice the Apache Web server, HTTP, and Forms server entries. (If these entries are not shown, go back and start over. These are about the only things we want from 9 i AS for our purposes.)

graphics/15fig13.jpg

graphics/15fig14.jpg

Now click on Install , and the fun will begin. This can take some time, and you will see "Copying" and then "Installing" messages flashing constantly. (It may seem as if the system has stalled, but just be patient.)

graphics/15fig15.gif

Toward the end of the installation the screen will refresh a couple of times, and various displays will appear:

graphics/15fig16.gif

Note

Those of you with supersharp eyes will notice that the screens change between using the Oracle Universal Installer and the Oracle Installer. This causes problems only if later you have to deinstall, because the Universal Installer cannot uninstall products installed by the Oracle Installer!


Notice that even though you did not select the portal package, some portal components will be installed:

graphics/15fig17.jpg

The installer will stay at 100 percent for a bit, while it wraps up the installation. Just leave it alone. The final screen gives you a chance to add additional features (I suggest just taking a look at what has been installed, and then hitting Exit ):

graphics/15fig18.jpg

Since we do not want any additional features, just exit by clicking Close :

graphics/15fig19.gif

Now check your Programs directory and notice all the new Oracle programs:

graphics/15fig20.gif

Note also that you now have new services for the Oracle tasks you just installed:

graphics/15fig21.gif

Now test your work. Oracle provides a neat tool for this purpose. Just go to Start Programs Forms 6i Run Form on the Web , and then take the defaults and run the test form:

graphics/15fig22.gif

You should see the following message:

graphics/15fig23.gif

That's all there is to building a basic 9 i AS server that will manage our forms on the Web. As many of you know, quite a bit goes into making this product so solid and easy to installitems such as HTML, Java, configuration files, and a host of other things. But using and modifying these are topics for another time; these are some of the things that will be covered in the next book. What I want to do here is get you going on using the Web without too much confusion or head banging. If you have received the message shown in the last screen shot, you're almost there!

Take a moment and look at the URL in the previous test screen. You'll see the Web server name , followed by a series of parameters. Every parameter means something:

 http://Guerrilla_Oracle/ graphics/1_icon.gif dev60cgi/ifcgi60.exe graphics/2_icon.gif ? graphics/3_icon.gif form=test.fmx &userid= graphics/4_icon.gif &otherparms=useSDI=yes &lookAndFeel=generic &colorScheme=teal 

(1) The "http:" portion points to the server.

(2) This is the path to the .fmx program.

(3) The question mark indicates that variables follow.

(4) These are parameters that the system will use to find the .fmx file and then paint the screens.

Tip

For added testing, I suggest that you now build a quick and dirty form using one table, run it, fix errors, and then compile it. When it's ready, move it (the .fmx file) to the Web server ( <ORACLE HOME>/FORMS60 ), test it on the server, and then run your new form again on a client PC .

To test, use the same URL but use your form name instead of "TEST.FMX", and test on all operating systems that will access your forms. If it works, read on in the text. Otherwise debug your program until it runs cleanly. Then read on. (One reason I want you to run a test on a local PC is to make sure that the local broswer is 9 i AS compatible. Using Internet Explorer, version 5 or higher, is required . Check the Oracle documentation for more details if necessary. Also you'll feel good if your test works the first time, and this will give you a confidence boost to continue.)


Here's an example of a quick and dirty form that was created through use of only the STUDENTS table. It was called WEBTEST.fmx . We just used its name instead of TEST.fmx once we moved it into the <ORACLE HOME>/FORMS60 directory. Here's the URL, using a made-up IP address:

http://111.111.11.11/dev60cgi/ifcgi60.exe?form=webtest.fmx&userid=&otherparms=useSDI=yes&lookAndFeel=generic&colorScheme=teal)

graphics/15fig24.gif

Note

Oracle 9 i AS is very Java-oriented, and it defaults to using Java programs for the Web interface. The first time a client PC tries to run a forms program, you may get a screen asking if you want to install JInitiator. Say yes, and then just take the defaults as the product is installed. There is a lot more to this, but installing JInitiator is enough for now.


The last step, as I said, is to tweak the forms you've developed. Splash screens are handled differently on the Web (actually they become part of the Web configuration files, but that is beyond the scope of this chapter). So all we're going to do is to disable the logic for the splash screen and remove the screen.

What do we do? We have a very successful client/server system running, and we don't want to make the programming too complicated. What I suggest for this book is that you copy CWE1P_MAIN.fmb as WEBCWE1P_MAIN.fmb .Then make your changes to the "web" file. Why? This way you will maintain the integrity of your client/server product. After your copying, your Guerrilla Oracle folder should look like this:

graphics/15fig25.gif

Now remove the splash screen, including the timer code and triggers. This is easy:

  1. Open the WEBCWE1P_MAIN.fmb file, and remove the WHEN_TIMER_EXPIRED trigger, the CWE1P_SPLASH_BLOCK block, and the CWE1P_SPLASH_CANVAS canvas:

    graphics/15fig26.gif

  2. Change the code in the PRE-FORM trigger to disable the splash screen and trigger:

    graphics/15fig27.gif

  3. Run the form in client/server mode, and fix any errors.

  4. Compile, run again in client/server mode, and save the form.

    Note

    I can't emphasize enough how important it is to compile and save .In fact, if you don't see your changes, the reason is that you did not compile the forms in the correct order. Basically, you have to compile from the bottom up. It never hurts anything to compile your program, so if in doubt, just compile right up the ladder: first the canvas, then the data block, then the entire form. Also compile all canvases while you're at it. And don't forget to compile the WEBCWE1P_MAIN form because you've changed the form that it calls.

  5. Now run everything in client/server mode. The normal function keys will still work. Fix any errors.

Now how do we get this thing onto the Web? All we have to do is copy the .fmx and .mmx files to your new Web server. But here's where it gets a little tricky. The general rule is to put your main .fmx module into the <ORACLEHOME>/FORMS60 directory. Why? Because that's the default spot. (For those of you who are experienced at working with the Web, you can put the files anywhere as long as you have the path specified in the registry under FORMS60PATH . I'll get into much more on this in the next book.)

However, remember that we have globals that point to D:\GUERRILLAORACLE? Well, we had two choices. For our Web files we could change the globals to point to somewhere else, or we could just make a GUERRILLA ORACLE folder on the Web server D: drive and put all the other files there. To keep things simple, I suggest that you do make a folder on the D: drive, and put a full copy of the GUERRILLA ORACLE folder there. If you have the .fmb files, don't worry; they won't hurt anything. When you're all done with your testing, you can delete the .fmb and .mmb files.

You have now done two things:

  1. Copied the WEBCWE1P_MAIN.FMX folder over to the FORMS60 directory on the Web server.

  2. Created a copy of the Guerrilla Oracle folder on the Web server D: drive (or you've changed the globals to point to another drive on the Web server).

You're ready to test!

Note

There is one other very important step: Check the keyboard file on the Web server. Oracle has a file ( fmrweb.res ) that it uses to map the keyboard. However, this map assumes that the keyboard emulates the VT-100. What this means is that some PC function keys may not work unless you change the map file. However, Oracle has included another keyboard map file ( fmrPCweb.res ) designed for the 101-key PC keyboard.

If you find that the function keys F8 and F9 do not work, go to the Web server, look in the <ORACLE HOME>/FORMS60 directory, and find the file fmrweb.res . Rename it original_fmrweb.res .Now find the file fmrPCweb.res in the same directory, make a copy of it, and then rename it fmrweb.res .The function keys should now work fine.


To test, go back to the Web server and choose Run Form on the Web under Start Programs Forms 6 i , and put the name"WEBCWE1P_MAIN.FMX"on the form. You should see the main Guerrilla Exams screen. If not, you'll get a form error, and you can look it up (rememberunder Help in Forms, type in "FRM", and you'll get a list of all error codes). Most likely you'll run into misspellings or something similar. Just make one change at a time, or you're asking for trouble.

Now for the grand finale, run your form from a client PC:

  1. Open your browser.

  2. Here's the URL to start with:

     http://<your Web server address> graphics/1_icon.gif /dev60cgi/ifcgi60.exe ?form= WEBCWE1P_MAIN.FMX graphics/2_icon.gif 

    (1) Plug in your IP address.

    (2) Then make the "?form=" section refer to your MAIN.fmx form.

    And here's what the URL should look like in your browser:

    /dev60cgi/ifcgi60.exe?form=webcwe1p_main.fmx">http://<yourIPaddress>/dev60cgi/ifcgi60.exe?form=webcwe1p_main.fmx

  3. If you see a message to load JInitiator, install it.

  4. First the "loading applet" message appears. Next the Oracle logon screen appears, followed by the Guerrilla Oracle main screen:

    graphics/15fig28.gif

    graphics/15fig29.gif

    graphics/15fig30.gif

Select EXAMS , enter the necessary data, and you should then see the "take test" screen. After you enter a test ID, hit F9 and the pop-up list will appear. Select the test you want:

graphics/15fig31.gif

Click Register and Continue to the test , and the actual exam screen will appear:

graphics/15fig32.gif

Put the cursor in the Question Id block, hit F8 , and the first question will appear. Use the scroll bar to go through all the questions.

Did you notice that we also tweaked the message on the "take test" screen to tell the user to use F8 and the scroll bar? Good. Make those changes on your own screen. I also suggest that you now go back and create another menu bar for this screen that has only a few items, such as Help , Save , and Exit .

Also I stronglyvery strongly advise that you actually take a waiver test and try everything before turning your system loose. You may find some odds and ends that need correcting; you may find some things that are quirky in your environment. Try to make the system as bulletproof as possible because your users will push it to its limits. There are some shortcomings in the system I've shown you, but I'm sure you will take the examples and enhance them to fit your own design and environment. I've given you the basics; now go to specific manuals on forms and dig through them to make your Guerrilla waiver exam system even better!

What's that I hear? Is it the graduation march ? Well, you may not have realized it yet, but you're at the end of the book. Congratulations! I don't have any profound quotes or wise sayings. You've shown incredible tenacity and intellectual acuity to have reached this point, and I hope your journey has been rewarding .



Guerrilla Oracle
Guerrilla Oracle: The Succinct Windows Perspective
ISBN: 0201750775
EAN: 2147483647
Year: 2003
Pages: 84

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net