Plug-in Developers Reference



Those of us who are developing plug-ins for WDSC / RDi are in for a bit of a shock now that RDi 7.5 has been released.  IBM has moved the RSE from a proprietary, closed source, framework to open source.  Most of the RSE framework is now part of the Eclipse Target Management project.  Obviously the IBM i specific parts aren't included, but the key components are.

As you might imagine, there was a lot of re-factoring of the code ... as just about everything that was part of the com.ibm.etools API have been moved to org.eclipse.rse.

Because of some of the work I did re-factoring my own code, I've made discoveries that other plug-in developers might find useful.

First and foremost, a VERY useful web page to keep handy is the Eclipse RSE Tutorial.

Also, I've started putting together an object name cross reference between the old (WDSC 7.0 / RDi 7.1) API and the new (RDi 7.5) API (see below).  It is by no means comprehensive, complete, or 100% accurate.

If you are developing a WDSC / RDi plug-in, I highly recommend you subscribe to the WDSC Plug-in Developers mailing list that midrange.com hosts.

Read more »

Technorati Tags: , , , ,

Using Eclipselink (Eclipse Persistence Services Project) with DB/2 on System i



This post is about Eclipselink and my experience using it with the System i. It also describes some problems I ran into so you can avoid them if you try Eclipselink.

Eclipselink is Eclipse Persistence Services Project, version 1.0 was released July 9, 2008. See http://www.eclipse.org/eclipselink/ I won’t go into the history and general explanations. For some background on Eclipelink see http://eclipse.dzone.com/articles/introducing-eclipselink. I will say that Eclipselink based on 12 years of commercial usage as Oracles’s Toplink product. Eclipselink is mature and solid.

The focus of this post is

  • Eclipselink is easy to use and works well with DB2 on System I and
  • solutions to some problems that I ran into.

Read more »

Technorati Tags: , , , ,

Build a Tool



Over the past few months I've become quite a tool builder.

The project I'm currently on involves a lot of really repetative code changes and analysis ... basically I've been externalizing as much of the text in the product as I can (to message files).  There are a LOT of display files to be analyzed ... and this particular task looked like it was going to be very very very boring.

However ... rather than trying to analyze each and every display file for text that can be externalized, I wrote a set of programs that would automate the process for me.

The first program read through each display file source member in a source file, parse the DDS, and write a file that contained the source member information; line number; text; length; and other useful bits.  Obviously this program had to be aware of DDS continuation characters.

The next program would read through the file created in the first program and automatically generate messages in a message file that contained the text extracted from the DDS and recorded the generated messages id.

The final program in the set re-processed the source members ... commenting out the lines where the hard coded text existed, and adding a duplicate line that replaced the text with a dummy field and the MSGID keyword (with the message id assigned to the text).

So now you're thinking: Yeah, so?  What's your point?

Read more »

Technorati Tags: , , , ,

5250 for iPhone



The folks at Mochasoft have come out with a new 5250 client for mobile devices ... this one for the iPhone.

There are two versions in the Apple iTunes Store ... a free 'Lite' version and the full version for $29.99.

For what it does, the $29.99 cost is not unreasonable ... although I haven't purchased the full version yet (not sure I'm going to, as I really don't have much need for it).

As with most good iPhone applications, the 5250 emulator works in both portrait & landscape mode ... sensing the orientation of the phone automatically.  In landscape mode it's quite usable for most basic operations.

Read more »

Technorati Tags: , , ,

Context Is Key



Ha!  I'll bet you thought this blog was dead.  Well, in the words of Miracle Max, only mostly dead.

I'm in the process of reading a new programming book (well, not new to some ... new to me).  I'll probably post a review in a week or so (yeah, right).

Anyways, it got me to thinking about some of the questions I've been asked in the past ... and I've noticed a trend.

Often the questions are completely lacking in context.

The question itself is fairly straight forward and simple ... "How do I do so and so?"  And the answer is quite often just as simple ... "Oh, that's easy, just do this, that, and the other thing."

The thing that is unsaid, however, is the CONTEXT of the question.  After I answer such a question, I get to thinking ... WHY did I just get asked that question?

Read more »

Technorati Tags: , , ,

Al Barsa



Al BarsaThis morning, on my way back from COMMON, I received email from a friend informing me that Al Barsa had passed away last night.

This news hit me very hard ... Al has been a pillar of the AS/400 (yes, I use that name deliberately) community for many years and a friend. His passion and enthusiasm for the platform could be matched by very few.

He's been an active participant in the midrange.com lists almost from the their inception ... always willing to share his knowledge, never hesitating to help someone out, pointing them to the right manual, or clearing up some technical detail.

His COMMON sessions were always well received and very informative (if a bit rushed ... but, heck, how else are you going to get through all the system values in a 2 hour session :) ).

My flight leaving Nashville this morning was delayed due to thunderstorms in the area ... which, in retrospect, make sense ... there's bound to be some turbulence when a spirit with the the passion and enthusiasm such as Al's has passed.

From the accounts I've heard, he passed away in his hotel room while working on his laptop ... no doubt revising his sessions for the next COMMON conference.

Our thoughts and prayers go out to Al's family.

midrange.com will be making a contribution to the COMMON Educational Foundation in Al's memory.

Technorati Tags: , , , , , ,

“I” is not a System “I” anymore



Well, I haven't been blogging from COMMON yet ... but I just got out of the IBM Town Hall meeting a few minutes ago.

It was announced that the "System i" and "System p" were merging into a single, unified, platform called "Power".  The OS, originally named OS/400, then I5/OS, is now going to be called "IBM i".

New hardware was announced that would be common between "i", "aix", and "linux" ... all the same price, regardless of the OS that runs on it.

New marketing campaigns that will mention "i" set to be run.  Starting with a full page ad in the local paper.  I think they run a full page ad in the local paper at every conference.  Let's hope they live up to the promise and keep the marketing going.

They also mentioned more academic initiative stuff.

More later.

Easy Field Encyption for System i



For our new billing system (AR), we wanted to store account numbers for so that our customers could auto-pay their bills. After some searching and seeing how complicated the APIs are to use, I found these SQL functions: ENCRYPT_RC2(data, password) and DECRYPT_CHAR(data, password) . These looked promising and being that this is an internal-only system, we thought that this should be okay.

Now the challenge, we don't want to have to use SQL INSERT and UPDATE statements every time we create or update a new record. RPG (Report Program Generator) has built-in commands to do that: WRITE and UPDATE. I found this article that talks about some work-around options. One of which is a trigger. This makes the most sense for our scenario.

By creating the trigger as a "before insert" or "before update" it will take the text passed and encrypt it before actually writing it to the table. Here is a sample:

CREATE TRIGGER MWLIBR.TEST_INSERT
    BEFORE INSERT ON MWLIBR.TESTP
    REFERENCING NEW AS N
    FOR EACH ROW
    MODE DB2ROW
    BEGIN
    DECLARE PASSWD VARCHAR (127) ;
    SET PASSWD = MWLIBR.GETPASS () ;
    SET N.ACCOUNT = ENCRYPT_RC2 (N.ACCOUNT , PASSWD) ;
END;

Notice the GETPASS()? That is the secret to the magic. That is a user created function. I'll get into that in a minute. What this function does is take the ACCOUNT field and encrypt that. You will need to also create one for UPDATE as well. This will take care of your writes. Now you won't have to change anything in your RPG program to update or write to this file.

The function is relatively simple. We simply need to return a "password". I would recommend using a site like goodpassword.com to generate a random password. I used a 80 long string with special characters. Good luck dictionary attacking that hackers! Here is the function:

CREATE FUNCTION MWLIBR.GETPASS ()
           RETURNS CHAR(127)
           LANGUAGE SQL
           SPECIFIC MWLIBR.GETPASS
           NOT DETERMINISTIC
           READS SQL DATA
           CALLED ON NULL INPUT
           DISALLOW PARALLEL
           BEGIN
                      RETURN 'mypassword';
           END;

Now the problem comes in, to keep our model simple, we would like this to be as easy to use as READ to get this data, but we can't just allow anyone to see that information. So we have to add a layer of difficulty in using it. There are a few options, and I'll leave it to you to figure out which will work for you.

  1. Use SQL to access that data. Just a simple
    SELECT DECRYPT_CHAR(myfield, GETPASS()) FROM myfile WHERE mykey = key;

    will get you the account number.

  2. Use an SQL view.
    CREATE VIEW lib/view from SELECT KEY1, KEY2, DECRYPT_CHAR(myfield, GETPASS()) FROM myfile

    The problem with this method is you might as well just not secure it at all unless you lock down this view tight.

  3. The final option would be a subprocedure. There can be two approaches to this.
    1. Write a seperate subprocedure for each field you have encrypted.
    2. Write one subprocedure that could work for everything. For instance:
      getEncryptedField('MYLIB' : 'MYFILE' : 'MYFIELD' : 'WHERE STATEMENT FOR THE KEYS')

      This would look like:

      getEncryptedField('MWLIBR' : 'TESTP' : 'ACCOUNT' : 'TESTKEY = 123 AND KEY2 = 567')

So there you have it. It isn't only complicated and should work for most people. Any problems or comments? Just leave a comment on the thread and if I have any errors, I will immediately correct them.

LUG Services



For those of you involved in System i oriented Local User Groups (LUGs), midrange.com offers some free services that you might like to take advantage of ...

Mailing lists

You can request two types of mailing lists ...

  1. A simple announcement list to broadcast meeting information & other important bits to your membership. This type of list is being used with great success by The Omni User and the Washington Area Midrange users group (WAM). These lists are usually named '<lug name>-announce@midrange.com'.
  2. Private discussion mailing lists for small organizing groups in your LUG ... your BOD, annual tech conference organizing committee, etc. These lists are usually named '<lug name>-<committee name>-discuss@midrange.com'.

To utilize this service, contact me and I can get it setup. Once the list(s) is setup, I'll provide you with a URL for the list administrative interface and a password. You then import your membership email roster into the list and you're ready to go.

As with all midrange.com hosted mailing lists, no subscriber lists will ever be sold or distributed to a third party for any reason.

I can host up to two lists for each LUG for free. If you need more than two lists, let me know and we can discuss it.

Banner Ads

The banner ad serving offer falls into two categories ...

  1. Regular meetings ... targeted at your specific geographic region.
  2. Special events ... annual tech conferences, once a year events, etc. Targeted at entire US.

For the regular meeting banner ad's, you just need to provide me with 468x60 banner ad that advertises your user group, a target url, and the geographic region you cover.

For the special events, you can provide me with one or two banner ad's (one 468x60 and one 300x250) that advertise the event, the target URL, and the effective dates. I will set the banner up to run for the entire US. An example can be found at http://omniuser.org/images/omni07bannerWide1.gif and http://omniuser.org/images/omni07bannerSquare.gif (these were both run for the OmniUser 2007 technical conference).

If you would like to utilize either of these services for your LUG, feel free to contact me at 'support@midrange.com'.

Technician, fix thyself



Similar to the old saying "Physician, heal thyself" ... I certianly should live by those words.

Today I was chasing down a problem on one of our systems at work ... a program that works fine on V5R2 wasn't working on V5R3.

I was 99% sure the problem was in an i5/os server program ... and even found a APAR that described the problem almost to the tee.  Unfortunately, the PTF identified in the APAR didn't help.

So I called IBM and opened a PMR ... I got transfered to Colleen in the languages group, who looked at the job log and source fragment I sent, and sent me a reply indicating that the following link might be useful: http://archive.midrange.com/midrange-l/200505/msg00900.html.

DOH!  Maybe I should have done a bit more research myself before opening up the PMR.

I made the adjustments identified in the MIDRANGE-L posting and, lo and behold, the program worked perfect.

Next Page »