H5 first impressions

by StevenP 

The long awaited H5 Clarion-for-web-apps template are here. They arrived, not with a big announcement, but by someone discovering a series of four videos on YouTube (a later email from SoftVelocity had a similar link to the SV site). 

H5 was supposed to combine strengths the original Internet Connect product (ease of adding a web UI) with the best of Web Builder (no massive download of Java classes). A new app Broker would run as a service (combining the original EXE and ISAPI brokers). And it would use some of the more fashionable technologies (JQuery, AJAX, etc.) 

I always recommended "do the tutorial, beginning to end" for both new users and developers "coming up" from C5 or C6 to newer versions. Well, at the moment, there are no H5 tutorials. Instead, watch the videos. And take notes! 

Yes, there is a new "Exe broker," AppBroker.exe (the "old" one was C60APS50.EXE), that is installed with Enterprise Edition. And there is a new broker installer, for stand-alone installations that installs the broker and the service manager (by default, to C:\AppBroker). 

AppBrokerServiceMgr.exe replaces the previous broker's on-line management tools. It provides all the same management tools as before and adds the ability to start and stop the Broker service. 

Figure 1: Broker Management Menu

It is covered in one of the first four videos. Watch it. 

If you installed the broker successfully, you should see it in your app tray: 

Figure 2: Broker Icon in App Tray

Configuring the Broker is, for me, highly reminiscent of the CWIC EXE broker and some of the tips and hints published at that time are probably still relevant. Though, do take a moment to run "localhost," without calling an app. If your install is good, SoftVelocity provides an Index.htm that will verify it. If you see the page, you're good. If not, you're not. 

Okay, then, with the broker installed and tested, the first question everyone had is exactly the same as it was with the original CWIC in 1998/9: Is it "just" a matter of adding a template? 

Figure 3: Adding (the correct) Global Extension

(Beware, you may still have the "old" SV WEB Extension Template. This one is at the very end of the "Select Extension" list.)

Figure 4: The installed Extension

And, the answer in 2016 is also exactly the same as it was with the original CWIC in 1998/9.

For my first H5 experiment, I selected a simple .APP. It is a simple window that takes a date and displays a Clarion Standard date. And, because the app depends on code in the ACCEPTED embed for the date entry, I get to test whether H5 executes embedded code as expected or not (it was an ... uh, adventure in the early days of CWIC).

Compile and distribute the files as instructed in the video (I didn't take notes and, so, did very unpleasant things to the pooch; that's why I started by recommending you take notes). Your EXE and any required DLLs (including skeleton.dll, which Clarion will copy into your output directory), including Clarion DLLs, go to \EXEC or to a directory under \EXEC. There is also a <AppName>_Global.js file generated into your app directory. Copy it to \PUBLIC (that's the step I missed; I copied it to \EXEC - but not until I remembered ... without it your app may very well run, mine did, but not run correctly and you'll blame H5; I did).

Run the app, in Windows, from \EXEC to be 100% that you've copied everything.

Figure 5: Running in Windows to verify

Now, if something goes wrong, you'll know.

Now open a browser and call your app.

Figure 6: Call in a browser (note syntax)

And, lo and behold!

Figure 7: App running in browser

And, does the Standard date show after entering a date (in m/dd/yy format) and pressing TAB? Is the ACCEPTED embed triggered?

Figure 8. After pressing tab the embedded code executes

And, yes, it will time out in about 10 minutes (the template default).

Aesthetics? Same as original CWIC. It will take some developer work (and or template option setting, I haven't explored that but more videos are promised and, already, a number of developers are hacking away at it, most posting in the C10 news group).

For my second H5 experiment, I selected a real monster, an app with a single window (presentation layer) and a DLL (where all the work is done - it's proprietary, so no screen shots). The DLL calls several other DLLs (data, utilities, etc., total is one EXE and four DLLs plus Clarion DLLs). A real monster, right? Yeah, sure.

The window's code runs almost 900 lines. There are sheets-within-sheets-within-tabs-within .... Flat radio buttons galore, option structures like Carter used to have little pills. List boxes directly from hand coded queues and, then, there's the hard stuff.... Grown men tremble when faced with having to maintain this window (I know, I'm the one!).

Starting at the bottom of the tree, with the data DLL, I dutifully add the H5 extension, recompiled and copied things to where they needed to be. After the EXE, I copied the .js file and fired up my browser and waited and waited and ... eventually the browser gave me the "Application did not execute" page (a lot better looking than the old one, by the way).

Long story, very long, short. When SV say to put the H5 extension on all the .APPs in the calling chain, it means "all." The .APP at the bottom of my chain was a hand-coded .PRJ to include functions to handle UAC and putting INI files in specific locations. Once I removed it from all the .APPs, badda bing badda boom! the app ran and ran correctly.

Aesthetics were not great but almost everything worked as expected. What didn't work? Two List Controls "From" a hand coded queue. These are probably interpreted as HTML <Select>s, which support only one column and displayed as drop downs. Changing the Class used by the control would probably fix it up.

Conclusion

There may not be a tutorial, but the initial videos provide an alternative. Use the school app to H5-ify for yourself. This will allow you to see any difference.

H5 is a worthy successor to IC/WB. The AppBroker is definitely improved. Those of you already (or still) using IC/WB can probably apply almost all of what you already know. And, there are alternate themes out there for the downloading.

The caveat? It remains the same as it always was. IC/WB/H5 apps do not scale indefinitely (though the many available load balancers will certainly help) and will not likely deal well with hundreds of thousands of simultaneous hits.

Just keep a look out for more instructional videos.