IBM i > DEVELOPER > RPG

Gabby, Come Chat With Me

A new project for RPG and web apps


Next, we’ll take a look at the CHATGABV1 RPG *PGM on the IBM i server side that’s using OpenRPGUI to do the dynamic processing, as shown in Code Sample 2. The entire CHATGABV1 is less than 180 lines of code and can be summarized into two subprocedures—btnPstText and loadRecentPst. The btnPstText is first obtaining the next available PSTID from the CGPOST table and the occupying the CGPOST row (aka record) and writing it to the database. The CGPOST table definition is shown in Code Sample 3. The loadRecentPst subprocedure is receiving in the last PSTID from the browser (i.e., startAtId) and subsequently doing a SETLL to create an outbound JSON text stream back to the browser with the most recent chat records. Those reading this article are most likely RPG programmers, and because I’ve covered the HTTP and JSON service program functionalities in previous articles, I won’t be exhausting those topics here. To see a list of the previous OpenRPGUI articles I’ve written for IBMSystemsMag.com, head over to my OpenRPGUI site and select the Articles dropdown.

The last thing I wanted to comment about is the Apache configuration used for Chatty Gabby. The full URL for the Chatty Gabby home page is actually http://ChattyGabby.com/v1.html. The reason you can go to the root of the domain (http://ChattyGabby.com/) and have the v1.html display is because I’ve specified the v1.html file as the “DirectoryIndex” in my Apache configuration, shown in Code Sample 5.

Little You Can’t Do With RPG I hope I’ve piqued your interest and that Chatty Gabby will inspire others to test the waters with cool ideas to try with OpenRPGUI on IBM i. Note that an idea doesn’t have to be original to be good—chat in the browser is hardly original. Rarely is the originator of an idea the one who’s successful with it. Sometimes the person who can “make a better wheel” is the one who succeeds. For example, you could expound on ChattyGabby and make it a competitor to LivePerson, a hosted chat service companies use to provide real-time support to their customers. Think of the situation of having all of the same features as LivePerson, but not needing the same amount of internal personnel because you could host it all on one integrated IBM i and not require server farms, as LivePerson is most likely doing.

Stay tuned for more and exciting things you can do with RPG on IBM i. As I like to say: There is very little you can’t do with RPG.

Aaron Bartell is co-founder of PowerRuby and an IBM Champion. Aaron can be reached at aaronbartell@mowyourlawn.com.


comments powered by Disqus
Buyers Guide

Advertisement

New and Improved XML-INTO

Namespace support makes the opcode a viable option

Authenticating on the Web

The finer points of OpenRPGUI, Part 1

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
IBMi News Sign Up Today! Past News Letters

Advertisement