Вы находитесь на странице: 1из 630

Rational Business Developer

EGL Programmer’s Guide

Version 7 Release 5.1

Rational Business Developer

EGL Programmer’s Guide

Version 7 Release 5.1

Note Before using this information and the product it supports, read the information in “Notices,”

Note Before using this information and the product it supports, read the information in “Notices,” on page 609.

Note Before using this information and the product it supports, read the information in “Notices,” on

This edition applies to version 7.1 of Rational Business Developer and to all subsequent releases and modifications until otherwise indicated in new editions.

© Copyright International Business Machines Corporation 1996, 2008. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents

Introduction .

.

.

.

.

.

.

.

.

.

.

.

.1

Using EGL with the Eclipse IDE

. A typical EGL development workbench .

.

.

 

.

.

.

.

.1

.2

Other windows EGL developers commonly use. Other views and editors EGL developers

commonly use

.

.

.

.

.

.

.

.

.

. 4

.5

. How the workbench is organized

 

.

.

.

.

.

.9

Other information on the workbench .

 

.

.

.

. 11

Enabling

EGL capabilities

.

.

.

.

.

.

.

. 11

.

.

.

.

.

.

.

.

. 12

What’s new in EGL V7.5 . What’s new in EGL V7.1 .

. Language changes in EGL V7.1

.

.

 

.

.

.

.

.

.

.

.

.

. 13

. 14

Changes to parts in EGL V7.1 .

.

.

.

.

.

. 14

Changes to system libraries and variables in EGL

V7.1 .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 15

Changes to build descriptor options in EGL V7.1 16

User interface changes in EGL V7.1

.

.

.

.

. 17

What’s new in EGL V7.0

. Language changes in EGL V7.0

.

.

.

.

.

.

.

.

.

.

.

.

.

. 18

. 19

Validation changes in EGL V7.0

.

.

.

.

. 24

Validation changes in EGL V7.0

.

.

.

.

. 26

Changes to parts in EGL V7.0 .

.

.

.

.

. 28

Changes to system libraries and variables in EGL

V7.0 .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 32

Changes to build descriptor options in EGL V7.0

35

Changes to exception handling in EGL V7.0

 

.

. 36

Changes to services in EGL V7.0 .

.

.

.

.

. 36

User interface changes in EGL V7.0

.

.

.

.

. 37

Migrating from a previous version of EGL .

.

 

.

. 38

Setting EGL-to-EGL migration preferences .

.

. 42

. Migrating EGL code to EGL V6.0 iFix 001 .

Migrating EGL code to EGL V7.0

.

.

.

. 43

. 56

Contents of an EGL application .

.

.

.

67

Introduction to EGL projects

.

.

.

.

.

.

.

.

.

.

. 70

Creating an EGL project

.

.

.

.

. 71

Creating an EGL Web project

.

.

.

.

. 73

Creating an EGL plug-in project

.

.

.

.

.

. 74

Renaming an EGL project

.

.

.

.

.

.

. 75

Features and facets of EGL projects

.

.

.

.

. 76

Sharing projects

.

.

.

.

.

.

.

.

.

. 79

The EGL build path

.

.

.

.

.

.

.

.

.

. 83

Source folders

. Introduction to EGL packages .

.

.

. Creating source folders

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 86

. 87

. 87

Creating an EGL package

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 89

Introduction to EGL files

.

.

.

.

. 89

Creating EGL source files

.

.

.

.

. 90

Renaming a source file

.

.

.

.

. 91

Moving a source file .

.

.

.

.

. 92

Deleting a source file .

Creating EGL build files .

Creating a deployment descriptor .

.

.

.

.

.

.

.

.

.

.

.

.

. 93

. 94

. 94

Introduction to EGL parts

. Generatable parts and non-generatable parts .

.

.

.

.

.

.

.

 

. 95

. 96

Introduction to data parts

.

.

.

.

.

.

.

.

.

.

.

. 97

Introduction to logic parts .

.

.

. 105

Introduction to build parts .

.

.

.

.

.

.

. 120

Renaming parts

.

.

.

.

.

.

.

.

.

.

. 120

Moving parts

.

.

.

.

.

.

.

.

.

.

.

. 121

. Import and use statements .

.

Properties

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 122

. 124

Working with EGL code .

.

.

.

.

.

.

127

Common programming tasks .

. Turning lines of code into comment lines .

.

.

.

.

 

.

.

. 127

. 128

. Calling C functions with the call statement

Calling Java

.

.

.

.

.

.

.

.

. 128

. 131

Calling C functions through EGL libraries .

.

. 133

Working with substrings

.

.

.

.

.

.

.

.

.

. 146

Encrypting passwords

.

.

. 146

Handling errors

.

.

.

.

.

.

.

.

.

.

. 148

Customizing runtime messages

.

.

.

.

.

. 152

The EGL editor .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 155

Content assist .

.

.

. 157

Code templates

.

.

. 158

Code snippets .

.

.

. 164

Inserting code snippets into EGL and JSP files

 

165

Using cheat sheets .

.

.

.

.

.

.

.

.

.

.

. 166

Editing DataItem parts with the source assistant

 

167

Searching for EGL files and parts

Searching for parts

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 168

. 168

Viewing lists of parts

.

.

. 169

Viewing part references .

.

.

. 171

Locating an EGL source file in the Project

 

Explorer view

.

.

.

.

.

.

.

. 172

Preferences

. Setting general preferences .

. Setting build descriptor preferences .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 172

. 173

. 174

.

.

. 175

Setting preferences for the EGL editor . Setting the fonts used in the EGL editor

. Setting preferences for folding in the EGL editor 176 Setting preferences for formatting in the EGL

. 176

.

editor .

.

.

.

.

.

.

.

.

.

.

.

.

.

. 177

Setting preferences for organizing import

 

statements in the EGL editor .

.

.

.

.

.

. 178

Setting preferences for source styles .

.

.

.

. 179

Setting generation preferences .

.

.

.

.

.

. 180

Setting preferences for EGL text .

.

.

.

.

. 180

Accessing data with EGL code .

Common data access tasks .

.

.

.

.

.

.

.

.

.

183

. 183

. Reading and writing records .

.

.

.

.

.

. 184

Writing and reading to files

.

.

.

.

.

.

. 186

Specifying database options at project creation

189

Accessing an LDAP-compliant server .

 

.

.

. 190

Working with SQL data

.

.

.

.

.

.

.

.

.

.

.

. 190

Best practices

.

.

.

.

. 191

Result-set processing

.

.

.

.

. 192

SQL records and their uses .

.

.

.

.

. 193

. Creating an SQL database connection .

Compatibility

.

.

.

.

.

.

Retrieving SQL table data

.

.

.

.

Setting preferences for SQL database

.

connections

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 196

. 197

. 200

. 205

. 208

. 211

. 219

Transfer to a non-EGL program using either transfer to program or transfer to

program using OS XCTL

.

.

.

.

.

.

Transferring between nonconversational

.

programs

.

.

.

.

.

.

.

.

.

.

.

.

 

271

Supported SQL database managers

Using an SQL database connection at run time 202 Editing or deleting an SQL database connection 205

Transfer from a non-EGL program to an EGL

Reference information for transfers .

Transferring control in the IMS/VS environment

. 272

. 272

275

Creating a data access application

Transferring between conversational programs

276

Working with SQL statements

.

Interfacing through serial files in IMS .

. 281

. 284

Setting preferences for SQL retrieve .

.

.

.

. 220

. Reference information for IMS/VS transfers .

. 286

Working with DL/I data

.

.

.

.

.

.

.

. 221

Transferring to and from IMSADF II programs .

. 293

. Example DL/I database .

.

.

.

.

.

.

.

. 223

IMSADF II conversational processing

.

. 294

DL/I examples

.

.

.

.

.

.

.

.

.

. 227

Transferring with conversational programs in

 

Working with MQ message queues .

.

.

.

.

. 235

ADF mode

.

.

.

.

.

.

.

.

. 295

. Defining resource associations for message .

Reading from and writing to message queues

Defining messages in EGL

.

.

.

.

.

.

.

queues

.

.

.

.

.

.

.

.

.

. 236

. 237

238

Transferring control in the iSeries COBOL

environment

Transferring control in the iSeries RPG

environment

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 299

. 300

Using direct MQ API calls

.

.

.

.

.

. 240

. Calling to and from Java programs

.

.

.

.

.

. 300

Using linkage options for MQ run-time library

.

.

. Creating a bidirectional runtime file .

.

selection .

. Working with iSeries objects .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. Working with bidirectional data .

. 242

. 244

. 245

. 247

EGL-generated Java program to EGL-generated

Java program .

. EGL-generated Java program to non-EGL Java .

program

. Non-EGL Java program to EGL program .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 300

. 300

. 301

. Creating a bidirectional conversion table .

.

. 249

. EGL-generated Java program to DLL

.

.

.

. 301

EGL-generated Java program to .EXE or .BAT

 

Transfer of control across programs

251

file .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 301

Reference information for special parameters on

call or transfer statement

.

.

.

.

.

.

.

.

. 252

Calling an IMS program from EGL-generated

Java code

.

.

.

.

.

.

.

.

.

 

. 301

Format of a text or print form passed on a call

252

Format of the dliLib.psbData structure .

.

.

. 253

Developing EGL programs for the

Format of a PCBRecord

. Calling programs in CICS environments

.

.

.

.

.

.

.

.

. 253

. 254

VSE environment.

.

.

.

.

.

.

.

.

.

305

Format of call statement parameters for CICS

256

259

Developing EGL programs for the IMS

 

Calls from an EGL program to an EGL program

program .

.

.

.

.

.

.

.

.

.

.

.

Transferring control in CICS environments .

program .

.

.

.

.

.

.

.

.

.

.

.

.

. 259

. 261

. 261

environment .

.

.

.

.

.

Generating for the MPP region

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

307

Calls from an EGL program to a non-EGL .

Text UI programs

.

.

. 307

. 307

Calls from a non-EGL program to an EGL .

Basic programs

Generating for the MPP IMS FastPath region

.

. 308

. 308

. 309

Transfer to program . Transfer to transaction

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 262

. 263

. 265

. 265

Generating for the IMS BMP region . Effect of build descriptor options

.

.

.

.

.

.

.

.

.

.

. 310

 

EGL support for runtime PSBs and PCBs .

.

. 310

Transfer using show .

Using asynchronous tasks .

Requirements for the PSB record part .

.

. 313

Calling programs in IMS and z/OS batch

Interacting with terminals in IMS Defining forms for IMS programs

.

.

.

.

.

.

.

.

. 315

. 317

.

environments

.

.

.

.

.

.

.

.

.

.

Calls from an EGL program to an EGL program Calls from an EGL program to a non-EGL .

. Calls from a non-EGL program to an EGL .

program .

Calling a CICS program from an EGL z/OS

.

program .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 267

268

. 268

. 268

Estimating the size of MFS blocks for a

formGroup

. Using serial and print files in IMS .

.

.

.

.

.

.

.

.

.

Using serial files as GSAM files

. Defining records to use with message queues

. Using serial files as message queues

.

.

.

.

.

.

.

. 318

. 319

. 319

. 320

321

batch program

.

.

.

.

.

.

.

.

.

. 269

Checking the results of serial file I/O statements 321

Transferring control in IMS BMP and z/OS batch

Using print files as message queues .

.

Example IMS program code

.

.

.

.

.

.

.

.

. 322

. 322

.

environments

. Transfer from an EGL program to an EGL program using transfer to program

.

.

.

.

.

.

.

.

.

.

.

. 270

. 271

. 271

Example of output to a serial file associated

with a message queue

.

.

.

.

.

.

.

.

.

.

.

.

. 322

 

Transfer from an EGL program to an EGL

Example of IMS batch processing

.

. 324

program using transfer to transaction

Mutliple users and message queues .

.

. 324

Overview of EGL Rich UI

.

.

.

.

.

.

327

Starting to work with EGL Rich UI

.

.

.

. 329

Understanding how browsers handle a Rich UI

application

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 334

Introduction to the EGL Rich UI editor

. 337

Opening the EGL Rich UI editor

. 339

Creating a Web interface in the Rich UI editor Running a Web application in the EGL Rich UI

340

editor .

. 345

. Setting preferences for Rich UI bidirectional text 349

. 347

. 344

. Setting preferences for Rich UI appearance

. Setting preferences for Rich UI

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Setting preferences for Rich UI deployment .

 

. 351

Securing a Rich UI application

.

.

.

.

.

.

. 352

Overview of Rich UI security .

.

.

.

.

.

. 352

. JSF versus Rich UI applications .

Resources to secure .

.

.

.

.

.

.

.

.

.

.

.

. 355

. 357

Using Web container-managed (JEE)

authentication

.

.

.

.

.

.

.

.

.

. 357

Using application-managed (custom)

authentication

.

.

.

.

.

.

.

.

.

. 362

Authentication summary

.

.

.

.

.

.

.

. 367

Authorization

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 368

JEE security example .

.

. 369

Sample login and error pages for JEE

form-based authentication

.

.

.

.

.

. 374

Preventing client-side security threats .

.

.

. 376

Overview of SSL

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 377

IBM Rational AppScan .

.

. 386

Building EGL JSF Web applications

389

Elements of a JSF Web application .

.

.

.

.

.

.

.

. 389

Common tasks in Web applications .

.

. 391

. Localizing text in Web applications .

Creating a Web page

.

.

.

.

.

.

.

.

.

. 392

. 426

Updating portions of a Web page with AJAX

.

. Using the i5/OS integrated Web application . Using JEE container-managed security .

Accessing the JSF component tree with the source

assistant .

.

. Running a Web page on a server .

requests

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

server .

.

.

.

.

.

. Changing the target of a JSF link .

. Changing the style of a JSF control .

.

.

. 432

. 448

. 449

. 452

. 454

. 457

. 458

. Changing the style class of a JSF control .

.

. 459

Setting event handlers for a JSF control

.

. 460

Setting the size of a JSF image

.

.

.

.

.

.

.

.

.

.

. 461

Enabling or disabling JSF controls

.

. 462

Setting JSF data table properties .

.

. 463

Adding JSF component interface support to an

EGL Web project

.

.

.

.

.

.

.

.

.

.

.

.

. 464

Setting preferences for Web projects .

.

. 465

Building EGL portlet applications.

.

.

467

Portlet overview

.

.

.

.

.

.

.

.

.

.

.

. 467

Prerequisites

.

.

.

.

.

.

.

.

.

.

.

. 468

Elements of a Portlet Application

JSF Handler part .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 468

. 468

Managing Portlet Sessions .

.

. 469

Inter-Portlet Communication .

.

.

.

.

.

.

. 470

J2EELib .

.

. Adding Support for Additional Portlet Modes

.

.

. Adding a Portlet to the Application .

. Creating a Web Page .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

 

.

.

.

.

. 471

. 471

. 472

. 473

Overview of service-oriented architecture (SOA)

.

.

475

Elements of a service-oriented application

.

. 478

Types of services .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. 481

Calling a local service

.

.

. 483

Calling a remote service

.

.

. 485

Adding service client binding information for an

 

EGL service .

.

.

.

.

.

.

.

.

.

.

.

.

. 487

Adding service client binding information from a

 

WSDL file

.

.

.

.

.

.

.

.

.

.

.

.

.

. 489

Creating a service-access variable and binding it to

a service .

.

.

.

.

.

.

.

.

.

.

.

.

. 491

. Exposing a service to other applications

.

.

.

. 493

Adding Web service deployment information to

the deployment descriptor

.

.

.

.

. 496

Creating and using a shared protocol .

Setting preferences for service generation .

.

.

.

.

. 497

. 498

Building EGL Text User Interface

applications .

.

.

.

.

.

.

.

.

.

.

.

499

. Elements of a text user interface application .

Example .

.

.

.

.

.

.

.

.

.

.

.

 

.

.

. 499

. 500

Building EGL Text User Interface applications with

the Text Form editor .

.

.

.

.

.

.

.

.

.

. 500

Creating a simple text or print form

.

.

. 502

Creating a constant field

.

.

.

.

.

.

.

.

.

.

. 502

Creating a variable field

.

.

. 503

Creating a form from a template .

.

.

.

.

. 505

. Display options for the EGL Text Form editor

Filtering the editor

.

.

.

.

.

.

.

.

 

. 509

510

Setting preferences for the Text Form editor .

. 510

Setting bidirectional text preferences for the Text

Form editor

.

.

.

.

.

.

.

.

. 511

Setting preferences for the Text Form editor

 

palette entries

.

.

.

.

.

.

.

. 512

Building EGL Console User Interface

 

applications .

.

.

.

.

.

.

.

.

.

.

.

513

Elements of a Console UI application Creating a Console User Interface

. Adding rich client widgets to a Console UI .

program

.

.

.

.

.

.

.

.

.