A Different Perspective on WDSc
November 3, 2004 Bruce Guetzkow
If you’re using WebSphere Development Studio client to maintain iSeries source, you’re familiar with the Remote Systems Explorer perspective and its associated views. RSE lets you create filters to manage access to source members and other iSeries objects. If you work on more than one user request at a time, however, it may be difficult to keep track of which source members belong with a certain request. The iSeries Projects perspective helps by letting you organize source into projects and to develop even if you are not connected to your host iSeries.
SETTING THE STAGE
The iSeries Projects perspective allows you to create a project folder on your local hard drive, network drive, or the IFS. As you add source to a project, folders are added to identify the original source physical file (QRPGLESRC, QCLLESRC, etc.), and source members are added under the appropriate source file folder with an extension related to its source type. What you get is a structure like this:
The source members that appear in the folders under the project have actually been downloaded to the folder indicated. When you maintain this source, you are maintaining the source on your local drive (or network drive or IFS), not the source in your development library on the iSeries. As you work with this copy of the source, you don’t need to use any iSeries resources until you are ready to verify or compile the source member.
To begin using the iSeries Projects perspective you must first open it. Select the following from the WDSc menu: Window, Open Perspective, then iSeries Projects. You may also select the Open a Perspective icon, on the left border below the File menu and the New tool button, and, again, select iSeries Projects.
You will notice that this perspective looks very much like RSE. Some of the views may be in different locations, but all views available in RSE are also available in iSeries Projects. A new icon has also been added to the left border. By hovering over this icon with your mouse pointer, you will see the text iSeries Projects Perspective appear.
One new view that belongs to this perspective is the iSeries Project Navigator, which should be in the upper-left quadrant of the perspective. This view is what makes this perspective so powerful. With it you will be able to organize your work, download source to your PC, select source to edit, and upload (push) source back to your host system.
CREATING A PROJECT
The first step is to create a project. Begin by selecting the following from the menu: File, New, then iSeries Project. The tool bar may also contain a button labeled Create an iSeries Project as another option. This displays a window used to define the project. You will be asked for the following information:
- Project name, which can be any text that identifies the project.
- Project contents, which identifies the path to the folder for this project. Initially the use default checkbox is selected. I strongly recommend that you uncheck this box. Leaving this box checked means that all source for all projects will be placed in the same folder, which defeats the purpose of organizing source by project. A browse button is provided to simplify selecting an appropriate path.
Before filling in these two values, you should think about the ramifications of your actions. Your shop’s development environment needs to be taken into consideration. If your developers are like me, and work on a notebook in different locations, you may want to create your projects on the local drive. This way, wherever you are, your project (and source) goes with you, whether you are connected to your host system or not. If your developers always work in the same location, you may want to establish your projects on a network drive or the IFS. The choice is yours; just be sure you understand what is involved.
After unchecking the use default checkbox and clicking the browse button, you will be presented with a window that allows you to drill down to the folder of your choice. I have created a folder called iSeries projects under the My Documents folder, where I store all of my project source. I then create individual project folders named with the modification mark that I use in my source members to identify lines of code that have been changed, like this:
To add a new folder, use the Make New Folder button and rename the folder accordingly. Click OK to create the project folder, and then click Next. Another window will appear, asking you to identify your connection and an associated library. The connection refers to the development host iSeries. The associated library is your development library, not your production library. This is the library where modified source members will be uploaded (pushed) before compiling and testing. After filling in these values, click Next.
One last window appears, where you can select your build style. You can specify a program or command to run that will compile all of your project source for you (preferences for this feature can be found under iSeries Projects, then Build and Compile). I suggest that you select CL Program or Command. If you specify *NONE, the options to push source to the host will not be available.
ADDING SOURCE TO A PROJECT
There are several methods that you can use to add source to your project. From the iSeries Project Navigator view, you can right-click the project name and select Import Remote Objects. . . . This will bring up a window where you can drill down to the source file and members that you want added to your project. You can only download from one source file at a time, but you can select multiple members by holding the Ctrl key down while you click additional members. Click OK to begin downloading the selected members. You can’t double-click a member name as a shortcut to selecting the member and clicking OK, as this will open the source from the host system in the default editor without downloading. (I find this to be an annoying quirk.)
Another method is to begin from the Remote Systems view. Right-click a member and select Add To iSeries Project. You will then see a window listing available projects. Select a project and click OK (here you can double-click the project name) and a confirmation window is presented. Clicking Yes adds the source to your project and returns you to the iSeries Project Navigator view. You can use the same process from the iSeries Table view.
TESTING YOUR CHANGES
When you have completed your source changes, you can push source members back to the host system by right-clicking individual source members, right-clicking the source file for all source members in that folder, or right-clicking the project for all source members in the project.
Regardless of which option you choose, you can select Remote Actions, Push Selected, or Push Changes to push the selected source, or only push those items that have been changed since they were last pushed. You can then select the Remote Systems view and compile source members as you did in RSE.
With release 5.1.2 you can now compile directly from the iSeries Project Navigator view by right-clicking the member name and selecting Remote Actions, then Compile. Your source is first pushed to the host, and then compiled with the command selected.
If you specified a build style of CL Program, you can also create a CLLE program that contains compile commands for all of your source members. To compile all source objects, right-click the project name and select Remote Actions, then Submit Build. This creates the CLLE source program (default name COMPILE), pushes it and all of your source members to your host system, compiles the COMPILE CLLE source to library QTEMP, and then executes that program to compile your source members. You may need to do additional steps to build or update service programs and bound programs affected by your source changes.
COMPLETING YOUR PROJECT
When you have finished modifying and testing your changes, make sure all source is pushed to the host system. To close your project, right-click the project name and select Close Project. This causes the project to disappear from the iSeries Projects Navigator view. The folders and source have not been deleted; they’re just hidden from view. If you need to reinstate the project, go to another new view: Navigator. All projects, open or closed, are listed here. Right-click the project that you wish to reinstate and select Open Project.
TRY IT FOR YOURSELF
Organize yourself, work offline, and free up host resources. Now that you have seen how to get started with the iSeries Projects perspective, you are ready to become even more productive. Try it for a week and, like me, you may never go back to RSE.
Bruce Guetzkow has programmed on the AS/400 and iSeries since 1990, in manufacturing, distribution, and other industries. He is currently the IS director at United Credit Service in Elkhorn, Wisconsin. Click here to contact Bruce by e-mail.