MC Press Online

Tuesday, Jun 27th

Last updateTue, 27 Jun 2017 9am

You are here: Home ARTICLES Programming Programming - Other Development Tools Taking Orion out for a Test Drive

Programming / Development Tools

Taking Orion out for a Test Drive

Support MC Press - Visit Our Sponsors
FORUMS
Element Break 290x14

Visit the MC Press Bookstore often to stock up on our New and Best-Selling Books and e-Books!

Element Break 290x14

NEW BOOK!

Evolve Your RPG Coding: Move from OPM to ILE ... and Beyond


ORDER YOUR COPY

*******************

Click for this Month's

Bookstore Special Deals

Some open-source development adventures of a former IT Director.

I’ve been in out of the IBM i development trenches for a while now. In fact, I can say I haven’t really written too much RPG or CL code in the last five years, due to on the roles I occupied in my former day job as an IT Director. The most I could muster is a whole lot of LotusScript.

While many of us are the master of all trades in our respective shops, it was my good fortune to have a few solid developers working on my team so I could concentrate on strategy and direction, rather than actually making things work behind the scenes. If I needed a report or a function, it was usually just a simple request and it was done later that day.

Over the last couple weeks, in a new job with a different company, I’ve been putting together some relatively long and wide SQL scripts using the Run SQL Scripts utility within the IBM i Access Solutions Client. The challenge was to move those scripts into a program rather than to use Run SQL Scripts. I wanted to automate launching those scripts rather than run them manually.

That led me to Orion.

I suppose I could’ve just copied the scripts into Rational Developer for i and let it handle the formatting of these scripts inside an RPG or CL program and be done with it, but I wanted to see what these new open-source tools could do. After all, those tools are available to IBM i customers at no charge as part of the Open Source Solutions licensed program (5733-OPS). I didn’t want to download 6 GB of RDi for a couple of programs if I could get going with a server-based open-source tool fairly quickly. I also didn’t want to manually muck around copying and pasting and formatting into Source Entry Utility (SEU) out of principle and sanity. And recently, the syntax checker in Orion has been updated to allow Control Language. Maybe a little cart before the horse (or perhaps foreshadowing) because you can’t compile a CL program from an IFS source like you can with an RPG program. Luckily, the i5toolkit project on SourceForge allows you to do just that with a custom command called Create Object From STMF (CRTFRMSTMF). So I’m all set for the most part. Now to get Orion working…

What Is Orion?

Orion is essentially a lightweight, web-based software development environment that runs directly on IBM i. Maybe it’s a perspective change, but I never really thought that I would be excited about a web-based source code editor. I figured that if I was going to edit anything in the form of a project, then I would download RDi or Domino Designer (both Eclipse tools) and “do it right.” Admittedly, that’s a pretty narrow viewpoint from a guy who loves the phrase “if the only tool you know is a hammer, every problem appears as a nail.” With that being said, it was really time to branch out and give some of these new tools a try.

Loading Orion is a snap. I just loaded 5733-OPS option 8 with a RSTLICPGM and then applied the most recent PTF (SI63852). This particular update gives us the Orion 13 base plus syntax highlighting for CL, COBOL, DDS, and UIM as well as some of the recent updates to the RPG language. Orion requires Java 7 or higher; however, I recommend loading Java 8 for security update concerns.

Once you’ve got the licensed program loaded and the requirements satisfied, you can launch Orion via the following Qshell command:

/QOpenSys/QIBM/ProdData/OPS/Orion/orion

To shut it down, enter the following command:

/QOpenSys/QIBM/ProdData/OPS/Orion/stopOrion

Orion listens on port 2025, so you’ll have to tune your web browser to the following address, substituting your own fully qualified host name:

http://yoursystem.yourdomain.com:2025

Note that Orion doesn’t come out of the box using HTTPS by default. You can configure it to use HTTPS using the instructions in the Orion Server Admin Guide. Orion doesn’t use regular IBM i authentication either, so your regular IBM i credentials won’t work. You can register for a new account, sign in using GitHub or Google, or use the admin account (which I’ll explain below).

There are two files underneath the /QOpenSys/QIBM/UserData/OPS/Orion directory (orion.ini and orion.conf), which allow you to do some administrative customizations.

In order to log in as admin, you’ll have to add a line of code in the orion.conf file, which will allow a one-time login as admin with a dummy password. Once you log in, you can (and should) change this password:

orion.auth.admin.default.password=abcdefg

Once you’re in, it’s pretty easy to get going. You can create a new project and then start adding source to it by creating new files. For instance, I added a new project and then created a source file called abc.rpgle. Now it’s just a matter of adding the code within the editor.

I’ve added a simple program so you can see the color coding as it identifies the syntax as RPG.

Taking Orion out for a Test Drive - Figure 1

Figure 1: Editing RPG in Orion

So once the program is ready to compile, you just need to point the CRTBNDRPG program at the source file stored in the Integrated File System (IFS). Yes, the source is stored in the IFS. Note how the path is constructed. I registered as “spitcher” on this Orion instance, so it created a “sp” directory as well as a “spitcher” directory. Once you know (or set) the default directories for your source programs, then it’s just a matter of feeding it to CRTBNDRPG as the SRCSTMF parameter and appending the program name. It would be nice to have a button coded somewhere that would allow an auto-compile feature.

CRTBNDRPG PGM(pgmlib/custpgm) SRCSTMF('/QOpenSys/QIBM/UserData/OPS/Orion/

serverworkspace/sp/spitcher/OrionC

ontent/test/abc.rpgle)

If you’re interested in source control, then you can then publish it to Git, an open-source, distributed source code management (SCM) system that can be applied using PTF SI63502. You can take your source code directory and register it as a Git repository on your system. Then you’re able to track code changes from version to version.

I’m not slick enough to tackle Git just yet. I’ve looked at it, and to be honest, it doesn’t seem that intuitive to get started. However, it’s extremely popular in the open-source community. I’m thinking I need to have someone show this older dog how the new trick works.

Regarding Orion, I think it’s a step in the right direction. I’d love to see some kind of prompting or language-specific help integrated into the product, but, in reality, it’s a simple and effective code editor. I’m impressed. I would encourage someone who has more skill with development on IBM i than myself to give it a try.

These are the tools that new generations of coders will expect to see. Loading them on your IBM i partitions for investigation should be on your list.

Like everything else in 5733-OPS, it won’t cost you a dime to do the 10-cent tour.

Steve Pitcher
Steve Pitcher is a specialist in IBM i and IBM Lotus Domino solutions since 2001. Visit Steve's website, follow his Twitter account, or contact him directly at steven.carl.pitcher@gmail.com.

Website: blog.itechsol.com 
More Articles By This Author
Related Articles
BLOG COMMENTS POWERED BY DISQUS