IBM Support

How to Extend RDi

"How to Extend RDi"

If you wish to extend RDi yourself you can find some useful links below.

Tutorials

APIs

For Rational Developer for i API information, visit:

http://public.dhe.ibm.com/software/awdtools/rdpower/v80/80/documents/api/

For Eclipse RSE information (which Rational Developer for i itself extends),  visit the RSE Developer Guide at:

http://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.rse.doc.isv/guide/

For accessing EVENTF information in order to integrate custom build tooling.

To extend LPEX, (In Lpex, hit Esc to get to the command line and then type in ? and hit Enter)

To access Code Coverage data see:

Install Complementary Products from IBM

If you are developer for another platform such as Z or AIX or Linux, there are complementary products that will integrate with RDi.  A complete list can be found here after click on the link under Shell Sharing.

One free offering from IBM that well benefit any SQL developers is the IBM Data Studio.

Click here for more info on how to install and use this.

Use someone else's extensions

Below is a table where any product or plugin that extends RDi can make themselves known.

Jon Paris has written an article on this subject.

Name

Link

Description

Creator

Free/For Sale

iSphere

http://www.taskforce-it.de

http://sourceforge.net/projects/isphere/

Spooled File Subsystem,

Message File Editor,

Binding Directory Editor,

LPEX Task Tags, ...

Task Force IT-Consulting GmbH,

Thomas Raddatz and others

Open Source
TN5250J http://www.taskforce-it.de IDE embedded 5250 Emulator

Task Force IT-Consulting GmbH,

Kenneth J. Pouncey and others

Open Source
iSVN http://www.taskforce-it.de IBM i Version Control with Subversion Task Force IT-Consulting GmbH Open Source
CMOne http://www.taskforce-it.de Change Management System for IBM i, Windows, Unix and Linux Task Force IT-Consulting GmbH Commercial
PTC Implementer http://www.ptc.com/products/integrity/implementer Application Lifecycle Management system for IBM i PTC Commercial
PAAS

http://pks.de

http://pks.de/en/solutions_2/optimizing-application-development_33/solutions.php

Application understanding,documentation and Analysis Suite PKS Software GmbH Commercial
RSE Extensions http://www.softlanding.com/products/rse-extensions/ Spooled file output; view and respond to IBM i messages; graphical source compare and merge editors for IBM i code; edit data areas; display data queues SoftLanding Systems - a Division of UNICOM Global Open Source
TURNOVER http://www.softlanding.com/products/turnover/turnover-iseries-v100/ Change Management, Project Management, Issue Tracking SoftLanding Systems - a Division of UNICOM Global Commercial
RPGUnit

http://www.tools400.de/rpgunit/update/rdp8.0/

http://www.tools400.de/rpgunit/update/wdsc7.0/

RPGUnit tests from within RDi.

This plug-in uses a fork of the RPGUnit framework from http://rpgunit.org/, because the original RPGUnit project seems to be dead.

Thomas Raddatz Open Source
Surveyor/400

https://www.helpsystems.com/products/ibmi-graphical-productivity

Surveyor/400 has a plugin for IBM RDi that allows you to quickly query and edit database files, download and upload data, run SQL, convert DDS to DDL and many more database tools.  HelpSystems Commercial
RPG Toolbox

https://www.helpsystems.com/products/rpgtoolbox-ibmi/features

Need to convert legacy RPG to free form? The RPG Toolbox from Linoma Software has a plugin for RDi that allows converting RPG fixed-form to the latest totally free form syntax. It also allows indenting nested logic in free form RPG. The RPG Toolbox can additionally clean out unused code in your RPG source including unused work fields, unused subroutines, KLISTS, etc. to make your source easier to maintain and quicker to compile and execute. HelpSystems Commerical

SmartPad4i for RDi

https://www.systemobjects.com/homesp4i.html 

https://www.systemobjects.com/SmartPad4i_for_Rdi.pdf

Use RPG or COBOL to Develop Web & Mobile Applications Directly Within the Rational Developer for i (RDi) Environment

SystemObjects

Commercial

Pathfinder / Hawkeye  http://hawkinfo.com/PathfinderPlugin/update2.0.0 Plugin for the Hawkeye Cross Reference tool for IBM i Pathfinder / Hawkeye Commercial
ABSTRACT https://www.helpsystems.com/products/developer-productivity-tool-ibm-i Developer Productivity tool for the IBM i. Simplify IBM i application development with powerful cross-referencing tools. Abstract works with the IBM (RDi) to build a where-used cross reference of system objects and procedures that allows you to track object and field usage, as well as perform file analysis and other reference tasks. HelpSystems Commercial

How to write a basic plugin that creates a menu action

RDi is written on top of Eclipse which is designed from the bottom up to be extensible.

To extend RDi, you write a plugin that contributes your piece of functionality of top of RDi.  These plugins are typically written in Java in RDi itself.

Basic Eclipse Plugin Development

One of the most recent books that uses the latest Eclipse 4.x mechanisms is Eclipse 4 Plug-in Development by Example Alex.Blewitt 2013.

If you are unfamiliar with Java, this will assume some rudimentary understanding, but it is fairly gentle.

Basically there is one method that puts up a message that looks like


public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
MessageDialog.openInformation(
window.getShell(),
"MyAction",
"RDi is the greatest!");
return null;
}

Basically this is equivalent to an RPG procedure definition called execute.  This procedure (called method in Java), takes in an event and returns an Object.  In this particular case we ignore both the parameter and the return value.  The only thing of interest is that this method is called when the button and menu item you create are selected.  What it does is pop up  a message dialog with the given string.

Please read the first chapter now.  You don't have to finish all of the debugging exercises (but a lot of them would help you even with ILE RPG debugging as well).

How to write a plugin that add an Action to the Remote Systems Explorer

This tutorial is intended to provide a simple step by step guide to create a plugin the adds a menu item.

This tutorial was written with Rational Developer for i 9.6 which is based on Eclipse 4.6 and uses the Java 8 JDK that is shipped with RDi.

Let's start by creating a simply plugin that contributes a menu item that brings up a dialog.

Let create Java Plugin project that will contribute this menu item.

You will notice that a lot of dot-delimited names.  The convention in Java and Eclipse is to use Reverse Domain Name Notation.  So in this example I am assuming you company name is "MyCompany".  Feel free to substitute in your own company name.

1. Create a new Plug-in Project

From the File menu select New->Other...->Plug-in Project

(or you could just hit Ctrl + N)

2. Fill in base Java project properties on the first page of the wizard

The name of the project will end up being the name of the plugin you are creating.  It is by convention in  Reverse Domain Name Notation.

Press Next to go the next page

3. Fill in plug-in project properties on the second page of the wizard

The Version will only become necessary if down the road, someone wants to explicitly depend of a specific version or version range of your plugin.  The Name and Vendor will appear when listing the plugins in Eclipse.  The Activator is use when instantiating the plugin and to access some of the associated resources.  It is not important in this example.

Press Next to go to the template page

4. Fill in the Template page of the wizard

Select Hello World, Command to get the ability to create menu and toolbar actions.

Simply press the Finish button now.

5. Launch a Runtime copy of Eclipse that has your Plug-in loaded

Select Run>Run Configurations ...

The defaults are acceptable, but you specify a name that is meaningful to you.

Now you should see the new menu item and toolbar item and Ctrl-6 action key

6. Understand what you have generated

plugin.xml

command - with id

command handler associates id with Java class

menu associates with command id

toolbar item associates with command id

Java method invoked to handle command

IBM Code Coverage

Interpreting Code Coverage Results

The API to read code coverage information that is generated either through RDi or through the new CODECOV command.

Go into your RDi installation directory, you will find the com.ibm.debug.pdt.codecoverage.core.result_ plugin. Inside you will find the ccapiext.jar which will contain the latest API that RDi is using. You can use this as your latest API . It should improve which each release, although I expect it is pretty stable by now. The ccapiext.jar is the API that IBM is making available to external people such as yourself. You can find JavaDoc for this from the IDz documentation for now: https://www.ibm.com/support/knowledgecenter/SSQ2R2_14.1.0/com.ibm.codecoverage.javadoc.doc/index.html?view=kc

IBM Data Studio shell sharing with RDi

Overview

The IBM Data Studio client is a no-charge offering that provides an integrated development environment for instance and database administration, routine and SQL application development, and query tuning that can be installed with other IBM software products so that they can share a common environment. IBM Data Studio is based on Eclipse and uses and can share the same IBM package group as Rational Developer for i.

Installation

Regarding IBM Data Studio, it is a separate product from RDi but it is free. You can download it from http://www-01.ibm.com/support/docview.wss?uid=swg24037681#dsfc_tab. Select the 'Full Data Studio product images ' link. After logging in with your IBM id, you will be able to download IBM Data Studio client Install for Windows ibm_ds4130_win.zip (1.9GB). Once downloaded, unzip it and then run the install. During the install, one of the panels lets you to select either a new package group or to use an existing package group. If you select to use an existing package group, you will be able to select the one that has RDi in it. This is what you want to do. Once installed in the same package group, when you start the product you will have the IBM i and the Data tooling together.

Tutorials

This tutorial shows you how to connect to DB2 for i and also shows how to create a stored procedure on IBM i.  Note that in Data Studio - IBM i Libraries are called Schemas.

https://www.youtube.com/watch?v=2njJhyuJ0G4&t=55s

This tuturial assumes a LUW database but illustrates writing and running SQL scripts:

https://www.youtube.com/watch?v=kdrTP48VHBM

https://www.youtube.com/watch?v=2njJhyuJ0G4

API - How to access search results from an EVENTF

The code that handles search results is found in the plugin: com.ibm.etools.iseries.rse.ui.search
in the package: com.ibm.etools.iseries.rse.ui.search
The class SearchFiltersEventsFileParser is a thin subclass of SearchEventsFileParser that handles the fact that you may duplicate records in your search result because you can search multiple connectsion and RSE filters and therefore can have duplicate files.
So the class of interest is SearchEventsFileParser the constructor takes that IFile of the downloaded eventf and the result set to populate.
Here is the code to download the given EVENTF member and parse it into the result set.

Inputs:


SearchResultInputElement resultSet =
new SearchResultInputElement(searchString); // searchString is just used in messages
       boolean mixedConnection = false // is only true if a search crosses multiple filters
/**
* Retrieve events file.
*/
private void parse(
   IQSYSMember member,
   IProgressMonitor monitor,
   IBMiConnection connection) throws Exception
{
  try
  {
  QSYSEditableRemoteSourceFileMember editableMember = new QSYSEditableRemoteSourceFileMember(member);
  editableMember.download(monitor, true);
  IFile file = editableMember.getLocalResource();
  // ignore the events file, because we never will edit it. 
  QSYSTempFileListener.getListener().addIgnoreFile(file); //SE24082
  if (parser == null)
  {
    parser = new SearchFilterEventsFileParser(
                            file,
                            resultSet,
                            mixedConnection);
    parser.setISeriesConnection(connection);
  }
  else
  {
    if (mixedConnection)
    {
       parser.setEvfFile(file);
       parser.setSearchResultSet(resultSet);
       parser.setISeriesConnection(connection);
    }
  }
  parser.parse();
}
catch (Exception e)
  {

    // your error handling

    throw e;
  }
}

Once you have parsed, simply iterate over the result set 

API - How to Access errors from an EVENTF

If you want to populate the error list UI you want to use:

/com.ibm.etools.iseries.rse.ui/src/com/ibm/etools/iseries/rse/util/evfparser/EventsFileParser.java

This class parses the event file from the local IFile and then loads the ErrorList and creates the IMarkers for each error.

If you want to iterate over the errors yourself without any UI then use:

/com.ibm.etools.iseries.toolbox/iseriesut/com/ibm/etools/iseries/util/evfparser/EventsFileParserCore.java

The parser method takes a sequential file reader and calls  

com.ibm.etools.iseries.util.evfparser.IMarkerCreator.createMarker(QSYSEventsFileErrorInformationRecord, String, String)

    public abstract void createMarker(
      QSYSEventsFileErrorInformationRecord record, String fileLocation, 
      String isReadOnly) throws Exception;

for each error (or search result found)
Using this, you  can implement IMarkerCreator and build your own UI.
 
To get the ISequentialFileReader

    if (!_useDefaultEncoding)
    reader = new LineNumberReader(new InputStreamReader(new FileInputStream(newFile.getLocation().makeAbsolute().toOSString()), "UTF8"));
    else 
    reader = new LineNumberReader(new InputStreamReader(new FileInputStream(newFile.getLocation().makeAbsolute().toOSString())));
    ISequentialFileReader sequentialReader = new SequentialLineReader(reader);

 
Enjoy!