Progress Open Client Developers Guide
Progress Open Client Developers Guide
Open Client
Developer’s Guide
©
2002 Progress Software Corporation. All rights reserved.
Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation. This manual is also
copyrighted and all rights are reserved. This manual may not, in whole or in part, be copied, photocopied, translated, or reduced
to any electronic medium or machine-readable form without prior consent, in writing, from Progress Software Corporation.
The information in this manual is subject to change without notice, and Progress Software Corporation assumes no responsibility
for any errors that may appear in this document.
The references in this manual to specific platforms supported are subject to change.
Progress, Powered by Progress, Progress Fast Track, Progress Profiles, Partners in Progress, Partners en Progress, Progress en
Partners, Progress in Progress, P.I.P., Progress Results, ProVision, ProCare, ProtoSpeed, SmartBeans, SpeedScript, and
WebSpeed are registered trademarks of Progress Software Corporation in the U.S. and other countries. A Data Center of Your
Very Own, Allegrix, Apptivity, AppsAlive, AppServer, ASPen, ASP-in-a-Box, Empowerment Center, Fathom, Future Proof,
IntelliStream, OpenEdge, PeerDirect, POSSE, POSSENET, Progress Dynamics, Progress Software Developers Network,
SectorAlliance, SmartObjects and WebClient are trademarks or service marks of Progress Software Corporation in the U.S. and
other countries.
SonicMQ is a registered trademark of Sonic Software Corporation in the U.S. and other countries.
Vermont Views is a registered trademark of Vermont Creative Software in the U.S. and other countries.
Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Any other trademarks and/or service marks contained herein are the property of their respective owners.
Progress Software Corporation acknowledges the use of Raster Imaging Technology copyrighted by Snowbound Software 1993-
1997, the IBM XML Parser for Java Edition, and software developed by the Apache Software Foundation (http://
www.apache.org/).
© IBM Corporation 1998-1999. Allrights reserved. U.S. Government Users Restricted Rights — Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.
Progress is a registered trademark of Progress Software Corporation and is used by IBM Corporation in the mark Progress/400
under license. Progress/400 AND 400® are trademarks of IBM Corporation and are used by Progress Software Corporation
under license.
The implementation of the MD5 Message-Digest Algorithm used by Progress Software Corporation in certain of its products is
derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.
May 2002
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Organization Of This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Syntax Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Example Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Progress Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Other Useful Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
Reporting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
4GL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
DataServers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
SQL-89/Open Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
SQL-92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
WebSpeed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxii
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1
1.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
1.2 Developing and Running an Open Client Application . . . . . . . . . . . . . . . 1–3
1.3 Accessing AppServer Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–5
1.3.1 Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–5
Contents
iv
Contents
v
Contents
vi
Contents
vii
Contents
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index–1
viii
Contents
Figures
Figure 1–1: Open Client Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
Figure 3–1: Starting GUI ProxyGen On Windows . . . . . . . . . . . . . . . . . . . . . . . . . . 3–3
Figure 3–2: ProxyGen Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–4
Figure 6–1: Java Open Client Access To a Remote SmartDataObject . . . . . . . . . . 6–3
ix
Contents
Tables
Table 1–1: Types Of Proxy Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–8
Table 2–1: Open Client Package Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–3
Table 2–2: Security Supported By Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–5
Table 2–3: Root Digital Certificate Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–16
Table 3–1: Customizing GUI ProxyGen Startup Parameters . . . . . . . . . . . . . . . . . 3–27
Table 4–1: Proxy Common Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–12
Table 4–2: Passing an INPUT TEMP-TABLE Or TABLE-HANDLE Parameter . . . 4–24
Table 4–3: Passing an OUTPUT TEMP-TABLE Or TABLE-HANDLE Parameter . 4–24
Table 4–4: Passing an INPUT-OUTPUT TEMP-TABLE Or TABLE-HANDLE
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–25
Table 5–1: Progress To Java Data Type Mapping For Parameters . . . . . . . . . . . 5–3
Table 5–2: Progress/Java Data Type Map For Output Parameters . . . . . . . . . . . . 5–5
Table 5–3: Default Data-type Mapping For TEMP-TABLE Fields . . . . . . . . . . . . . 5–8
Table 5–4: Data Type Conversions For TEMP-TABLE Fields . . . . . . . . . . . . . . . 5–9
Table 5–5: Mapping Between SQL and Progress Data Types For
Standard JDBC ResultSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–12
Table 5–6: Progress-SQL ResultSet Data Type Mappings . . . . . . . . . . . . . . . . . . 5–20
Table 5–7: Comparing Some Array and Flat Model Methods . . . . . . . . . . . . . . . . 5–23
Table 5–8: General 4GL Exceptions For Java Proxies . . . . . . . . . . . . . . . . . . . . . 5–38
Table 6–1: Output Result Set Exceptions For SDOResultSet . . . . . . . . . . . . . . . . 6–36
Table 7–1: Proxy Component Names Generated By ProxyGen . . . . . . . . . . . . . . 7–2
Table 7–2: ActiveX Data Types In Progress and VB . . . . . . . . . . . . . . . . . . . . . . . 7–4
Table 7–3: Mapping Between Progress and DAO Data Types . . . . . . . . . . . . . . . 7–11
Table 7–4: Mapping Between Progress and ADO Data Types . . . . . . . . . . . . . . . 7–12
Table 7–5: ActiveX Data Types For TEMP-TABLE Output Parameters . . . . . . . . 7–18
Table 7–6: HRESULT Values For ActiveX Proxies . . . . . . . . . . . . . . . . . . . . . . . . 7–24
x
Contents
Procedures
Java AppObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–15
Java SubAppObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–18
Java ProcObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–20
Java Client Using AccountInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–24
PayeeList Class for Example 5–3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–26
AccountInfo.p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–27
Account Class (Delegating) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–28
Tax Class Constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–29
Account and Tax Class Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–30
Java Client Using an SDOAppObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–4
AccountInfo.p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–25
ActiveX Client Using AccountInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–26
xi
Contents
Examples
Example 4–1: Java Account Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–15
Example 4–2: Java Tax Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–18
Example 4–3: Java AccountInfo Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–20
Example 5–1: Output Holder Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–4
Example 5–2: Holder Class Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–6
Example 5–3: Java Client Using Proxy Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–25
Example 5–4: Java Input ResultSet Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–27
Example 5–5: AppServer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–27
Example 5–6: Delegating Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–28
Example 5–7: SubAppObject/ProcObject Constructors . . . . . . . . . . . . . . . . . . . . . . . 5–29
Example 5–8: Class Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–30
Example 7–1: ActiveX TEMP-TABLE Input Parameter Using ADO . . . . . . . . . . . . . . 7–9
Example 7–2: ActiveX TEMP-TABLE Input Parameter Using DAO . . . . . . . . . . . . . . 7–10
Example 7–3: ActiveX TEMP-TABLE Input Parameter Using IClientTempTable . . . . 7–10
Example 7–4: ActiveX TEMP-TABLE Output Parameter Using ProTempTable . . . . . 7–19
Example 7–5: AppServer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–25
Example 7–6: ActiveX Client Using AppServer Objects . . . . . . . . . . . . . . . . . . . . . . . 7–27
xii
Preface
Purpose
The Progress AppServer excels at encapsulating business functions written in the Progress 4GL
and making them available to 4GL client applications anywhere on an enterprise network. With
the Open Client Toolkit, you can now extend your departmental applications, for example,
written in Visual Basic, or your Web-enabled applications written in Java to work with the same
business functions used by your Progress enterprise applications.
Using the Open Client Toolkit, you can build or modify an existing Java application, Java
applet, or ActiveX Automation Controller to access the business functions on a Progress
AppServer. This guide describes how to use the tools provided with the Open Client Toolkit to
accomplish this task.
Audience
This guide assumes that you are experienced in programming Java applications, Java Applets,
or ActiveX Controllers for your development and deployment environment, and that you have
access to documentation on Progress Version 9, especially Building Distributed Applications
Using the Progress AppServer and its prerequisites.
Before building an application with the help of the Open Client Toolkit, you should be familiar
with the information provided by the first two chapters of Building Distributed Applications
Using the Progress AppServer.
Preface
Details the configuration requirements for developing and deploying Open Client
applications.
Explains how to use the Open Client Proxy Generator (ProxyGen) to encapsulate any 4GL
API available on an AppServer for access by an Open Client application, and how to
manage the result for the application environment.
Describes how to access remote Progress SmartDataObjects from a Java Open Client
using either a prebuilt proxy or a customized proxy that you can build with ProxyGen.
Describes the considerations you must make, and the tasks you must perform when you
develop Java applets for Open Client.
xiv
Progress Open Client Developer’s Guide
Describes the Certificate Management Tool provided by Progress, and documents how to
import, export and remove certificates to and from .jar and .zip files.
Typographical Conventions
This manual uses the following typographical conventions:
– New terms
– Code examples
– System output
• Small capitals are used for Progress key functions and generic keyboard keys.
END-ERROR, GET, GO
ALT, CTRL, SPACEBAR, TAB
xv
Preface
• When you have to press a combination of keys, they are joined by a dash. You press and
hold down the first key, then press the second key.
CTRL-X
• When you have to press and release one key, then press another key, the key names are
separated with a space.
ESCAPE H
ESCAPE CURSOR-LEFT
Syntax Notation
The syntax for each component follows a set of conventions:
• Uppercase words are keywords. Although they are always shown in uppercase, you can
use either uppercase or lowercase when using them in a procedure.
SYNTAX
• Italics identify options or arguments that you must supply. These options can be defined
as part of the syntax or in a separate syntax identified by the name in italics. In the
ACCUM function above, the aggregate and expression options are defined with the
syntax for the ACCUM function in the Progress Language Reference.
• You must end all statements (except for DO, FOR, FUNCTION, PROCEDURE, and
REPEAT) with a period. DO, FOR, FUNCTION, PROCEDURE, and REPEAT
statements can end with either a period or a colon, as in this example:
• Square brackets ([ ]) around an item indicate that the item, or a choice of one of the
enclosed items, is optional.
xvi
Progress Open Client Developer’s Guide
SYNTAX
In some instances, square brackets are not a syntax notation, but part of the language.
For example, this syntax for the INITIAL option uses brackets to bound an initial value
list for an array variable definition. In these cases, normal text brackets ( [ ] ) are used:
SYNTAX
• Braces ({ }) around an item indicate that the item, or a choice of one of the enclosed
items, is required.
In this example, you must specify the items BY and expression and can optionally specify
the item DESCENDING, in that order:
SYNTAX
{ BY expression [ DESCENDING ] }
In some cases, braces are not a syntax notation, but part of the language.
For example, a called external procedure must use braces when referencing arguments
passed by a calling procedure. In these cases, normal text braces ( { } ) are used:
SYNTAX
{ &argument-name }
In this example, EACH, FIRST, and LAST are optional, but you can only choose one:
xvii
Preface
SYNTAX
SYNTAX
• Ellipses (...) indicate that you can choose one or more of the preceding items. If a group
of items is enclosed in braces and followed by ellipses, you must choose one or more of
those items. If a group of items is enclosed in brackets and followed by ellipses, you can
optionally choose one or more of those items.
In this example, you must include two expressions, but you can optionally include more.
Note that each subsequent expression must be preceded by a comma:
SYNTAX
In this example, you must specify MESSAGE, then at least one of expression or SKIP, but
any additional number of expression or SKIP is allowed:
SYNTAX
In this example, you must specify {include-file, then optionally any number of argument
or &argument-name = "argument-value", and then terminate with }:
SYNTAX
{ include-file
[ argument | &argument-name = "argument-value" ] ... }
xviii
Progress Open Client Developer’s Guide
• In some examples, the syntax is too long to place in one horizontal row. In such cases,
optional items appear individually bracketed in multiple rows in order, left-to-right and
top-to-bottom. This order generally applies, unless otherwise specified. Required items
also appear on multiple rows in the required order, left-to-right and top-to-bottom. In cases
where grouping and order might otherwise be ambiguous, braced (required) or bracketed
(optional) groups clarify the groupings.
SYNTAX
In this example, ASSIGN requires one of two choices: either one or more of field, or one
of record. Other options available with either field or record are grouped with braces and
brackets. The open and close braces indicate the required order of options:
SYNTAX
xix
Preface
Example Procedures
This manual provides numerous example procedures that illustrate syntax and concepts.
Examples use the following conventions:
• If they are available online, the name of the procedure appears above the left corner of the
box and starts with a prefix associated with the manual that references it, as follows:
If the name does not start with a listed prefix, the procedure is not available online.
• If they are not available online, they compile as shown, but might not execute for lack of
completeness.
1 ♦ From the Control Panel or the Progress Program Group, double-click the Proenv icon.
Running Proenv sets the DLC environment variable to the directory where you installed
Progress (by default, C:\Program Files\Progress). Proenv also adds the DLC
environment variable to your PATH environment variable and adds the bin directory
(PATH=%DLC%;%DLC%\bin;%PATH%).
xx
Progress Open Client Developer’s Guide
3 ♦ Enter the following command at the proenv prompt to create the text file prodoc.txt
which contains the file listing for the prodoc.pl library:
1 ♦ From the Control Panel or the Progress Program Group, double-click the Proenv icon.
Running Proenv sets the DLC environment variable to the directory where you installed
Progress (by default, C:\Program Files\Progress). Proenv also adds the DLC
environment variable to your PATH environment variable and adds the bin directory
(PATH=%DLC%;%DLC%\bin;%PATH%).
3 ♦ Enter the following command at the proenv prompt to create the prodoc directory in your
Progress working directory (by default, C:\Progress\Wrk):
MKDIR prodoc
MKDIR prodoc\langref
5 ♦ To extract all examples in a procedure library directory, run the PROLIB utility. Note that
you must use double quotes because “Program Files” contains an embedded space:
xxi
Preface
To extract one example, run PROLIB and specify the file that you want to extract as it is stored
in the procedure library:
install-dir/dlc/bin/proenv
Running proenv sets the DLC environment variable to the directory where you installed
Progress (by default, /usr/dlc). The proenv utility also adds the bin directory under the
DLC environment variable to your PATH environment variable
(PATH=$DLC/bin:$PATH).
2 ♦ At the proenv prompt, create the prodoc directory in your Progress working directory:
mkdir prodoc
mkdir prodoc/proghand
4 ♦ To extract all examples in a procedure library directory, run the PROLIB utility:
xxii
Progress Open Client Developer’s Guide
To extract one example, run PROLIB and specify the file that you want to extract as it is
stored in the procedure library:
Progress Messages
Progress displays several types of messages to inform you of routine and unusual occurrences:
• Compile messages inform you of errors found while Progress is reading and analyzing a
procedure prior to running it (for example, if a procedure references a table name that is
not defined in the database).
• Startup messages inform you of unusual conditions detected while Progress is getting
ready to execute (for example, if you entered an invalid startup parameter).
• Continues execution, subject to the error-processing actions that you specify, or that are
assumed, as part of the procedure. This is the most common action taken following
execution messages.
• Returns to the Progress Procedure Editor so that you can correct an error in a procedure.
This is the usual action taken following compiler messages.
• Halts processing of a procedure and returns immediately to the Procedure Editor. This
does not happen often.
Progress messages end with a message number in parentheses. In this example, the message
number is 200:
xxiii
Preface
On the Windows platform, use Progress online help to get more information about Progress
messages. Many Progress tools include the following Help menu options to provide information
about messages:
• Choose Help→Messages, then enter the message number to display a description of any
Progress message. (If you encounter an error that terminates Progress, make a note of the
message number before restarting.)
On the UNIX platform, use the Progress PRO command to start a single-user mode character
Progress client session and view a brief description of a message by providing its number.
Follow these steps:
install-dir/dlc/bin/pro
3 ♦ Type the message number, and press ENTER. Details about that message number appear.
4 ♦ Press F4 to close the message, press F3 to access the Procedure Editor menu, and choose
File→Exit.
Getting Started
Progress Electronic Documentation Installation and Configuration Guide (Hard copy only)
A booklet that describes how to install the Progress EDOC viewer and collection on UNIX
and Windows.
xxiv
Progress Open Client Developer’s Guide
A manual that describes how to install and set up Progress Version 9.1 for the UNIX
operating system.
A manual that describes how to install and set up Progress Version 9.1 for all supported
Windows and Citrix MetaFrame operating systems.
A bulletin that provides a list of new and changed features by release, a list and description
of changes to documentation by release, and critical information about product changes
that might require changes to existing code and configurations.
This bulletin also provides information about where to go for detailed information about
the new and changed features and documentation.
Progress Language Tutorial for Windows and Progress Language Tutorial for Character
Platform-specific tutorials designed for new Progress users. The tutorials use a
step-by-step approach to explore the Progress application development environment using
the 4GL.
Progress Master Glossary for Windows and Progress Master Glossary for Character (EDOC
only)
Platform-specific master glossaries for the Progress documentation set. These books are
in electronic format only.
Progress Master Index and Glossary for Windows and Progress Master Index and Glossary for
Character (Hard copy only)
Platform-specific master indexes and glossaries for the Progress hard-copy documentation
set.
xxv
Preface
A reference manual that describes the Progress startup and shutdown commands that you
use at the command line, and the startup parameters that you use for Progress processes.
This guide also provides information about parameter usage and parameter files.
A booklet that explains how Progress software and media are packaged. An icon-based
map groups the documentation by functionality, providing an overall view of the
documentation set. Welcome to Progress also provides descriptions of the various services
Progress Software Corporation offers.
Development Tools
Progress ADM 2 Guide
A programmer’s guide to using the Progress AppBuilder visual layout editor. AppBuilder
is a Rapid Application Development (RAD) tool that can significantly reduce the time and
effort required to create Progress applications.
Progress Basic Database Tools (Character only; information for Windows is in online help)
A guide for the Progress Database Administration tools, such as the Data Dictionary.
Progress Basic Development Tools (Character only; information for Windows is in online help)
A guide for the Progress development toolset, including the Progress Procedure Editor and
the Application Compiler.
xxvi
Progress Open Client Developer’s Guide
A guide for the Progress Application Debugger. The Debugger helps you trace and correct
programming errors by allowing you to monitor and modify procedure execution as it
happens.
A guide that describes how to develop and integrate an online help system for a Progress
application.
A guide that describes how to use the Progress Translation Manager tool to manage the
entire process of translating the text phrases in Progress applications.
A guide that describes how to use the Progress Visual Translator tool to translate text
phrases from procedures into one or more spoken languages.
Reporting Tools
Progress Report Builder Deployment Guide (Windows only)
An administration and development guide for generating Report Builder reports using the
Progress Report Engine.
A tutorial that provides step-by-step instructions for creating eight sample Report Builder
reports.
A guide for system administrators that describes how to set up and maintain the Results
product in a graphical environment. This guide also describes how to program, customize,
and package Results with your own products. In addition, it describes how to convert
character-based Results applications to graphical Results applications.
xxvii
Preface
Progress Results User’s Guide for Windows and Progress Results User’s Guide for UNIX
Platform-specific guides for users with little or no programming experience that explain
how to query, report, and update information with Results. Each guide also helps advanced
users and application developers customize and integrate Results into their own
applications.
4GL
Building Distributed Applications Using the Progress AppServer
A guide to developing Progress applications for markets worldwide. The guide covers
both internationalization—writing an application so that it adapts readily to different
locales (languages, cultures, or regions)—and localization—adapting an application to
different locales.
A three-volume reference set that contains extensive descriptions and examples for each
statement, phrase, function, operator, widget, attribute, method, and event in the Progress
language.
A manual that describes how to use the new WebClient, AppServer Internet Adapter,
SmartObjects, and SonicMQ Adapter to create applications tailored for Internet, intranet,
and extranet environments.
xxviii
Progress Open Client Developer’s Guide
Database
Progress Database Design Guide
A guide that uses a sample database and the Progress Data Dictionary to illustrate the
fundamental principles of relational database design. Topics include relationships,
normalization, indexing, and database triggers.
This guide describes Progress database administration concepts and procedures. The
procedures allow you to create and maintain your Progress databases and manage their
performance.
DataServers
Progress DataServer Guides
These guides describe how to use the DataServers to access non-Progress databases. They
provide instructions for building the DataServer modules, a discussion of programming
considerations, and a tutorial.
The Enterprise DataServer for ODBC includes MERANT ODBC drivers for all the
supported data sources. For configuration information, see the MERANT documentation,
which is available as a PDF file in installation-path\odbc. To read this file you must
have the Adobe Acrobat Reader Version installed on your system. If you do not have the
Adobe Acrobat Reader, you can download it from the Adobe Web site at:
http://www.adobe.com/products/acrobat/readstep.html.
xxix
Preface
SQL-89/Open Access
Progress Embedded SQL-89 Guide and Reference
A user guide and reference for programmers who use interactive Progress/SQL-89. It
includes information on all supported SQL-89 statements, SQL-89 Data Manipulation
Language components, SQL-89 Data Definition Language components, and supported
Progress functions.
SQL-92
Progress Embedded SQL-92 Guide and Reference
A guide to the Java Database Connectivity (JDBC) interface and the Progress SQL-92
JDBC driver. It describes how to set up and use the driver and details the driver’s support
for the JDBC interface.
A guide to the ODBC interface and the Progress SQL-92 ODBC driver. It describes how
to set up and use the driver and details the driver’s support for the ODBC interface.
A user guide and reference for programmers who use Progress SQL-92. It includes
information on all supported SQL-92 statements, SQL-92 Data Manipulation Language
components, SQL-92 Data Definition Language components, and Progress functions. The
guide describes how to use the Progress SQL-92 Java classes and how to create and use
Java stored procedures and triggers.
xxx
Progress Open Client Developer’s Guide
Deployment
Progress Client Deployment Guide
A guide that describes the client deployment process and application administration
concepts and procedures.
A guide to using the Developer’s Toolkit. This guide describes the advantages and
disadvantages of different strategies for deploying Progress applications and explains how
you can use the Toolkit to deploy applications with your selected strategy.
A guide that explains how to use the Progress toolset to build applications that are portable
across all supported operating systems, user interfaces, and databases, following the
Progress programming model.
WebSpeed
Getting Started with WebSpeed
Provides an introduction to the WebSpeed Workshop tools for creating Web applications.
It introduces you to all the components of the WebSpeed Workshop and takes you through
the process of creating your own Intranet application.
Provides instructions for installing WebSpeed on Windows and UNIX systems. It also
discusses designing WebSpeed environments, configuring WebSpeed Brokers,
WebSpeed Agents, and the NameServer, and connecting to a variety of data sources.
Provides a complete overview of WebSpeed and the guidance necessary to develop and
deploy WebSpeed applications on the Web.
A booklet that provides a brief description of each new feature of the release. The booklet
also explains where to find more detailed information in the documentation set about each
new feature.
xxxi
Preface
A booklet that explains how WebSpeed software and media are packaged. Welcome to
WebSpeed! also provides descriptions of the various services Progress Software
Corporation offers.
Reference
Pocket Progress (Hard copy only)
A reference that lets you quickly look up information about the Progress language or
programming environment.
A reference that lets you quickly look up information about the SpeedScript language or
the WebSpeed programming environment.
xxxii
1
Overview
The Progress Open Client Toolkit exposes Progress AppServer functionality to Open Clients
(non-Progress clients). The Open Client Toolkit allows you to generate proxy objects, tailored
for your particular type of Open Client, that encapsulate the remote 4GL procedures and
functions supported on an AppServer. Your Open Client application can then access these
AppServer procedures and functions through methods of the generated proxy objects.
The Open Client supports both intranet and Internet access to the AppServer. When you use the
Internet, you can use HTTP/S to communicate through firewalls and optionally send secure
encrypted data transmissions.
This chapter describes the general Open Client architecture and how ProxyGen encapsulates
AppServer procedures map to proxy objects for access by Open Clients and has the following
sections:
• Architecture
The other chapters provide information about how to develop and deploy Open Client
applications to access generated proxy objects.
Progress Open Client Developer’s Guide
1.1 Architecture
The Open Client architecture allows Open Clients to access Progress AppServer functionality
that is organized into separate 4GL source files (usually procedure.p files, .w files or both).
There are several components involved in exposing AppServer functionality for Open Clients.
Figure 1–1 shows the basic components of an Open Client application and provides a high level
illustration of the different communication paths an Open Client can use to access an AppServer
on a company intranet or over the Internet.
Client Client
Data Data
Intranet Internet
Open Client Open Client
Name Internet
Server
AppServer
Web
Server
with AIA
Progress
Database
and Servers
1–2
Overview
The client programmer writes the client application in Java, Visual Basic, or a compatible
language. This application executes remote procedures and functions in an AppServer session
through methods on a proxy object that you generate using the Open Client Proxy Generator
(ProxyGen). ProxyGen is an Open Client tool that generates proxies for Java and ActiveX Open
Client applications. The proxy objects are implemented in Java and use the Open Client
Runtime to access the AppServer. For more information about using ProxyGen to generate
proxies, see “Preparing To Generate Proxies” in Chapter 2, “Configuration and Deployment.”
A key feature of the Open Client is full support for relational data exchange. This allows 4GL
TEMP-TABLE parameters to be passed between the AppServer and the client, and exposed in
the client as result set objects. In this way, Open Client applications can access any Progress
database or DataServer that is connected and exposed by the AppServer application.
The types of supported Open Clients include Java applications, Java applets, and ActiveX
Automation Controllers. For Java, ProxyGen generates proxy objects as Java classes. For
ActiveX, ProxyGen generates proxy objects as Automation objects. Proxies packaged as
Automation objects are accessible from any ActiveX Automation Controller. However, this
manual presents all ActiveX examples using Visual Basic source code.
If you want to run your Open Client application across the Internet using HTTPS (SSL), you
must include digital certificates with your application. The Open Client Toolkit includes the
Certificate Management Tool (procertm utility) that provides a way to import, export and
remove certificates to and from .jar and .zip files. For more information, see Appendix B,
“Certificate Management Utility.”
• Run the Proxy Generator (ProxyGen) — A Progress development tool that allows a
4GL developer to identify AppServer functionality and expose that functionality as proxy
objects to Open Clients.
• Select an Open Client Runtime package — A software package that allows your Open
Client application to connect to an AppServer and interact with the proxy objects
generated by ProxyGen.
1–3
Progress Open Client Developer’s Guide
The process for developing and running an Open Client application involves several tools and
procedures that are summarized in the following steps:
1 ♦ Ensure that your development environment meets the requirements for developing Open
Client applications. See Chapter 2, “Configuration and Deployment.”
2 ♦ Use ProxyGen to generate Java or ActiveX proxy objects for your AppServer 4GL
application. See Chapter 3, “Generating and Managing Proxies”.
NOTE: You can skip this step if you want to access only remote Progress
SmartDataObjects from a Java application. For more information, see Chapter 6,
“Using SmartDataObjects From Java Clients.”
3 ♦ Write a Java application, Java applet, or ActiveX Controller that uses the proxy objects
generated in Step 2 or the predefined SmartDataObject proxy objects. For more
information, see Chapter 4, “Programming Concepts,” Chapter 5, “Programming Java
Clients,” and Chapter 7, “Programming ActiveX Controller Clients.”
If you want to access remote Progress SmartDataObjects, also see Chapter 6, “Using
SmartDataObjects From Java Clients,” and Appendix A, “Accessing a SmartDataObject
API Directly.”
4 ♦ Manage Digital Certificates if your Open Client uses HTTPS (SSL) to communicate with
the AppServer. For more information, see the “Managing Digital Certificates” sections in
Chapter 2, “Configuration and Deployment.”
5 ♦ Deploy the proxy, Open Client application, your optional digital certificates, and
supporting software to your client machine (see Chapter 2, “Configuration and
Deployment.”).
6 ♦ Start any DataServers or Database servers that are accessed by the AppServer. See the
Progress DataServer Guides and the Progress Database Administration Guide and
Reference.
7 ♦ Start the AppServer (see Building Distributed Applications Using the Progress
AppServer).
8 ♦ Start the Java Servlet Engine (JSE) to run the AppServer Internet Adapter (AIA) if you are
using HTTP/S.
1–4
Overview
• Run ProxyGen on a machine that has access to a network file system where the r-code
resides.
• Copy the r-code files (maintaining the directory structure underneath the AppServer
PROPATH) to the machine where you run ProxyGen.
All of these proxy objects organize 4GL procedures on the AppServer, but in different ways.
The following sections describe the different ways of organizing proxy objects and contains
information about:
• 4GL Procedures
• ProcObjects
• Object Relationships
1–5
Progress Open Client Developer’s Guide
4GL Procedures
Before describing the three types of proxy objects, it helps to understand a few basic concepts
that govern the operation of 4GL procedures. First, any single file that is executable by Progress
is an external procedure. An external procedure can contain one or more internal procedures or
user-defined functions that execute within and share the context of the external procedure. You
can execute an external procedure in two basic ways:
• As a non-persistent procedure
• As a persistent procedure
When you execute a non-persistent procedure, the procedure executes and returns to the caller,
removing all trace of its context from memory after it returns. Any internal procedures and
functions that it defines can only be executed by the procedure itself. As a result, a
non-persistent procedure executes and returns as a unit without exposing any of its context to
the caller.
However, when you execute a persistent procedure, the procedure leaves its context active after
it completes execution. Internal procedures and functions then remain available for future
execution. Thus, a persistent procedure essentially instantiates a procedure object that exposes
its context to the caller through the internal procedures and functions that it defines. For more
information on 4GL procedures, see the Progress Programming Handbook.
The Progress AppBuilder, which is part of the Progress Application Development Environment
(ADE), also allows you to build preprogrammed persistent procedures that adhere to the
Progress Application Development Model (ADM). The Progress ADM allows you to build
persistent procedures as reusable application building blocks known as SmartObjects. The Open
Client Toolkit allows you to access a type of SmartObject known as a SmartDataObject, which
dynamically accesses and updates data. As a result, you can run a SmartDataObject on the
Progress AppServer like any persistent procedure, and, using the Open Client Runtime, access
the SmartDataObject from a Java or ActiveX application, or Java applet. In Java you can also
access the SmartDataObject as an extended Java Database Connectivity (JDBC) 2 ResultSet.
For more information, see Chapter 6, “Using SmartDataObjects From Java Clients.” For more
information on SmartDataObjects, see the Progress AppBuilder Developer’s Guide.
1–6
Overview
ProcObjects
A ProcObject encapsulates the functionality of a single persistent procedure on the AppServer.
It exposes non-PRIVATE internal procedures and functions as methods to the Open Client. A
ProcObject always uses its associated AppObject’s connection to remotely execute the
persistent procedure.
Object Relationships
In an Open Client application, you create the AppObject first in order to access AppServer
functionality. You can then create a SubAppObject through its associated AppObject, and you
can create a ProcObject through its associated AppObject or SubAppObject. You use a special
method, a Class Factory method, to create a SubAppObject or ProcObject. Thus, the total
package comprised of one AppObject and all SubAppObjects and ProcObjects that share the
same AppServer connection is a single proxy.
Although there is a creation hierarchy among the different types of proxy objects, there is no
functional hierarchy among them. All objects share the AppServer connection with equal status.
The objects can be released (have their context removed from client memory) in any order with
no effect on the objects that remain in use. The connection to the AppServer remains intact until
the last object that uses it is released.
1–7
Progress Open Client Developer’s Guide
In summary, each type of proxy object encapsulates and accesses AppServer functionality as
shown in Table 1–1.
Once you define an AppObject, its methods and any related SubAppObjects and ProcObjects,
ProxyGen can generate the proxy that exposes these objects to Open Clients.
The client code accesses the proxy in the client’s native environment. As a result, a Java client
sees the proxy (and the AppServer functionality) as a Java class definition, while a Visual Basic
client sees the proxy as an ActiveX Automation object. To use proxy objects, you must deploy
the generated proxy along with the Open Client Runtime to all client application development
and deployment systems. For more information about development and deployment, see
Chapter 2, “Configuration and Deployment.”
1–8
Overview
The Open Client Toolkit installation includes an SDOAppObject. This is a prebuilt proxy that
allows you to access any remote Progress SmartDataObject from a Java application without
needing to run ProxyGen. Therefore, an SDOAppObject is essentially an AppObject that
provides the built-in interface to a remote SmartDataObject, but not to any other remote 4GL
procedure.
If you want to access other remote 4GL procedures in addition to SmartDataObjects, you can
include the additional 4GL procedures you want to access when you build the AppObject or
SubAppObject using ProxyGen. You can then use the same built-in interfaces to
SmartDataObjects provided for SDOAppObject proxies to access SmartDataObjects using the
AppObject or SubAppObject that you have built.
1–9
Progress Open Client Developer’s Guide
1–10
2
Configuration and Deployment
Each step in the development and deployment of an Open Client application has a separate set
of configuration requirements. You must fulfill each of these requirements before beginning the
specified task.
This chapter describes the configuration requirements for performing the following Open Client
development and deployment tasks:
• Basic Open Client Runtime Packages — Supports the AppServer and AppServerDC
URL connection protocol on an intranet.
• HTTP Open Client Runtime Packages — Supports the AppServer, AppServerDC, and
HTTP URL connection protocols. These packages support user-implemented
authentication to a Web server and Proxy servers.
While these packages support many SSL enabled Web servers, they do not support all of
them. The SSL configuration for the individual Web server and the Digital Certificate used
to authenticate the Web server identity determines whether you can use these packages.
2–2
Configuration and Deployment
NOTE: If you use the HTTP, HTTPS Lite, or HTTPS Standard Packages, you must have
a Web server hosting an AppServer Internet Adapter (AIA) Java servlet to
support the HTTP/S protocol. In addition, for every Web server that hosts an AIA
servlet and that supports the HTTPS protocol, the client machine must have the
Root Digital Certificate of the Certificate Authority who issued the digital
certificate for the Web server.
As you develop your HTTP/S applications, you should consider that the application deployer
might require certain data encryption and digital signature algorithms when they configure their
Web server’s SSL support. These requirements might exceed the capabilities of the HTTPS Lite
package you select. Deployers might also require the use of SSL version 2 or TLS protocols
instead of the standard SSL version 3. If any of these requirements exists, you must use the
HTTPS Standard packages. For Java applets, Progress software recommends using the HTTP
Lite package because of its download size.
For more information about selecting a package, see Table 2–1. For more information about the
security supported, see Table 2–2.
The following table lists the types of supported applications, the supported protocols, and the
Open Client Runtime packages you would use depending on the run-time configuration of your
application and the protocols you want to support.
2–3
Progress Open Client Developer’s Guide
All packages support the AppServer protocol and the HTTPS packages support HTTP
For example, based on the options described in Table 2–1, if you have:
• An Intranet UNIX Java application that only requires AppServer support, you would use
o4glrt.zip.
• An ActiveX application that requires HTTP and full HTTPS support, you would use
o4glrths.zip.
• An Internet Explorer Java Applet that requires HTTP and limited HTTPS support, you
would use o4glrthsl.cab.
• A Java application that uses only AppServer, AppServerDC, or HTTP, you would use
o4glrth.zip.
Table 2–2 lists the security supported by each Open Client Runtime package.
2–4
Configuration and Deployment
For This
The Following Security is Supported...
Package...
2–5
Progress Open Client Developer’s Guide
• Preparing To Generate Proxies For a Java Client On UNIX Using Batch ProxyGen
1 ♦ Install one of these Progress products on a Windows system where you plan to run GUI
ProxyGen:
• ProVision Plus
With these products, Progress installs the JavaSoft Java Development Kit (JDK), which
ProxyGen uses by default to compile a Java proxy.
2 ♦ If you want to use an alternate Java compiler to compile your Java proxies, you must install
the appropriate JDK.
NOTE: If you install an alternate JDK for ProxyGen to compile Java proxies, you must
specify your compiler location and CLASSPATH to ProxyGen. For more
information, see Chapter 3, “Generating and Managing Proxies.”
2–6
Configuration and Deployment
NOTE: If you have already installed a Progress product that requires the platform JDK,
you do not need to perform this step.
2 ♦ Specify the compiler location and CLASSPATH using the GUI ProxyGen. For more
information see Chapter 3, “Generating and Managing Proxies.”
3 ♦ If any of the following files are not on your system from another Progress installation,
copy them from a Windows system where the Open Client Toolkit is installed to any
directory that preserves the directory structure under Progress-Install-Directory.
Text files:
b) Progress-Install-Directory\properties\international.properties.
Binary files:
• Progress-Install-Directory\java\progress.jar
• Progress-Install-Directory\java\proxygen.zip
b) JVM — Set JVM to the full pathname of the platform JVM. For example,
/jdk/bin/java.
c) PATH — If you do not specify a path to the Java compiler in your proxy ProxyGen
project file, you must add the compiler directory to PATH.
d) JDKCP — Only use for Version 1.1.x of Java. Set JDKCP to the full pathname
containing classes.zip or the equivalent. For example,
/jdk1.1.8/lib/classes.zip.
2–7
Progress Open Client Developer’s Guide
6 ♦ Make sure that the Progress r-code for the proxy is accessible to your system.
7 ♦ Make sure that both the Propath syntax and the r-code paths relative to the Propath setting
(defined in the project file) are valid on this system.
NOTE: In the Propath on UNIX, Windows drive letters are ignored and back slashes (\)
are automatically changed to forward slashes (/). You can also use dot (.) as a
Propath component on UNIX.
1 ♦ Install one of the following Progress products on a Windows system where you plan to run
GUI ProxyGen:
• ProVision Plus
2 ♦ Download the Microsoft Java SDK Version 3.2 (or later) and the Java Virtual Machine
(which might not be included in the SDK). Follow the instructions on the Microsoft Web
site to complete the download and any subsequent installations.
4 ♦ Ensure that ProxyGen can access and execute the MIDL compiler, which it needs to create
a Type Library. For instructions on completing this step, see the “Setting Up the MIDL
Compiler” section and the “Setting Up the Environment To Run the MIDL Compiler”
section.
2–8
Configuration and Deployment
a) By default, ProxyGen uses the files provided by Visual J++ 1.1. An additional switch
is required when you run ProxyGen to use MIDL from Visual C++. For more
information, see the “Setting Up the Environment To Run the MIDL Compiler”
section.
b) The Progress Installation CD contains a copy of Visual J++ Version 1.1 Trial
Edition, which you can install directly. For more information, move on to Step 3.
c) Later versions of Visual J++ (for example, Version 6) do not contain the MIDL
compiler and therefore are not sufficient for this requirement.
d) If you choose to purchase Visual C++, both the Standard Edition and the Professional
Edition contain the necessary files.
3 ♦ If you choose to use Visual J++ 1.1 Trial Edition, follow these steps to install it from the
Progress Installation CD:
a) Copy the self-extracting executable file VJTrial.exe from the Progress Installation
CD onto the machine (this file is at the root level on the CD).
b) Execute VJTrial.exe.
NOTE: You can determine the Progress working directory by viewing the startup options
in the proxygen.prm file located in the directory where you installed Progress.
You can view the proxygen.prm file with a text editor.
2–9
Progress Open Client Developer’s Guide
a) Microsoft-Visual-J++-Install-Directory\DevStudio\Vj\bin
b) Microsoft-Visual-J++-Install-Directory\DevStudio\SharedIDE\bin
CAUTION: The PATH settings in Step 2 must be on the PATH after the Microsoft Java SDK
bin directory.
For Visual C++, you must perform the following additional steps:
1 ♦ Add the following startup option to the proxygen.prm file located in the directory where
you installed Progress:
/d:ProxyGen.UseMidlFromC++=yes
VC++-Install-Dir\DevStudio\Vc\bin
or
VC++-Install-Dir\DevStudio\SharedIDE\bin
2–10
Configuration and Deployment
b) The common directory shared by the IDE for Visual C++ and other products — This
is the directory containing the *.dll files associated with midl.exe.
or
3 ♦ For Windows 98 only, the INCLUDE environment variable must contain the Visual C++
include directory.
For example, for Visual C++ 5.0, you would include the following:
• VC-Install-Dir\DevStudio\Vc\include
For example, for Visual C++ 6.0, you would include the following:
For more information on using ProxyGen to generate these files, see Chapter 3, “Generating and
Managing Proxies.”
1 ♦ To build the client application on machine other than the proxy machine, you must:
a) Copy the proxy .class files to a directory that mirrors the package hierarchy
specified in ProxyGen during the generation of the proxy. The package name implies
a directory structure that you must maintain when you copy the proxy.
2–11
Progress Open Client Developer’s Guide
b) Copy the proxy .java files to any directory on the system, typically together with the
corresponding .class files.
NOTE: ProxyGen provides the proxy .java files for documentation purposes only. Do
not attempt to modify and rebuild your proxy from these files.
c) Copy the Open Client Runtime package to any directory on the system. For more
information, see the “Selecting an Open Client Runtime Package” section.
2 ♦ Update the CLASSPATH setting for the client application’s development environment to
include the:
a) Directory containing the proxy (.class files) that you copied in Step 1. This is the
directory above the package hierarchy.
3 ♦ Write, compile, and execute the client application. For more information, see Chapter 4,
“Programming Concepts,” and Chapter 5, “Programming Java Clients.”
NOTE: If you installed either the Progress Open Client Toolkit or the Progress ProVision
Plus products on a Windows system, this also installs the JavaSoft JDK. However, it
does not set up the system for general use of the JDK. If you want to use the JDK for
your client application development, see the JavaSoft documentation.
1 ♦ To build the client application on machine other than the proxy machine, you must:
b) Copy the Open Client Runtime package to any directory on the system. For more
information, see the “Selecting an Open Client Runtime Package” section.
2–12
Configuration and Deployment
d) If you do not have Version 5.00.3182 or later of the Microsoft JVM on your machine,
run msjavx86.exe to install the Microsoft JVM and related Java classes. You can
find msjavx86.exe on the Progress installation CD or you can obtain it from the
Microsoft Web site.
2 ♦ Update the CLASSPATH environment variable to include the Open Client Runtime
package you copied in Step 1.
3 ♦ Register the proxy by running Microsoft’s RegSvr32.exe on the proxy .dll file.
4 ♦ Register the ActiveX Open Client support library by running Microsoft’s RegSvr32.exe
on the o4glActiveX.dll file (located in Progress-Install-Directory\bin or in the
directory where you copied this file in part c of Step 1).
5 ♦ Write, compile, and execute the client application (Automation Controller). For more
information, see Chapter 4, “Programming Concepts,” and Chapter 7, “Programming
ActiveX Controller Clients.”
1 ♦ Copy the required files for the client application and proxy to the deployment system:
b) Copy the proxy .class files to a directory that mirrors the package hierarchy
specified in ProxyGen during the generation of the proxy. The package name implies
a directory structure that you must maintain when you copy the proxy. You can also
put the class files into a .zip or .jar file, as with any other Java classes.
2–13
Progress Open Client Developer’s Guide
c) Install a Java Virtual Machine (JVM). Many platforms already come with a JVM.
For more information on the available Java run-time environment (JRE) for your
platform, see the sections on Java requirements in the in the Progress Installation
and Configuration Guide Version 9 for Windows or the Progress Installation and
Configuration Guide Version 9 for UNIX.
d) Copy the Open Client Runtime package to any directory on your system. For more
information, see the “Selecting an Open Client Runtime Package” section.
2 ♦ If you are using HTTPS, copy your digital certificates to the location required by the Open
Client application. For more information, see the “Managing Digital Certificates” section.
3 ♦ Update the CLASSPATH setting for the Java environment that will run the client
application and proxy to include the:
b) Directory containing the proxy (.class files) or the .zip or .jar file. Remember
that for class files, this is the directory above the package hierarchy.
NOTE: The mechanism to update the CLASSPATH setting depends on the Java
environment that you are using. For instructions on updating the CLASSPATH,
see the documentation for your Java environment.
1 ♦ Copy the required files for the client application and proxy to the deployment system:
c) Copy the Open Client Runtime package to any directory on the system. For more
information, see the “Selecting an Open Client Runtime Package” section.
2–14
Configuration and Deployment
2 ♦ If you are using digital certificates, copy your digital certificates to the location required
by the Open Client application. For more information, see the “Managing Digital
Certificates” section.
3 ♦ Update the CLASSPATH environment variable to include the Open Client Runtime
package you copied in Step 1.
4 ♦ If you do not have Version 5.00.3182 or later of the Microsoft JVM on your machine, run
msjavx86.exe to install the Microsoft JVM and related Java classes. You can find
msjavx86.exe on the Progress installation CD or you can obtain it from the Microsoft
Web site.
5 ♦ Register the proxy by running Microsoft’s RegSvr32.exe on the proxy .dll file.
6 ♦ Register the ActiveX Open Client support library by running Microsoft’s RegSvr32.exe
on the o4glActiveX.dll file.
2–15
Progress Open Client Developer’s Guide
Certificates to their users and then dynamically configuring the Open Client application or
applet to use them.
NOTE: If the Web server is configured to use a Digital Certificate issued by a private
Certificate Authority (CA), it would never be included in the set distributed by
Progress.
The compressed file names of the Root Digital Certificates do not indicate which certificates are
included. However, Progress provides a certificate management utility (procertm.exe) that
you can use for viewing and managing the files. For more information about the certificate
management utility, see Appendix B, “Certificate Management Utility.”
The following table lists the Open Client application type, run-time environments, and Root
Digital Certificate packages that Progress distributes.
In all cases, the Root Digital Certificates that Progress distributes are in binary (DER) format.
All of the certificate files use compressed file names and have.cer file extensions. The
exception is for the Netscape Internet Browser where the Root Digital Certificates are in files
with a .txt file extension.
2–16
3
Generating and Managing Proxies
This chapter provides a general guide to each step required to define and generate proxies for
your Java or ActiveX Open Client application. This chapter also describes how to use the Open
Client Proxy Generator (ProxyGen) tool. For more information on the options available in
ProxyGen, see the ProxyGen online help. If you only need to access Progress SmartDataObjects
on the AppServer (and no other 4GL procedures) from a Java application, you do not need to
use ProxyGen. Instead, use the prebuilt SDOAppObject proxy to access the SmartDataObjects.
For more information, see Chapter 6, “Using SmartDataObjects From Java Clients.”
The sections in this chapter describe:
For information about writing Java and ActiveX applications using Open Client proxies, see
Chapter 4, “Programming Concepts,” Chapter 5, “Programming Java Clients,” and Chapter 7,
“Programming ActiveX Controller Clients.” For information about writing Java applets, see
Chapter 4, “Programming Concepts,” Chapter 5, “Programming Java Clients,” and Chapter 8,
“Special Considerations For Java Applets.”
Progress Open Client Developer’s Guide
You can only use Batch ProxyGen to complete the fourth task, validating and generating the
proxy.
NOTE: While this chapter provides basic guidance on how to use the ProxyGen tool, see the
online help for complete information on each ProxyGen window. Also, for
information on additional options for starting ProxyGen, see the “Using GUI and
Batch ProxyGen Execution Options” section.
3–2
Generating and Managing Proxies
Open
this icon
3–3
Progress Open Client Developer’s Guide
3–4
Generating and Managing Proxies
3–5
Progress Open Client Developer’s Guide
This validates the proxy defined in project-filename.pxg and generates the proxy. For more
information on Batch ProxyGen execution options, see the “Using GUI and Batch ProxyGen
Execution Options” section.
• It works only for projects that define Java proxies and that do not also define ActiveX
proxies. You can only generate ActiveX proxies on Windows platforms.
• It ignores all drive letter references in project files generated by ProxyGen on Windows
platforms. As a result, all absolute pathnames in the project descend from root (/).
• It automatically changes back slashes (\) to forward slashes (/). You can also use dot (.) as
a Propath component.
1 ♦ Define an AppObject for the proxy, and optionally one or more SubAppObjects.
The following sections provide an overview of these steps. For specific information on
ProxyGen options for defining and generating proxies, see the ProxyGen online help.
3–6
Generating and Managing Proxies
3–7
Progress Open Client Developer’s Guide
• The PROPATH (Propath Components list box), set to the locations of AppServer
procedures for this proxy object. (See the “Specifying 4GL Procedures and User-defined
Functions” section.)
• If generating an ActiveX proxy, the name of the Automation object (COM Object field,
used for example in Visual Basic’s Project References dialog box)
• Whether to allow access to the 4GL unknown value (?) in parameters and return values
(Allow Unknown field). The check box here applies to the entire proxy object. Other
dialog boxes can be used to allow access to the 4GL unknown value for individual
procedures and parameters.
NOTE: If you are using the proxy to access a remote Progress SmartDataObject, you
must allow 4GL unknown values for the entire proxy object. Check this box and
make sure that the boxes in all ProcObject and method definitions remain
checked.
You must also specify any AppServer procedure files you want to include, and whether they are
non-persistent or persistent procedures (ProcObjects), using the Procedure menu on the menu
bar. These procedures are listed on the Procedures tab folder. For more information on
specifying the PROPATH setting and AppServer procedure files, see the “Specifying 4GL
Procedures and User-defined Functions” section.
1 ♦ Set the Propath Components list box to allow ProxyGen to locate the available r-code files.
2 ♦ Add the r-code files for this object from the set of files made available under the directories
specified as Propath Components. Add each procedure according to whether it is executed
non-persistently or persistently.
3–8
Generating and Managing Proxies
3 ♦ Optionally, customize each procedure entry to configure the corresponding method (if
non-persistent) or ProcObject (if persistent).
4 ♦ Optionally, for ProcObjects only, customize the method definitions for all specified
internal procedures and user-defined functions.
3–9
Progress Open Client Developer’s Guide
• For persistent execution — Choose Procedure→ Add→ Persistent from the menu bar.
These choices display either the Add Procedures dialog box or the Add Persistent Procedures
dialog box for your current proxy object. The user interface is almost identical for the two dialog
boxes. Both dialog boxes allow you to:
• Select r-code files under a pathname selected from your Propath Components setting
(Propath Selection list box).
• Specify whether to use the relative pathname of selected procedures as part of the
corresponding method name in the proxy (Use Path in Method Name check box).
• Request that any directories that you select be searched recursively (Perform Recursive
Add check box).
• Add the selected files to the Procedures tab folder for the current AppObject or
SubAppObject definition (Add button). The procedures that you add depend on what files
and directories you have selected in the Folders tree and Folder Contents list.
The difference between the two dialog boxes is in the execution type of the procedure file that
is added. A method is generated in the proxy for each non-persistent procedure. A ProcObject
class factory method is generated for each persistent procedure. (For information on proxy
methods, see Chapter 1, “Overview,” and Chapter 4, “Programming Concepts.”)
After selecting and adding the respective procedure files, any non-persistent procedures appear
in the Procedures list and any persistent procedures appear in the Persistent Procedures list of
the Procedures tab folder on the main window.
To delete procedures from either list in the Procedures tab folder:
2 ♦ Press the Delete key or choose Procedure→ Delete from the menu bar.
3–10
Generating and Managing Proxies
2 ♦ Choose the associated arrow button or Procedure→ Change Type from the menu bar to
move the selected procedures to the opposite list.
2 ♦ Double-click the selection or choose Procedure→ Customize from the menu bar.
This displays the corresponding Customize Procedure or Customize Persistent Procedure dialog
box for your proxy object. Both dialog boxes provide:
• A Procedure tab folder to modify the name and description of the associated method or
ProcObject
• A check box (Use AppObject Unknown Setting) that specifies whether to use the
AppObject or SubAppObject setting to allow the 4GL unknown value (?) in parameters
and return values
The Customize Persistent Procedure dialog box also has an Internal Procs tab folder to
customize methods (internal procedures and user-defined functions) of the specified
ProcObject.
In the Procedure tab folder, you can:
• Enter descriptive information for the method or ProcObject (Description edit box).
3–11
Progress Open Client Developer’s Guide
• For ActiveX proxies, specify a label to identify the method or ProcObject in the Type
Library.
In the Parameters tab folder, you can set check boxes to indicate whether one or more method
or ProcObject parameters allow the 4GL unknown value (?). If you check the Use AppObject
Unknown Setting box, these parameter check boxes are disabled.
In the Internal Procs tab folder for ProcObjects (Customize Persistent Procedure dialog box):
• You can set check boxes to indicate whether one or more internal procedures or
user-defined functions are included as methods of the ProcObject.
• You can also customize the method definition for a selected internal procedure or
user-defined function included in the ProcObject (Customize button).
The Customize Internal Procedure/UDF dialog box appears. This dialog box provides:
• A Procedure tab folder to modify the name and description of the method associated with
the selected internal procedure or user-defined function.
• A check box (Use AppObject Unknown Setting) that specifies whether to use the
AppObject or SubAppObject setting to allow the 4GL unknown value (?) in method
parameters and return values
• For user-defined functions, a check box (Allow Unknown Return) that specifies whether
to allow the 4GL unknown value (?) in function return values.
3–12
Generating and Managing Proxies
• For ActiveX proxies, specify a label to identify the method in the Type Library.
In the Parameters tab folder, you can set check boxes to indicate whether one or more method
parameters allow the 4GL unknown value (?). If you check the Use AppObject Unknown
Setting box, these parameter check boxes are disabled.
1. The AppServer developer can define internal procedures and user-defined functions as
PRIVATE in the 4GL. ProxyGen does not display private procedures and user-defined
functions for use in a ProcObject definition.
2. You can further select what public internal procedures and user-defined functions you
want ProxyGen to include in a ProcObject.
3. The AppServer developer can use the business logic on the AppServer to further restrict
what procedures can be run remotely by using the Progress EXPORT statement. This
statement restricts access at run time without any affect on the generated proxy.
For information on how the second level of remote procedure access control works in
ProxyGen, see the “Specifying 4GL Procedures and User-defined Functions” section. For
information on how AppServer applications can use the EXPORT statement to control remote
procedure access at run time, see Building Distributed Applications Using the Progress
AppServer.
3–13
Progress Open Client Developer’s Guide
3–14
Generating and Managing Proxies
1. Default — Default settings for all proxies that you define. Choose Options→ Preferences
from the menu bar, and select the Default tab folder in the displayed Preferences dialog
box. ProxyGen initializes these settings from and saves them to the
Progress-Install-Directory\properties\ProxyGen.preferences file.
2. AppObject — Specific settings for the AppObject you are defining. ProxyGen provides
two ways to access this information:
a) Choose Options→ Preferences from the menu bar, and select the AppObject tab
folder in the displayed Preferences dialog box.
b) Choose File→ Generate from the menu bar or choose the Generate button from the
toolbar. This displays the Generate dialog box for the current AppObject before you
generate the proxy.
ProxyGen initializes these settings for a new AppObject from the ProxyGen.preferences
file. Thereafter (for an existing AppObject), ProxyGen initializes these settings from and
saves them to the project file for the proxy.
For Java proxies, you can choose from the following compilers:
• Default javac
• Default jvc
• Custom
3–15
Progress Open Client Developer’s Guide
For ActiveX proxies, you can choose from the following compilers:
• Default (jvc)
• Custom (jvc)
CAUTION: The Classpath initially displayed in this field is the one required for proxy
generation. You should never change this portion of the Classpath. You
should only add values to the end of this Classpath.
– For Microsoft Java SDK, progress.jar, messages.jar, and prowin.jar are part
of the Classpath.
– Sun-Compatible JDK, progress.jar is part of the Classpath.
• Compiler options — All options and values accepted by the complier other than the
Classpath.
3–16
Generating and Managing Proxies
SYNTAX
project-file
The project (.pxg) file for the proxy whose Propath settings you want to change.
propath-file
A text file containing a pair of strings for each Propath component you want to change,
using the following syntax, where OldPropathDirectory is the current Propath
component string and NewPropathDirectory is the replacement component string:
3–17
Progress Open Client Developer’s Guide
SYNTAX
{ OldPropathDirectory newline
NewPropathDirectory newline }
{ OldPropathDirectory newline
NewPropathDirectory newline }
...
Propath.txt
/appsv1/SimpleQueries
/appsv2/SimpleQueries
/appsv1/ComplexQueries
/appsv2/ComplexQueries
3–18
Generating and Managing Proxies
You must specify the name for each AppObject and SubAppObject class. Unless you
override it, each ProcObject class name is the r-code filename of the mapped persistent
procedure, matching the case and spelling without the extension. ProxyGen also performs
any automatic name conversions.
For Java proxies, these object names are used as the actual Java class names.
For ActiveX proxies, these object names are preceded by a prefix that you see in the VB
Object Browser for each class as follows:
The method name is the procedure filename without the extension. Method names are case
sensitive. ProxyGen also performs automatic name conversions. See the “Automatic
Name Conversions” section.
The method name match the corresponding 4GL names found in the procedure file.
Method names are case sensitive. ProxyGen also performs any automatic name
conversions.
3–19
Progress Open Client Developer’s Guide
– Java — createAO_SubAppObject
– ActiveX — CreateAO_SubAppObject
– Java — createPO_ProcObject
– ActiveX — CreatePO_ProcObject
NOTE: On Windows platforms, the case of the r-code filename is affected by the name
entered during 4GL compilation. For example if you execute the following
COMPILE statement in the Progress Procedure Editor:
The generated r-code filename is aBCdEf.r, even though Abcdef.p might be the
actual procedure filename. Thus, the generated method name is aBCdEf or
CreatePO_aBCdEf for a persistent procedure.
• Pound (#)
• Ampersand (&)
• Percent (%)
• Dash ()
• Dot (.)
3–20
Generating and Managing Proxies
NOTE: Once you edit a method name, ProxyGen no longer does this automatic conversion.
If your edit includes a restricted character, ProxyGen displays an error and you must
edit the name again.
• Proxy Validation
The proxy definition is reconciled against the actual r-code on the system because the
r-code can change independently of the saved proxy definition. This process throws away
obsolete information and picks up new information while preserving customizations that
are still valid with regard to these changes. This process generates an activity log (.log)
file that records any significant validation events. This file is created in the proxy directory
specified in the generation preferences.
3–21
Progress Open Client Developer’s Guide
• Proxy Generation
Once the proxy definition is validated and updated as appropriate, the proxy can be
generated. A separate proxy is created for Java and ActiveX clients. The proxy for the Java
client produces a set of .java and .class files. The proxy for the ActiveX client produces
a .dll that defines the specified Automation objects, including the Type Library
information for the proxy. In both cases, the activity log records any significant generation
events and errors.
• You choose File→ Validate from the ProxyGen menu bar or the Validate button from the
toolbar.
• You choose File→ Generate from the ProxyGen menu bar or the Generate button from the
toolbar.
• Saves the proxy definition to the project file if the preference settings specify Save on
Validate/Generate.
• Compares any customizations made for procedures against the actual r-code and
synchronizes them according to the following rules:
– If a parameter for a procedure in the project file matches a parameter in the r-code by
name and data type, any customizations for the parameter are maintained. Otherwise
the parameter is assumed to be new and the default setting is used for allowing the
4GL unknown value.
3–22
Generating and Managing Proxies
• Validates the method and parameter names and verifies that all method names are unique
within each proxy object and that parameter names are unique for each method.
NOTE: While you can override method names in ProxyGen, you cannot override
parameter names.
• Verifies that all object names are unique within the proxy.
• Saves the proxy definition to the project file if the preference settings specify Save on
Validate/Generate.
• For a Java Client, generates implementation and delegating classes for each proxy object
as follows:
NOTE: For more information on these two types of classes, see Chapter 5,
“Programming Java Clients.”
– Generates two Java classes for the AppObject. For example, if the AppObject was
named Inventory, these classes would be Inventory.class and
InventoryImpl.class. The source for the public (delegating) class is also available
(Inventory.java).
– Generates two Java classes for each SubAppObject. For example, if the
SubAppObject was named Item, these classes would be Item.class and
ItemImpl.class. The source for the public (delegating) class is also available
(Item.java).
– Generates two Java classes for each ProcObject. For example, if the ProcObject was
named AddItem, these classes would be AddItem.class and AddItemImpl.class.
The source for the public (delegating) class is also available (AddItem.java).
3–23
Progress Open Client Developer’s Guide
– Generates the Type Library and Automation objects for each proxy object in a single
.dllfile.
3–24
Generating and Managing Proxies
• Propath — c:\ABCPets\Bin
• Procedures — Inventory\InvAdd.r
– ValidateInventory()
You customize the method definition for AddInventory() to not allow the 4GL unknown value
(?) for either parameter. You also explicitly exclude ValidateInventory(). Note that the
internal procedure UpdateInternals() is defined with the PRIVATE keyword and does not
appear in ProxyGen as a procedure to include or customize.
When you choose the Generate button, you supply the following information:
• AppService — com.ABCPets.Inventory
• Package — com.ABCPets
Proxy generation places the Java proxy (the .class files) into c:\Proxies\com\ABCPets, and
creates the activity log as c:\Proxies\Inventory.log. The generated Java files include:
• Inventory.java
• Inventory.class
• InventoryImpl.class
3–25
Progress Open Client Developer’s Guide
• pCust.class
• pCustImpl.class.
You then change p-Cust.w but do not change the signature of AddInventory()
(AddInventory(INTEGER, INTEGER)). You add new internal procedures to the persistent
procedure p-Cust.w. These changes only require you to regenerate the proxy as long as you
want them included. New non-PRIVATE internal procedures are added as methods
automatically with default definitions. In order to exclude them, you have to run GUI ProxyGen.
Also any changes in or the removal of ValidateInventory() do not cause validation errors
because it is excluded from the proxy definition and is not validated.
You decide to run Batch ProxyGen as part of a regular build cycle so that any similar changes
in the 4GL are automatically picked up.
Later in the development cycle, you add a new procedure file for inventory called Orders.w.
This procedure file is saved in c:\ABCPets\Source\Inventory and the r-code file is placed in
c:\ABCPets\Bin\Inventory. You then run GUI ProxyGen before the scheduled build and add
this procedure file to the Inventory AppObject.
You make another change to the AddInventory() procedure, which now takes a third parameter
(CHARACTER). Because this is a new parameter, it automatically gets the default (AppObject)
setting to allow unknowns. If you want to disallow the unknown value for this parameter, you
must run the GUI version of ProxyGen before the scheduled build and update the
customizations for this procedure.
3–26
Generating and Managing Proxies
-c @{JAVA\PROGRESSCP}
wjview.exe
/d:Install.Dir=@{Startup\DLC}
/d:ProxyGen.UseMidlFromC++=no
/d:Work.Dir=@{WorkPath}
/d:JavacCP=@{Java\JDKCP}
com.progress.open4gl.proxygen.gui.ProxyGen
The registry references denoted by "@{...}" should not normally be changed. It is only
appropriate that you customize the following lines in a ProxyGen Parameter file:
/d:ProxyGen.UseMidlFromC++=
/d:Work.Dir=
A new line for a local preference file can also be added after the /d:Work.Dir= line. For
example:
/d:Work.Dir=
/d:PrefFile="c:\myfiles\proxygen.preferences"
Parameter Description
3–27
Progress Open Client Developer’s Guide
Parameter Description
Windows Platforms
For Batch ProxyGen, one optional command-line switch is available to generate ActiveX
proxies on Windows platforms only:
-usemidlfromc++
This tells ProxyGen to use the MIDL compiler from a Visual C++ product on the system, for
example:
UNIX
Batch ProxyGen also runs on supported UNIX platforms. This allows you to generate code on
UNIX for a proxy that you have defined in a project file created using GUI ProxyGen.
Batch ProxyGen runs on UNIX using the bproxygen command the same way it runs on
Windows platforms, with the following limitations:
• It generates code only for projects that define Java proxies and that do not also define
ActiveX proxies. You can only generate ActiveX proxies on Windows platforms.
• It does not support and ignores the -usemidlfromc++ command-line switch. This switch
applies to ActiveX proxies only.
3–28
Generating and Managing Proxies
When you generate project (.pxg) files for use with Batch ProxyGen on UNIX systems, make
sure all pathnames that you specify are portable to your UNIX machine. This includes the proxy
directory, compiler path, and PROPATH settings.
In general, bproxygen applies certain translation rules when reading a project file on UNIX:
Using any other Windows-specific naming convention results in a non-portable project file.
To make your code more portable, you can use dot (.) or some other relative path as your Proxy
Dir setting for all application development. You might also consider using your PATH
environment variable for finding Java compiler by executable name only. Doing this also allows
you to install the JDK for each platform in vendor-specified default directories without causing
your application code to fail when moving from one platform to another.
3–29
Progress Open Client Developer’s Guide
3–30
4
Programming Concepts
Both Java clients and ActiveX Controller clients use equivalent mechanisms to access
AppServer functionality. This chapter describes the common features of each and how they
differ between the Java and ActiveX environments. For more detailed information about a
specific client, see Chapter 5, “Programming Java Clients,” Chapter 7, “Programming ActiveX
Controller Clients,” and Chapter 8, “Special Considerations For Java Applets.”
This chapter includes the following sections:
• Programming Overview
3 ♦ Execute proxy methods that run remote procedures and functions on the AppServer.
The remaining sections in this chapter describe how to fulfill the requirements of these steps.
The connection information includes character-string parameters that Progress passes to the
AppServer. While the application can require any character-string information, you typically
pass the following parameters:
4–2
Programming Concepts
4–3
Progress Open Client Developer’s Guide
When you connect to the AppServer, you have the option of connecting through a NameServer
or of connecting directly to the AppServer. The following shows the AppServer URL syntax for
connecting to an AppServer through a NameServer over an intranet:
SYNTAX
[[AppServer:][//name-server-host][:name-server-port][service-name]]
AppServer
name-server-host
TCP/IP host address of the NameServer that holds the service registration.
name-server-port
service-name
The following shows the AppServer URL syntax for connecting directly to an AppServer over
an intranet:
SYNTAX
AppServerDC:[//AppServer-host][:AppServer-port][service-name]
AppServerDC
AppServer-host
AppServer-port
AppServer TCP/IP port address for the AppServer specified with AppServer-host.
service-name
4–4
Programming Concepts
SYNTAX
http://[user-id[:password]@]web-server-host[:web-server-port]
/aia-path?AppService=service-name
https://[user-id[:password]@]web-server-host[:web-server-port]
/aia-path?AppService=service-name
user-id
User account name to use to connect to a Web server that hosts AIA.
password
web-server-host
web-server-port
TCP/IP port address of the Web server that hosts the AIA. The default port is 80 for HTTP
and 443 for HTTPS.
4–5
Progress Open Client Developer’s Guide
aia-path
URL path on the Web server where AIA is installed. The aia-path identifies the virtual
path and servlet name used to invoke the JSE and AIA and must include the following
information:
• A virtual path that the JSE has configured within the Web server to recognize and
pass directly to the JSE instead of looking for that directory on the Web server
The specification of the path depends on your Web server, JSE, and AIA configuration.
For more information, see the Progress Version 9 Product Update Bulletin and the
documentation for your Web server and servlet engine.
service-name
Name of the Progress service that supports the application. The service-name identifies
the application service to which the AIA connects. If you do not specify an application
service, the AIA uses the default application service registered with ProxyGen.
The following shows some examples of the AppServer URL format where external/aia1 is
the path to the AIA:
http://aia.acme.com/external/aia1?AppService=Partners
http://aia.acme.com:2045/external/aia1?AppService=Partners
http://jones@aia.acme.com/external/aia1?AppService=Partners
http://jones:brownie@aia.acme.com/external/aia1?AppService=Partners
During the connection process, if Progress determines that the client application is attempting
to connect to a secure Web server and that the httpsEnabled property is enabled, the protocol
is automatically converted to HTTPS.
NOTE: Converting the connection to HTTPS requires that the client be redirected to the port
on which the Web server is listening for HTTPS connections. This port is specified
using the secure-port property for an AIA instance. For more information, see the
Progress Version 9 Product Update Bulletin.
4–6
Programming Concepts
• The host address, port, userid, and password are required for a Proxy Web server.
• You need to provide the location of Root Digital Certificates to validate the Web server’s
identity. Every Web server that hosts an AIA servlet and that supports the HTTPS protocol
must have the Root Digital Certificate of the Certificate Authority who issued the digital
certificate for the Web server.
Your Open Client application might need to obtain URL connection information from the end
user when:
• The URL requires a userid and password for authentication to the Web server hosting the
AIA when you use the HTTP or HTTPS protocols.
• The connection URL format differs between the AppServer and AppServerDC protocol
and the HTTP and HTTPS protocols.
• You communicate with more than one AIA, you might need to use:
• When you use the HTTPS protocol, you might need to supply the names and locations of
the Root Digital Certificate files to load and use for authenticating the Web server hosting
the AIA Java servlet.
4–7
Progress Open Client Developer’s Guide
The application might automatically prompt the user for the information when it starts, or it
might chose to dynamically handle the Connection Error status returns specific to failed Web
server authentication and retry the connection after getting the information from the end user.
For more information, see“Methods For Managing Digital Certificates” in Chapter 5,
“Programming Java Clients” and “Methods For Managing Digital Certificates” in Chapter 7,
“Programming ActiveX Controller Clients.”
• Common — Methods for managing a proxy object and its AppServer connection
In addition to these methods, the proxy provides run-time properties that you can access for
specialized purposes. For more information, see the “Accessing Proxy Run-time Properties”
section.
The following sections provide information about:
• Connection Methods
• Common Methods
4–8
Programming Concepts
• Passing Parameters
4–9
Progress Open Client Developer’s Guide
Passing Parameters
ProxyGen maps 4GL data types to equivalent data types in the Open Client for 4GL INPUT,
OUTPUT, and INPUT-OUTPUT parameters.
For more information on data type mapping for your type of Open Client, see for:
• Java — _getProcReturnString that returns a String, which can be null, so the client can
check for a 4GL unknown value(?).
These methods return the current value of RETURN-VALUE as set by the RETURN statement
most recently executed on this connection. AppObjects, SubAppObjects, and ProcObjects all
support this method.
NOTE: The RETURN-VALUE function is set in the 4GL using the RETURN string or
the RETURN ERROR string statement. For more information on these statements,
see the Progress Language Reference, and for how they function in an AppServer
application, see Building Distributed Applications Using the Progress AppServer.
For any remote user-defined function, ProxyGen defines the corresponding method to return a
value that is compatible with the 4GL data type returned by the user-defined function.
4–10
Programming Concepts
ProxyGen generates class factory methods using standard naming conventions for each type of
Open Client. For more information, see Chapter 3, “Generating and Managing Proxies.”
4–11
Progress Open Client Developer’s Guide
ActiveX:
• Function OC_GetConnectionId() As
String
ActiveX:
• Function OC_IsStreaming() As
Boolean
4–12
Programming Concepts
4.5.1 AppObjects
Each AppObject represents the encapsulation of some set of business logic deployed at a
particular AppServer and it establishes a connection to that AppServer.
Methods
An AppObject has the following types of methods:
• Connection:
4–13
Progress Open Client Developer’s Guide
• Procedure Class Factory — Create ProcObjects that share the AppServer connection
from this AppObject and run an external procedure on the AppServer persistently.
• SDOResultSet Class Factory— (Java only) A built-in method that creates a predefined
ProcObject, SDOResultSet. SDOResultSet provides Java client access to a specified
remote Progress SmartDataObject as an extended JDBC 2 ResultSet. For more
information, see Chapter 6, “Using SmartDataObjects From Java Clients.”
4–14
Programming Concepts
Java AppObject
// --------------------------Common Methods-----------------------------
4–15
Progress Open Client Developer’s Guide
For more information on how to specify the parameters for the AppObject constructors for a
particular AppServer connection, see the“Connecting To a Progress AppServer” section in this
chapter and in Chapter 5, “Programming Java Clients.” For more information on the other types
of methods, see the “Understanding Proxy Object Methods” section in this chapter.
• A ProcObject Class Factory method that runs and instantiates the persistent procedure
AccountInfo.p on the AppServer:
• Remote 4GL methods to run the internal procedures Add and Remove (defined by
AccountInfo.p)on the AppServer:
Sub OC_CancelAllRequests()
Function OC_GetConnectionId() As String
Function OC_GetProcReturnString() As String
Function OC_IsStreaming() As Boolean
Sub OC_Release()
4–16
Programming Concepts
For more information on how to specify the parameters for the connection method,
OC_Connect(), for a particular AppServer connection, see the“Connecting To a Progress
AppServer” section in this chapter and in Chapter 7, “Programming ActiveX Controller
Clients.” For more information on the other types of methods, see the “Understanding Proxy
Object Methods” section in this chapter.
4.5.2 SubAppObjects
Each SubAppObject represents the encapsulation of a particular business function deployed at
a particular AppServer. It differs from an AppObject only in the fact that it does not establish
its own connection to an AppServer but shares the one from its associated AppObject.
The associated AppObject defines a class factory method for creating each SubAppObject that
shares its AppServer connection. This method exchanges no communications with the
AppServer. Rather, it only performs operations to instantiate the SubAppObject on the client.
Methods
A SubAppObject has the following types of methods:
• Procedure Class Factory — Create ProcObjects that share the AppServer connection
from the associated AppObject and run an external procedure on the AppServer
persistently.
• SDOResultSet Class Factory— (Java only) A built-in method that creates a predefined
ProcObject, SDOResultSet. SDOResultSet provides Java client access to a specified
remote Progress SmartDataObject as an extended JDBC 2 ResultSet. For more
information, see Chapter 6, “Using SmartDataObjects From Java Clients.”
4–17
Progress Open Client Developer’s Guide
Java SubAppObject
// --------------------------Common Methods-----------------------------
4–18
Programming Concepts
• A ProcObject Class Factory method that runs and instantiates the persistent procedure
TaxInfo.p on the AppServer:
• Remote 4GL method to run the internal procedure SetStatus (defined by TaxInfo.p) on
the AppServer:
Sub OC_CancelAllRequests()
Function OC_GetConnectionId() As String
Function OC_GetProcReturnString() As String
Function OC_IsStreaming() As Boolean
Sub OC_Release()
For more information on the three types of methods in a SubAppObject, see the “Understanding
Proxy Object Methods” section in this chapter.
4.5.3 ProcObjects
Each ProcObject represents a particular persistent procedure running on an AppServer. The
ProcObject exposes all non-PRIVATE internal procedures and user-defined functions to the
client that you do not explicitly omit in ProxyGen when you define the ProcObject.
A ProcObject also shares a connection established by an associated AppObject. You can create
the ProcObject using a class factory method on the AppObject or SubAppObject to which this
procedure was added in ProxyGen
4–19
Progress Open Client Developer’s Guide
When you call the ProcObject class factory method on the AppObject or SubAppObject, it
creates the ProcObject on the client and executes the corresponding procedure persistently on
the AppServer. Any parameters required by this procedure are required as parameters on the
class factory method. The ProcObject saves a handle to the persistent procedure for future calls
to its internal procedures and functions and for releasing and disconnecting the object from the
AppServer application.
Methods
A ProcObject has the following types of methods:
• Remote 4GL — Run internal procedures and user-defined functions on the AppServer
that are defined in the associated remote persistent procedure
Java ProcObject
// --------------------------Common Methods-----------------------------
4–20
Programming Concepts
For more information on the two types of methods in a ProcObject, see the“Understanding
Proxy Object Methods” section in this chapter.
Sub OC_CancelAllRequests()
Function OC_GetConnectionId() As String
Function OC_GetProcReturnString() As String
Function OC_IsStreaming() As Boolean
Sub OC_Release()
For more information on the two types of methods in a ProcObject, see the“Understanding
Proxy Object Methods” section in this chapter.
For information on TEMP-TABLE parameters, first see the“Passing TEMP-TABLE And
TABLE-HANDLE Parameters” in this chapter and then in Chapter 7, “Programming ActiveX
Controller Clients.”
4–21
Progress Open Client Developer’s Guide
• Comparing the Flat Model and Array Model For Result Set Access
For information about how a specific Open Client type passes parameters, see:
4–22
Programming Concepts
When the client application passes a TABLE–HANDLE parameter, the proxy does not know
the schema (metadata) for the table. The client must provide both the schema and the data t for
the TABLE–HANDLE parameters. If the application does not provide metadata, the method
call fails.
For more information about how metadata is provided to the a specific client type, see:
4–23
Progress Open Client Developer’s Guide
Table 4–3 shows how the call-back sequence works when passing an OUTPUT TEMP-TABLE
or TABLE-HANDLE parameter.
Table 4–4 shows how the call-back sequence works when passing an INPUT-OUTPUT
TEMP-TABLE Or TABLE-HANDLE parameter.
4–24
Programming Concepts
The input result set object is an object that is written by the Java or ActiveX client application.
This can also be a standard result set object available from each respective environment as the
result of an SQL query (a java.sql.ResultSet in Java, or a DAO or ADO Recordset object
in Visual Basic). In contrast, the output result set object is always provided by the generated
proxy.
4–25
Progress Open Client Developer’s Guide
This process of buffering an output result set from the AppServer and making it sequentially
available to the client is called streaming. An AppServer connection that is streaming a result
set is said to be in a STREAMING state. This STREAMING state remains in effect until all data
has been received by the client or the result set is closed.
When the method containing an output result set parameter returns, the client gets an object that
it can use to call back for more data. However, the client cannot make any other AppServer
method calls while the connection is in the STREAMING state. To determine whether a
connection is in the streaming state, you can invoke the _isStreaming() method (Java client)
or the OC_IsStreaming() method (ActiveX client) for any proxy object using the connection.
While both types of Open Clients handle output result sets using streaming, you must make
special provisions for streaming in a multi-threaded Java client. For more information on
managing streaming in Java clients, see the information on multi-threaded applications in
Chapter 5, “Programming Java Clients.”
4–26
Programming Concepts
4.6.3 Comparing the Flat Model and Array Model For Result
Set Access
An array field in a Progress TEMP-TABLE can be viewed as a result set in two different ways.
In the flat model, each array element becomes a separate column of the table. In the array model,
each array is a single column of the table, with each array element being accessed by an index
on the array column. The array model matches how Progress handles array fields.
For both Java and ActiveX clients, there are access methods to support both models. These
methods access field values and metadata of an output result set.
The following examples use the Java flat model metadata methods getColumnType() and
getColumnCount() and the array model methods getFieldProType() and getFieldCount().
For more information on the result set access methods for both Java and ActiveX clients, see
Chapter 5, “Programming Java Clients,” Chapter 6, “Using SmartDataObjects From Java
Clients,” and Chapter 7, “Programming ActiveX Controller Clients.”
These examples illustrate the use of a Progress TEMP-TABLE with three fields in a Java client
application, where the second field is an array of 12 elements.
4–27
Progress Open Client Developer’s Guide
• getColumnType(4) gets the data type of the third element of the second TEMP-TABLE
field (which is the array field).
Since all elements of an array field have the same metadata information, getColumnType(2)
through getColumnType(13) return the same value.
In this model, since all elements of an array field have the same metadata information, it is only
necessary to pass in the field index (without an array item index) to these metadata methods. For
methods that get a field value, each method has an extra parameter to specify an array index.
For example, the method to get the value of a field as an object is:
4–28
Programming Concepts
• Client-side Errors
A client-side error is an error that occurs on the client machine before the proxy sends a
particular request to the AppServer. A server-side error is an error that occurs on the AppServer
machine, either before the AppServer runs a remote procedure or during procedure execution.
No matter what type of error Progress returns, the proxy makes the error message available to
the client application. For Java applications, the proxy also makes the Progress error message
number available.
For more information on how proxies return errors for your type of Open Client, see for:
A different set of rules determines how Progress propagates each type of error to the client
application. The following sections describe these rules and the types of errors that are returned.
4–29
Progress Open Client Developer’s Guide
• ERROR condition — A server-side ERROR condition is sent to the client only when a
remote procedure or function (or an Activate procedure) executes a RETURN ERROR
statement. All other server-side ERROR conditions (such as failure to connect to a
database) are not raised beyond the scope of the 4GL procedure where they occur.
Therefore, such ERROR conditions do not propagate to the client. Instead, the AppServer
writes error messages for these conditions to the server log file.
• STOP condition — Any unhandled STOP condition raised on the AppServer is sent to
the client. This type of server-side error can occur, for example, when the called remote
procedure calls another procedure that cannot be found.
• QUIT condition —Any unhandled QUIT condition raised on the AppServer is sent to the
client. The server-side 4GL application can use a QUIT statement to raise a QUIT
condition because the client exceeded some resource, did something it should not do, or
for any other reason it chooses.
4–30
5
Programming Java Clients
For the Java client, ProxyGen generates a proxy as a set of Java classes to access Progress
AppServer functionality. ProxyGen generates the proxy classes into a package, if you specify
one, for proxy generation. You can also access remote Progress SmartDataObjects from a Java
client with or without a ProxyGen-generated proxy. For more information, see Chapter 6,
“Using SmartDataObjects From Java Clients.”
This chapter describes how to access AppServer functionality (other than Progress
SmartDataObjects) using ProxyGen-generated Java proxies and the Progress Open Client
Runtime. It describes:
• Connecting To an AppServer
• Handling Errors
NOTE: You can find HTML documentation on the classes and interfaces provided by the
Open Client Runtime in Progress-Install-Directory/java/doc.
Progress Open Client Developer’s Guide
SYNTAX
public class-name
( String url,
String userid,
String password,
String appserver-info
);
public class-name
( String userid,
String password,
String appserver-info
);
The url parameter specifies the AppServer connection information. The userid, password,
and appserver-info parameters specify any information required by the AppServer
application at connection time. For more information on how to specify these parameters, see
the information on connecting to an AppServer in Chapter 4, “Programming Concepts.”
5–2
Programming Java Clients
Table 5–1 shows the 4GL-to-Java data type mapping for parameters.
CHARACTER String
COM-HANDLE com.progress.open4gl.COMHandle
DATE java.util.GregorianCalendar
DECIMAL Java.math.BigDecimal
INTEGER int
LOGICAL boolean
MEMPTR com.progress.open4gl.Memptr
RAW byte[]
RECID long
ROWID com.progress.open4gl.Rowid
WIDGET-HANDLE com.progress.open4gl.Handle
The COM-HANDLE, WIDGET-HANDLE, RECID, or ROWID 4GL data types are not
meaningful outside of the Progress environment. Their use is restricted to obtaining the value
from a Progress procedure and being able to pass it back to another Progress procedure.
The mapping for the individual fields of a TEMP-TABLE differs from that of other parameters.
For information on data type mapping for TEMP-TABLE or TABLE-HANDLE parameters,
see Table 5–3.
NOTE: Open Clients do not support the Progress BUFFER parameter.
5–3
Progress Open Client Developer’s Guide
This is an example of a proxy method that allows all the parameter values to have unknown
values:
Holder Classes
For each of the Java data types that map to a Progress data type, there is a Holder class. These
Holder classes belong to the com.progress.open4gl package and extend the
com.progress.open4gl.Holder class shown in Example 5–1.
// Holder Definition
Public class Holder
{
public Holder();
public void setValue(Object value);
public Object getValue();
public boolean isNull();
}
5–4
Programming Java Clients
For an INPUT-OUTPUT parameter, you can set an input value to the 4GL unknown value (?)
by calling setValue(null) on the holder object. For OUTPUT parameters, the application can
find out whether an unknown output value is returned by calling the isNull() method or by
testing for a null return value from the getValue() method on the holder object.
Table 5–2 shows the 4GL-to-Java mapping of input-output and output parameters to specific
Holder classes.
CHARACTER com.progress.open4gl.StringHolder
COM-HANDLE com.progress.open4gl.COMHandleHolder
DATE com.progress.open4gl.DateHolder
DECIMAL com.progress.open4gl.BigDecimalHolder
INTEGER com.progress.open4gl.IntHolder
LOGICAL com.progress.open4gl.BooleanHolder
MEMPTR com.progress.open4gl.MemptrHolder
RAW com.progress.open4gl.ByteArrayHolder
RECID com.progress.open4gl.LongHolder
ROWID com.progress.open4gl.RowidHolder
TABLE-HANDLE com.progress.open4gl.ResultSetHolder
TEMP-TABLE com.progress.open4gl.ResultSetHolder
WIDGET-HANDLE com.progress.open4gl.HandleHolder
5–5
Progress Open Client Developer’s Guide
5–6
Programming Java Clients
For more information on the java.sql.ResultSet interface, see the relevant JavaSoft
publications.
Progress provides the abstract class, com.progress.open4gl.InputResultSet, provides part
of an implementation of java.sql.ResultSet. You can extend this class to implement your
own input result sets. For more information, see the “Passing a TEMP-TABLE Or
TABLE-HANDLE As an INPUT Parameter” section.
The java.sql.ResultSet interface allows you to get the values of columns in the underlying
TEMP-TABLE. The extensions in the ProResultSet interface allow you to get the values of
Progress fields, especially array fields, in a more Progress-like manner. For more information
on how to access column and field values using the ProResultSet interface, see the “Accessing
TEMP-TABLE Or TABLE-HANDLE Parameters As Output” section.
The following sections provide information about:
5–7
Progress Open Client Developer’s Guide
CHARACTER String
COM-HANDLE Long
DATE java.sql.Date or
java.util.GregorianCalendar
DECIMAL Java.math.BigDecimal
INTEGER Integer
LOGICAL Boolean
RAW byte[]
RECID Long
ROWID byte[]
WIDGET-HANDLE Long
There are two different Java data types listed for DATE. For an input TEMP-TABLE or TABLE
HANDLE, you can supply either of the object types shown. For details about how input
TEMP-TABLE data is supplied to the proxy, see the “Passing a TEMP-TABLE Or
TABLE-HANDLE As an INPUT Parameter.”
For output, your application calls an instance of java.sql.ResultSet to get the data of each
TEMP-TABLE field or TABLE-HANDLE. There is both a getDate() method that returns a
java.sql.Date and a getGregorianCalendar() method that returns a
java.util.GregorianCalendar on this result set. There is also a getObject() method that
when called returns a java.sql.Date. For more information, see the “Accessing
TEMP-TABLE Or TABLE-HANDLE Parameters As Output” section.
5–8
Programming Java Clients
getObject() can return either one of these object types. For output, there is both a that returns
a java.sql.Date and a getGregorianCalendar() method that returns a
java.util.GregorianCalendar. If getObject() is called, a java.sql.Date is returned.
When the getDataType() method that you use to get the value of a TEMP-TABLE field does
not match the default Java data type of the field (Table 5–3), a valid conversion occurs as long
as the getDataType() method corresponds to the Progress data type as shown in Table 5–4.
Otherwise, an Exception is thrown with a message explaining that the conversion is not
supported. For example, if the TEMP-TABLE field is defined as LOGICAL, you can use any
of getString(), GetInt(), or GetBoolean() to retrieve the field value.
Progress
Valid Java Data Type Conversions
Data Type
5–9
Progress Open Client Developer’s Guide
Progress
Valid Java Data Type Conversions
Data Type
• Obtain a ResultSet instance by running a method on some java.sql object (for example,
run the executeQuery() method on an instance of java.sql.Statement).
Using com.progress.open4gl.InputResultSet
The com.progress.open4gl.InputResultSet abstract class implements the
java.sql.ResultSet interface except for two methods that you must implement in your
extended class. The proxy calls back through these methods to get the data to pass to Progress.
The two methods you must implement are:
SYNTAX
boolean next()
5–10
Programming Java Clients
Advances the result set cursor to the next row. The cursor is always initially positioned before
the first row of the result set, and as a result, the first time next() is called the cursor moves to
the first row. It returns false when there are no more rows.
NOTE: Make sure the result set cursor is positioned before the first row if you plan to pass
the InputResultSet as an input parameter, and you want the receiving context to have
access to all rows from the beginning of the InputResultSet. Only rows after the
current cursor position are passed to the AppServer.
SYNTAX
columnNum
Your implementation of these methods can differ depending on the data source for the input
TEMP-TABLE. For example, the data might come from an in-memory vector or read from a
file. Therefore, the exact implementation depends entirely on the specific requirements of your
application.
5–11
Progress Open Client Developer’s Guide
– If the input ResultSet is a standard JDBC ResultSet obtained from a query, the client
application does not need to do anything. The ResultSet instance already
implements the getMetaData() method and returns a standard ResultSetMetaData
object.
The proxy automatically maps SQL data types to Progress data types as shown in
Table 5–5.
Table 5–5: Mapping Between SQL and Progress Data Types For
Standard JDBC ResultSet
INTEGER INTEGER
DECIMAL DECIMAL
CHARACTER LONGVARCHAR
LOGICAL BIT
DATE DATE
RAW VARBINARY
5–12
Programming Java Clients
– If the ResultSet contains a column type other than the types shown in Table 5–5 and
the column can be converted to a compliant type, implement your own ResultSet
class instead of passing the java.sql.ResultSet directly as the parameter. For
example, you can extend com.progress.open4gl.InputResultSet with your own
class.
When getObject() is called on your class, it retrieves data from the corresponding
standard object and converts the data before returning it to the proxy. When the
getMetaData() method is called, the implementation of your extended class must
supply the appropriate metadata. To do this, the application must create and populate
a ProResultSetMetaDataImpl object as described in the section under the Use
ProResultSetMetaDataImpl bullet.
– If the input ResultSet is a ResultSet that was first obtained from the AppServer
through an OUTPUT parameter, metadata can be obtained from that output set by
calling getMetaData() on it. You can think of this as an INPUT–OUTPUT
TABLE-HANDLE parameter even though it is output from one method call and
input through another. The ResultSet object obtained from the output ResultSet
can then be provided when getMetaData() is called for the input ResultSet.
If the metadata for the input ResultSet must be supplied by code implemented in the
client application, the getMetaData() method must be implemented to return an instance
of ResultSetMetaData. The recommended way to do this is to use the
com.progress.open4gl.ProResultSetMetaDataImpl class provided in the Open Client
Toolkit. This is an implementation of the ProResultSetMetaData interface, the same
interface that is used by the client when getting output data.
5–13
Progress Open Client Developer’s Guide
The only two methods of ProResultSetMetaDataImpl that the application must call are
the constructor and the SetFieldMetaData() method as follows:
SYNTAX
SYNTAX
– The value of the Name parameter must be unique within the table
5–14
Programming Java Clients
NOTE: Step c and Step d can be implemented in getMetaData() which eliminates the
need for Step e.
5–15
Progress Open Client Developer’s Guide
In addition to the standard flat model for viewing individual columns presented by ResultSet
objects, ProResultSet allows you to view the object using the Progress array model, which
presents a TEMP-TABLE as individual fields that can contain arrays. You can choose
whichever model is most natural or convenient. For more information on the Progress field
model, see Chapter 4, “Programming Concepts.”
SYNTAX
boolean next()
SYNTAX
void close()
Closes the result set. For output result sets, the close() method may be called to close the result
set before all the rows have been fetched.
NOTE: No other AppServer method can be called until all the rows have been fetched or
until close() has been called.
SYNTAX
Returns the value of the column identified by the 1-based columnNum. The data type of the
returned object is the default data type of the column. For example, the default data type for a
4GL CHARACTER field is java.lang.String. For more information, see the “Default
Data-type Mapping For TEMP-TABLE Fields” section.
5–16
Programming Java Clients
SYNTAX
Returns the value of the column identified by the fieldName. The data type of the returned
object is the default data type of the field. For example, the default data type for a 4GL
CHARACTER field is java.lang.String. For more information, see the “Default Data-type
Mapping For TEMP-TABLE Fields” section.
SYNTAX
Returns the value of the column identified by columnNum. DataType is the name of the data
type, for example, String getString(), Integer getInteger(), and so on.
SYNTAX
Returns the value of the column identified by the fieldName. DataType is the name of the
data type, for example, String getString(), Integer getInteger(), and so on.
If the specified return DataType is different from the default data type of the column, the Open
Client takes one of the following actions:
• The value is automatically converted from the default data type to DataType.
• An Exception is thrown with a message explaining that the conversion is not supported.
For example, if the 4GL data type is INTEGER and its value is 10, getString(columnNum)
automatically converts the value from Integer to the java.lang.String, "10". If the
application calls getDate(columnNum), an Exception is thrown with the message that an
Integer value cannot be converted to Date. For information on the supported conversions, see
Table 5–4.
5–17
Progress Open Client Developer’s Guide
SYNTAX
Returns the value of the arrrayIndex element of the array field identified by fieldNum. The
datatype of the object is the default datatype of the arrayfield. The arrayIndex and fieldNum
are 1-based.
SYNTAX
Returns the value of the arrayIndex element of the arrayfield identified by fieldName. The
datatype of the object is the default datatype of the arrayfield. The arrayIndex and
fieldName are 1-based.
SYNTAX
Name of datatype. For example, String getString(), Integer getInteger(), and so on.
Returns the value of the arrayIndex element of the arrayfield identified by fieldNum. The
arrayIndex and fieldNum are 1-based.
SYNTAX
Name of the datatype. For example, String getString(), Integer getInteger(), and so on.
The datatype of the object is the default datatype of the arrayfield. The arrayIndex and
fieldNum are 1-based.
For example, here is the syntax for methods that return a value for a String and an Integer
array element of a TEMP-TABLE field:
5–18
Programming Java Clients
For a complete listing of the methods implemented by the ProResultSet interface, see the
documentation in Progress-Install-Directory/java/doc.
The rest of this section describes the ProResultSetMetaData methods and how they allow you
to view a ProResultSet object both as standard ResultSet columns and Progress
TEMP-TABLE fields, using the array model.
5–19
Progress Open Client Developer’s Guide
• These methods are part of the standard java.sql.ResultSetMetaData interface and are
useful if the client wants to write standard code that could access any JDBC result set:
SYNTAX
SYNTAX
SYNTAX
The getColumnType() method returns an int constant for the standard SQL types as
shown in Table 5–6. The column under SQL Data Type in the table shows the type names
as specified by the java.sql.Types class.
SYNTAX
The getColumnTypeName() method returns the corresponding Progress data type names
shown in Table 5–6 under Progress Data Type.
CHARACTER LONGVARCHAR
COM-HANDLE BIGINT
DATE DATE
DECIMAL DECIMAL
5–20
Programming Java Clients
INTEGER INTEGER
LOGICAL BIT
RAW VARBINARY
RECID BIGINT
ROWID VARBINARY
WIDGET-HANDLE BIGINT
• These methods allow you to see the data type of each result set column as Progress and
Java types:
SYNTAX
PRO_CHARACTER = 1;
PRO_DATE = 2;
PRO_LOGICAL = 3;
PRO_INTEGER = 4;
PRO_DECIMAL = 5;
PRO_RECID = 7;
PRO_RAW = 8;
PRO_WIDGETHANDLE = 10;
PRO_ROWID = 13;
PRO_COMHANDLE = 14;
5–21
Progress Open Client Developer’s Guide
SYNTAX
getColumnJavaTypeName() returns the name of the Java class that each Progress data type
maps to. For information on these mappings, see Table 5–3.
• These methods provide access to the schema of TEMP-TABLE parameters that contain
array fields, viewed from a Progress point of view:
SYNTAX
SYNTAX
SYNTAX
SYNTAX
SYNTAX
SYNTAX
The Progress-oriented methods, which view the TEMP-TABLE using the Progress array field
model (fields that can include arrays), have prototypes that refer to Field or field. For more
information on the relationship between ResultSet columns and Progress array fields, see the
section comparing the flat model and array model for result sets in Chapter 4, “Programming
Concepts.”
5–22
Programming Java Clients
Although you can access the data using either the SQL or Progress model, both provide
equivalent functionality. Table 5–7 shows the correspondence between the
ProResultSetMetaData methods.
This method As
returns the same set of values ... this method ...
getFieldName() getColumnName()
getFieldProType() getColumnProType()
getFieldJavaTypeName() getColumnJavaTypeName()
getFieldTypeName() getColumnTypeName()
5–23
Progress Open Client Developer’s Guide
5–24
Programming Java Clients
5–25
Progress Open Client Developer’s Guide
import java.sql.*;
import java.util.Vector;
rows.addElement(row);
rows.addElement(row);
currentRow = null;
rowNum = 0;
}
return true;
}
5–26
Programming Java Clients
// Return the nth object of the row when n = pos. In this example, pos can be
// 1 or 2.
public Object getObject(int pos) throws SQLException
{
return currentRow.elementAt(pos-1);
}
}
AccountInfo.p
/* AccountInfo.p Procedure */
DEFINE INPUT PARAM account-num AS INTEGER.
PROCEDURE getPaymentsInfo:
END PROCEDURE.
5–27
Progress Open Client Developer’s Guide
public Account(connect-parameters)
{
m_accountImpl = new AccountImpl(connect-parameters);
}
public Add(add-parameters)
{
m_accountImpl.Add(add-parameters);
}
public Tax createAO_Tax()
{
return new Tax(m_accountImpl);
}
public Tax createPO_AccountInfo(AccountInfo-parameters)
{
return new AccountInfo(m_accountImpl, AccountInfo-parameters);
}
public _release()
{
m_accountImpl._release();
}
...
}
5–28
Programming Java Clients
5–29
Progress Open Client Developer’s Guide
5–30
Programming Java Clients
• QUEUED — The connection is busy with a request from another thread. The current
request is queued until the connection becomes available.
• RUNNING — The current request is being run on the connection, and the connection is
in the RUNNING state.
• STREAMING — The current request is transmitting records over the connection, and the
connection is in the STREAMING state.
5–31
Progress Open Client Developer’s Guide
• Terminate a request that was initiated by any object in the proxy and that is currently
running (normally during a long execution).
• STREAMING — Initiates the close of any currently open output result sets, but does not
call the close() method. You must then execute the close() method on all affected
output result sets to complete the closure. For large result sets, this is more efficient than
using the close() method alone. For more information on the close() method, see the
“Passing TEMP-TABLE Or TABLE-HANDLE Parameters” section.
NOTE: If there are no requests in the following states when you execute
_cancelAllRequests(), the method has no effect.
5–32
Programming Java Clients
SYNTAX
Sends all trace messages equal or greater than the value specified with level to the file specified
with fileName. If filename is not specified, the output is Standard Error. The lower the value
for level, the greater the information. If the level is not specified, the value equals 2.
SYNTAX
RunTimeProperties.traceOn(int level)
Sends all trace messages equal or greater than the value specified with level to Standard Error.
SYNTAX
RunTimeProperties.traceOn(String fileName)
Sends all trace messages of level 2 and greater to the file specified with fileName.
5–33
Progress Open Client Developer’s Guide
SYNTAX
RunTimeProperties.traceOn()
SYNTAX
RunTimeProperties.traceOff()
SYNTAX
Boolean RunTimeProperties.isTracing()
Returns TRUE if tracing is turned on. Returns FALSE if tracing is turned off.
• The second call can be queued and executed when the AppServer becomes available.
The application can set the run-time properties to do either and can switch the setting at any
time. The default is to throw an Exception.
These methods provide thread control to the Open Client Runtime:
SYNTAX
RunTimeProperties.setWaitIfBusy()
Waits until all currently executing AppServer requests are complete before executing this
request.
5–34
Programming Java Clients
SYNTAX
RunTimeProperties.setNoWaitIfBusy()
Do not wait for a currently executing AppServer request to finish. Instead throw an exception
for any AppServer request that was made while the AppServer was executing another request.
SYNTAX
Boolean RunTimeProperties.getWaitIfBusy()
Checks the thread control setting to determine if WaitIfBusy state is set or cleared. Returns
TRUE if setWaitIfBusy() was called and FALSE if setNoWaitIfBusy() was called.
SYNTAX
RunTimeProperties.setProxyHost(String hostname)
Sets the Proxy Web server host to the value specified with hostname. This value can be a string
with either the DNS name of the Proxy Web server or its dot-formatted IP address.
SYNTAX
RunTimeProperties.setProxyPort(int port)
Sets the Proxy server port to the value specified with port. This value can be an integer from
1 to 65536.
SYNTAX
RunTimeProperties.setProxyUserID(String proxyAccountName)
Sets the Proxy server user to the value specified with AccountName. This value can be string of
up to 512 printable ASCIII characters.
5–35
Progress Open Client Developer’s Guide
SYNTAX
Sets the Proxy server password to the value specified with AccountPassword. This value can be
a string of up to 512 printable ASCII characters.
SYNTAX
String RunTimeProperties.getProxyHost()
SYNTAX
int RunTimeProperties.getProxyPort()
SYNTAX
String RunTimeProperties.getProxyUserId()
SYNTAX
RunTimeProperties.setCertificateStore(String certStoreList)
Specifies the files that contain the Root Digital Certificates. If more than one directory, file, or
both is specified, they must be separated by semicolons.
SYNTAX
String RunTimeProperties.getCertificateStore()
5–36
Programming Java Clients
SYNTAX
RunTimeProperties.setNoHostVerify(boolean verify)
Controls Domain Name checking. Specifying FALSE for verify enables Domain Name
checking. Specifying TRUE disables Domain Name checking. The default value is TRUE (on).
SYNTAX
Boolean RunTimeProperties.getNoHostVerify()
Returns a boolean value that indicates the settings for Digital Certificate authentication options.
• Output result set Exceptions — A class ProSQLException that extends the standard
java.sql.SQLException class.
SYNTAX
long getMessageID()
5–37
Progress Open Client Developer’s Guide
For information about additional methods provided by these Exception classes, see the Open
Client Toolkit documentation in Progress-Install-Directory/java/doc.
The following sections describe each Exception class in detail.
5–38
Programming Java Clients
5–39
Progress Open Client Developer’s Guide
5–40
6
Using SmartDataObjects From Java Clients
Any Java application can access a remote Progress SmartDataObject using an interface based
on the Java Database Connectivity (JDBC) 2 ResultSet. The supported interface includes many
of the standard ResultSet methods and adds a number of extensions. This chapter describes how
to access and use this interface. For general information on accessing AppServer functionality
from a Java client, see Chapter 5, “Programming Java Clients.”
The following sections provide information on:
• Multi-threading
6–2
Using SmartDataObjects From Java Clients
Progress AppServer
AppObject or .
SubAppObject .
Java Client .
Application
SDOResultSet SmartDataObject
6–3
Progress Open Client Developer’s Guide
import com.progress.open4gl.*;
This SDOResultSet object extends the JDBC 1 ResultSet interface to include JDBC 2
functionality. Thus, using standard JDBC 2 ResultSet methods on an SDOResultSet object, you
can access Progress data provided by the specified SmartDataObject in the same way as a
standard JDBC 2 ResultSet. SDOResultSet also further extends JDBC 2 functionality to access
the unique capabilities of SmartDataObjects.
6–4
Using SmartDataObjects From Java Clients
• SDOResultSet — An extended subset of the JDBC 2 (JDK 1.2) ResultSet interface that
provides access to a SmartDataObject. Because all instances of a SmartDataObject present
the same 4GL API, the one SDOResultSet class allows you to access any such instance.
Note that SDOResultSet works with both JDK 1.1.x and JDK 1.2. Thus, much of the Java
1.2 functionality (standard JDBC ResultSet interface) is supported even with JDK 1.1.x.
NOTE: SDOResultSet allows you to access only the default SmartDataObject API
generated by the Progress AppBuilder. If you need to access custom programmer
extensions to this API, you must access the SmartDataObject API directly. For
more information, see Appendix A, “Accessing a SmartDataObject API
Directly.”
Thus, if you only need to access SmartDataObjects on the AppServer and no other
AppServer procedures, you can use this SDOAppObject out of the box. If you need to
access other 4GL procedures on the AppServer in addition to the SmartDataObject, you
can use any AppObject or SubAppObject generated with ProxyGen to access any
SmartDataObject. For more information on AppObjects, see Chapter 4, “Programming
Concepts.”
• SDOParameters — An object that you can pass to the SDOResultSet constructor through
the _createSDOResultSet() method. SDOParameters allows you to modify the default
behavior of the SDOResultSet instance.
6–5
Progress Open Client Developer’s Guide
2 ♦ Deploy the compiled SmartDataObject (the *.r file) on the AppServer side (the compiled
SmartDataObject must be on the PROPATH of the AppServer).
4 ♦ Deploy the Open4gl Client Runtime package on the client side. For more information, see
Chapter 2, “Configuration and Deployment.”
5 ♦ If your Java application needs only SmartDataObject access (it does not access other
remote 4GL procedures), you are ready to write Java applications that access the
SmartDataObject.
6 ♦ If your Java application needs to access 4GL procedures other than SmartDataObjects, use
ProxyGen to create the proxies and deploy them on the client side (see Chapter 3,
“Generating and Managing Proxies”). However, you do not have to map the
SmartDataObject as a ProcObject. ProxyGen provides built-in access to
SmartDataObjects in Java.
NOTE: If you add your own extensions (new 4GL methods) to a SmartDataObject, to access
these extensions you must access the SmartDataObject as a separate ProcObject that
you create in ProxyGen. This allows you to directly access the SmartDataObject as
a Progress persistent procedure with complete access to its public internal procedures
and user-defined functions. For more information on accessing a SmartDataObject
as a ProcObject, see Appendix A, “Accessing a SmartDataObject API Directly.”
6–6
Using SmartDataObjects From Java Clients
3 ♦ Invoke standard JDBC 2 and extended methods on the SDOResultSet to query and modify
data accessed through the SmartDataObject.
SYNTAX
public SDOAppObject
( String url,
String userid,
String password,
String appserver-info
);
public SDOAppObject
( String userid,
String password,
String appserver-info
);
public SDOAppObject
(
);
6–7
Progress Open Client Developer’s Guide
The url parameter specifies the AppServer connection information. The userid, password,
and appserver-info parameters specify any information required by the AppServer
application at connection time. For more information on how to specify these parameters, see
the information on connecting to an AppServer in Chapter 4, “Programming Concepts.”
SYNTAX
Uses the KEEP_ROWS scrolling mode and the default where and sort expressions.
SYNTAX
SYNTAX
Uses whatever scrolling mode is specified by parameters. If parameters does not specify a
scrolling mode, the default is used.
6–8
Using SmartDataObjects From Java Clients
• String sdoName
• String where
Allows the application to open a query with a where expression that is different than the
default one specified when the SmartDataObject was created. For more information, see
the description of the setQueryWhere method in the Progress ADM 2 Reference.
• String sortBy
Allows the application to open a query with a sort expression that is different from the
default one specified when the SmartDataObject was created. You can specify the sort
expression using one of the following syntax styles:
SYNTAX
In this style, field is a valid database field referenced by the SmartDataObject and
specifying no fields ("") is equivalent to null. Examples include:
– "Name"
– "Name, City"
SYNTAX
This style represents a valid 4GL sort clause (omitting the first BY keyword). Examples
include:
– "Name"
– "Name BY City"
6–9
Progress Open Client Developer’s Guide
For more information on specifying this parameter, see the description of the setQuerySort
method in the Beta Progress ADM 2 Guide.
• SDOParameters parameters
Used for passing any additional initial parameters to the ResultSet object, such as the
scrolling mode.
You only need to set values that differ from the defaults. The methods to set and get these values
on the SDOParameters object follow:
SYNTAX
Sets the row ID of the first row to be fetched from the created and opened SDOResultSet. A null
rowId is equivalent to not calling setRowIdentity() (see also, the reOpenQuery(String
rowId) extended method in the “Miscellaneous Management Methods” section). It is usually
more efficient to use setRowIdentity() than to create the SDOResultSet and then call the
extended method, absolute(String rowId), to reposition the cursor on the specified row.
If you create the SDOResultSet in PREFETCH scrolling mode, you cannot access rows before the
rowId that you set with setRowIdentity(). For more information on PREFETCH scrolling mode,
see the “Understanding SDOResultSet Scrolling Modes” section.
The rowId value is equivalent to the value returned by the 4GL ROWID function and the
SDOResultSet.getRowIdentity() method. For more information on ROWID, see theProgress
Programming Handbook, or the appropriate Progress DataServer Guide for any DataServer
accessed by the SmartDataObject. For more information on the
SDOResultSet.getRowIdentity() method, see the “Miscellaneous Management Methods”
section.
SYNTAX
String getRowIdentity()
Gets the row ID of the first row to be fetched from the created and opened SDOResultSet.
SYNTAX
Sets the number of rows the scrolling mechanism fetches each time it accesses the AppServer.
The default is 200 rows.
6–10
Using SmartDataObjects From Java Clients
SYNTAX
int getFetchSize()
Gets the number of rows the scrolling mechanism fetches each time it accesses the AppServer.
SYNTAX
Sets the Stateless mode for the SDOResultSet. Specify state as true for a Stateless
SDOResultSet and false for a nonStateless SDOResultSet. For more information on the
Stateless mode of SDOResultSet, see the “Understanding SDOResultSet Stateless Mode”
section.
SYNTAX
boolean getStateless()
Gets the Stateless mode for the SDOResultSet. For more information on the Stateless mode
of SDOResultSet, see the “Understanding SDOResultSet Stateless Mode” section.
SYNTAX
Sets the scrolling mode for the SDOResultSet specified as a class constant in
com.progress.open4gl.SDOScrollingMode. If the SDOResultSet is Stateless, the default is
SDOScrollingMode.PREFETCH. Otherwise, the default is SDOScrollingMode.KEEP_ROWS. The
other supported scrolling mode is SDOScrollingMode.FORWARD_ONLY. For more information on
these scrolling modes, see the “Understanding SDOResultSet Scrolling Modes” section.
6–11
Progress Open Client Developer’s Guide
SYNTAX
SDOScrollingMode getScrollingMode()
Gets the scrolling mode specified for the SDOResultSet, returned as a class
constant in com.progress.open4gl.SDOScrollingMode. For more information on
SDOResultSet scrolling modes, see the “Understanding SDOResultSet Scrolling
Modes” section.
SYNTAX
Sets the maximum number of rows to be fetched when the scrolling mode is
SDOScrollingMode.PREFETCH. The setPrefetchMaxRows() method has no effect for scrolling
modes other than SDOScrollingMode.PREFETCH. The default for this mode is to get all the rows
of the SDOResultSet. For more information on using this method, see the “Understanding
SDOResultSet Scrolling Modes” and “Understanding SDOResultSet Stateless Mode” sections.
SYNTAX
int getPrefetchMaxRows( )
Gets the value for the maximum number of rows to be fetched when the scrolling mode is
SDOScrollingMode.PREFETCH. For more information on using this method, see the
“Understanding SDOResultSet Scrolling Modes” and “Understanding SDOResultSet Stateless
Mode” sections.
6–12
Using SmartDataObjects From Java Clients
(For more information, see the information on visibility of updates in the “Updating
SDOResultSet Objects” section.) The size of the result set is known from the beginning
and does not change until the result set is closed or the query is reopened. Also, navigation
in this mode is guaranteed to be fast since all the rows are in memory. This mode is ideal
for small result sets in combination with slow networks.
NOTE: If you are accessing a large result set, you might want to use the
setPrefetchMaxRows() method to limit the number of rows that you fetch.
Otherwise, your Java application can run with an excessively long response time
and large memory consumption. This can be a special problem for applications
accessing Stateless SDOResultSets, which are always in the PREFETCH
scrolling mode. For more information, see the “Understanding SDOResultSet
Stateless Mode” section.
6–13
Progress Open Client Developer’s Guide
NOTE: Although the most useful application of Stateless mode is with a stateless
AppServer, the Stateless mode for SDOResultSet is orthogonal to the operating
mode of the AppServer. The client can set the SDOResultSet to Stateless mode
even if the AppServer is not running in stateless operating mode. The client can also
create a nonStateless SDOResultSet to access a stateless AppServer.
An SDOResultSet is in Stateless mode if setStateless(true) is called on the
SDOParameters that the application passes to the _createSDOResultSet() class factory
method.
The SDOResultSet Stateless mode has the following limitations:
• Only batch updates are allowed. For more information, see the “Using Batch Mode
[Extension]” section.
• Stateless mode is only allowed with the PREFETCH scrolling mode. For more information,
see the “Understanding SDOResultSet Scrolling Modes” section.
As with any SDOResultSet opened in PREFETCH mode, Stateless mode causes the
SDOResultSet to return all of its rows to the client application at one time. This can pose
performance problems for excessively large result sets. To manage an SDOResultSet created in
PREFETCH mode, you can explicitly set the maximum number of rows fetched for a query by
using the SDOParameters.setPrefetchMaxRows() method. Typically, you use this method
together with the SDOResultSet.reOpenQuery(String rowId) method to limit the number of
rows fetched for any one query and to fetch the next set of rows for a different instance of the
query. (For more information on the reOpenQuery(String rowId) method, see the
“Miscellaneous Management Methods” section.) Thus:
6–14
Using SmartDataObjects From Java Clients
The following block of Java code uses these two methods to manage the fetching of rows for a
Stateless SDOResultSet:
{
// The code shows the fetching of 19 rows in two batches under
// the Stateless mode.
params.setPrefetchMaxRows(10);
com.progress.open4gl.SDOResultSet rSet =
appObj._createSDOResultSet("CustSDO.w",null,null,params);
String lastRowid = null;
while (rSet.next())
{
System.out.println(
rSet.getObject(1)) + " " +
rSet.getObject(2) + " " +
rSet.getObject(3));
lastRowid = rSet.getRowIdentity();
}
The code sets the maximum number of rows to fetch to 10 and creates the Stateless
SDOResultSet, rSet, to access the SmartDataObject, CustSDO.w. It then fetches the rows,
maintaining the last-fetched row ID in lastRowid. Finally, it uses lastRowid to reopen the
query and fetch the next 10 rows.
6–15
Progress Open Client Developer’s Guide
Note that because you must use the last-fetched row ID as the starting point, this causes the same
row to be returned as the first row in the next query. The code thus uses the next() method to
skip the already-visited row, and fetches the next nine (9) rows that have not yet been fetched,
for a total of 10 returned for the query.
• Metadata Methods
In the following sections, [Extension] appears after the listed syntax for methods that are
SDOResultSet extensions to JDBC 2. If an entire section describes methods that are all
SDOResultSet extensions, [Extension] appears after the section title also.
To apply some of these extensions you must pass parameters to the SDOResultSet factory
method (_createSDOResult()) that creates the SDOResultSet object.
6–16
Using SmartDataObjects From Java Clients
Thus, before calling a method that requires an AppServer connection, you must attach the
SDOResultSet to the same or a different AppObject that has a connection to the AppServer. The
methods that provide this functionality include:
SYNTAX
SYNTAX
SYNTAX
6–17
Progress Open Client Developer’s Guide
Following is a typical scenario for using the detaching and attaching functionality:
1. The SDOResultSet is created. Because the scrolling mode is PREFETCH, all the rows are
read and returned to the client.
4. The client accesses data and possibly calls startBatch() and updates some data.
SYNTAX
boolean previous()
SYNTAX
boolean next()
SYNTAX
boolean first()
6–18
Using SmartDataObjects From Java Clients
SYNTAX
void beforeFirst()
SYNTAX
boolean last()
SYNTAX
void afterLast()
SYNTAX
boolean absolute(int n)
Positions) the cursor on the n-th row. A negative number positions the cursor relative to the end
of the SDOResultSet. The index (n) is 1-based.
SYNTAX
boolean relative(int n)
SYNTAX
boolean isAfterLast()
SYNTAX
boolean isBeforeFirst()
6–19
Progress Open Client Developer’s Guide
SYNTAX
boolean isFirst()
SYNTAX
boolean isLast()
SYNTAX
int getRow()
6–20
Using SmartDataObjects From Java Clients
Some java.util.Date and java.sql.Date methods are being deprecated by JavaSoft in favor
of using the more robust java.util.GregorianCalendar. These are the methods that get
column values for instances of this class:
For more information on the mapping between 4GL and Java data types, see the sections on
Progress/Java data type mapping for TEMP–TABLE fields and passing OUTPUT
TEMP–TABLE parameters in Chapter 5, “Programming Java Clients.”
1 ♦ Make a change locally in the client application. For example, update column values in an
existing row or create a new row (moveToInsertRow()).
2 ♦ Commit the local changes to the database (through the remote SmartDataObject) by
executing a row method, such as updateRow() or insertRow().
CAUTION: If you move the cursor from a row where you have updated columns (for example,
using next()) but before you have committed the column updates to the database,
your column updates to that row will be lost.
6–21
Progress Open Client Developer’s Guide
6–22
Using SmartDataObjects From Java Clients
Some java.util.Date and java.sql.Date methods are being deprecated by JavaSoft in favor
of using the more robust java.util.GregorianCalendar. These are the methods that update
column values with instances of this class:
For more information on the mapping between 4GL and Java data types, see the sections on
Progress/Java data type mapping for TEMP–TABLE fields and passing INPUT TEMP–TABLE
parameters in Chapter 5, “Programming Java Clients.”
SYNTAX
void moveToInsertRow()
6–23
Progress Open Client Developer’s Guide
SYNTAX
void moveToCurrentRow()
Moves the cursor from the insert row back to the current position.
SYNTAX
void insertRow()
SYNTAX
void deleteRow()
Deletes the row in the current position and sends the delete request to the AppServer.
SYNTAX
void updateRow()
SYNTAX
void CancelRowUpdates()
Cancels the updates by rolling back the effects of all method calls that updated column values.
To cancel these updates, you must invoke this method before any call to updateRow() or
insertRow().
SYNTAX
boolean rowInserted()
Returns true if the cursor is positioned on an inserted row position and the row is not yet sent
to the AppServer.
6–24
Using SmartDataObjects From Java Clients
SYNTAX
boolean rowDeleted()
Returns true if the cursor is positioned on a deleted row, whether or not the deletion is sent to
the AppServer because it does not make sense to allow the user to manipulate a row that is
logically deleted.
NOTE: The only time the row is not also physically deleted on the AppServer is if you
are using a batch update. For more information, see the “Using Batch Mode
[Extension]” section.
SYNTAX
boolean rowUpdated()
Returns true if the cursor is positioned on a row that is modified but not yet sent to the
AppServer.
6–25
Progress Open Client Developer’s Guide
• If your application requires user feedback for each update method applied, you generally
must complete a transaction for each update method and Batch mode is not appropriate.
• If your application requires that a group of updates be applied and succeed together, you
must group the updates into a single large transaction. You can do this by using an
automatic transaction or by using Batch mode. For information on automatic transactions,
see the Building Distributed Applications Using the Progress AppServer manual.
• If your application has the option of applying several updates individually or as a group,
you can generally increase performance dramatically by grouping the updates into a single
large transaction using Batch mode.
• If your SDOResultSet is in Stateless mode, you can only apply modifications under
Batch mode.
SYNTAX
Starts a batch session. All the modifications (column updates, deletions and insertions) are
maintained locally. Calling this method if you have already called it and have not called
sendBatch() or cancelBatch() throws an Exception.
SYNTAX
SYNTAX
Sends the current batch to the AppServer, then reopens the result set. In Stateless mode, this
method is more efficient than separately calling sendBatch() and reOpenQuery(). For more
information, see the “Visibility of Updates” section.
6–26
Using SmartDataObjects From Java Clients
SYNTAX
SYNTAX
Returns true if the SDOResultSet object is in Batch mode (that is, you have called
startBatch() and have not yet called sendBatch() or sendBatchandReopen()).
NOTE: A row that is updated or deleted in Batch mode, and has not yet been sent to the
AppServer (using sendBatch()), cannot be refreshed using refreshRow(). Also,
to save your changes locally in batch mode, you must still call the row update
methods (for example, insertRow() or updateRow()) even though, in this mode,
your changes are not sent to the AppServer.
Visibility of Updates
The visibility, from within the Open Client, of an update to the SDOResultSet object depends
on whether the update is applied by:
• An external application working on the same data source that feeds the SDOResultSet
The following rules determine the visibility of updates initiated by the Open Client:
• Row Inserts — New rows are invisible until the result set is reopened.
Updates by external applications can typically occur on the data source that feeds the
SDOResultSet. You can make any such updates visible to the Open Client application by calling
reOpenQuery(), which refreshes all the data in the SDOResultSet. However, if you do not call
reOpenQuery(), the following rules determine the visibility of updates from external
applications:
6–27
Progress Open Client Developer’s Guide
• Row Inserts — Row inserts are not visible in PREFETCH mode. In other scrolling modes,
the visibility is determined by a combination of the underlying implementation of
SmartDataObject and the 4GL query. The guideline is that the application should not
make any assumptions unless it makes an explicit call to reOpenQuery().
• Row Deletion — Row deletions are not visible in PREFETCH scrolling mode. In other
scrolling modes, the visibility is determined by a combination of the underlying
implementation of the SmartDataObject and the 4GL query. The guideline is that the
application should not make any assumptions unless it makes an explicit call to
refreshRow() or reOpenQuery(). In these cases, the specific row deletion or all the row
deletions become visible, respectively.
SYNTAX
void close()
Closes the SDOResultSet and releases the underlying SmartDataObject. Any local
modifications that have not been sent to the AppServer are lost when this method is called.
SYNTAX
SDOResultSetMetaData getMetaData()
SYNTAX
void refreshRow()
Gets the latest version of the current row from the database.
6–28
Using SmartDataObjects From Java Clients
SYNTAX
boolean wasNull()
Indicates if the last fetched value from a getDatatype() method equal to the 4GL unknown
value (?).
This method is especially useful for methods that return a primitive data type, as in this example
where SDOResults is an SDOResultSet:
int cValue;
cValue = SDOResults.getInt("QUANTITY");
if (SDOResults.wasNull())
return(-1);
Because a primitive data type cannot hold the null value (the Java object equivalent to the 4GL
unknown value (?)), wasNull() provides the equivalent for the int value returned by getInt().
In this example, the method fragment returns the value –1 for a 4GL unknown value (?) because
valid integer values for the QUANTITY column must be positive.
SYNTAX
SYNTAX
int getFetchSize()
Returns the size (in number of rows) of the buffer the underlying implementation uses to fetch
rows from the AppServer.
6–29
Progress Open Client Developer’s Guide
SYNTAX
Reopens the SmartDataObject query and positions the cursor before the first row. This method
refreshes all the data in the SDOResultSet, makes all of the newly inserted rows visible, and
removes all of the deleted rows. Any local modifications that you have not sent to the AppServer
before you call this method are lost.
SYNTAX
Works like reOpenQuery(), but the first row returned is the one specified by rowId. A null
rowId is equivalent to reOpenQuery(). It is usually more efficient to call reOpenQuery(String
rowId) than to call reOpenQuery(), then call absolute(String rowId) in order to reposition
on the specified row.
NOTE: If the SDOResultSet is in SDOScrollingMode.PREFETCH mode, you cannot get the
rows before this rowId. For more information on SDOScrollingMode.PREFETCH, see
the “Understanding SDOResultSet Scrolling Modes” section.
SYNTAX
Gets the string representation of the ROWID value for the current row that can be used as input
to reOpenQuery(String rowId), absolute(String rowId), and
SDOParameters.setRowIdentity(String rowId).
SYNTAX
SYNTAX
6–30
Using SmartDataObjects From Java Clients
SYNTAX
Provides direct access to the underlying 4GL methods of the SmartDataObject that are efficient
for remote SmartDataObject access. The returned SDOInterface is a ProcObject that includes
all of the relevant public methods provided by the SmartDataObject. Thus, you have full access
to these SmartDataObject features without any limit imposed by the SDOResultSet interface. If
the SDOResultSet is Stateless, calling getSDOInterface() creates a remote
SmartDataObject procedure that you can delete only by calling releaseSDOInterface().
Calling releaseSDOInterface() on a nonStateless SDOResultSet has no effect. The actual
SmartDataObject methods supported through SDOInterface include:
• serverSendRows
• serverCommit
• initializeObject
• setQueryWhere
• getQueryWhere
• setQuerySort
• openQuery
• closeQuery
• columnProps
• fetchMessages
• getUpdatableColumns
• addQueryWhere
• assignQuerySelection
• getTables
• getObjectVersion
• batchServices
For more information on these SmartDataObject methods, see the Progress ADM 2 Guide and
the Progress ADM 2 Reference.
6–31
Progress Open Client Developer’s Guide
NOTE: A typical application does not require access to the SDOInterface directly. Direct
access to SmartDataObject methods requires expert knowledge of SmartDataObject
internals. In some cases, mixing direct calls to the SmartDataObject with calls
through the SDOResultSet interface can leave the SDOResultSet in an unexpected
state. Thus, use the SDOInterface directly only after carefully analyzing the
alternatives.
SYNTAX
SYNTAX
int getColumnCount()
SYNTAX
6–32
Using SmartDataObjects From Java Clients
SYNTAX
SYNTAX
0 if this column is mandatory (does not allow the 4GL unknown value (?)); 1 if it is not
mandatory (allows the 4GL unknown value (?)).
SYNTAX
SYNTAX
SYNTAX
The table name for this column. This is especially useful where you want to determine the
original table for a column participating in a table join.
SYNTAX
SYNTAX
6–33
Progress Open Client Developer’s Guide
SYNTAX
• Methods that expose metadata information that exists in the schema of the Progress
database but does not have an equivalent standard (for example, the
getColumnInitialValue() method).
SYNTAX
SYNTAX
SYNTAX
6–34
Using SmartDataObjects From Java Clients
SYNTAX
SYNTAX
The 4GL data type number. The return value corresponds to one of the class constants defined
in com.progress.open4gl.Parameter. For more information, see Chapter 5, “Programming
Java Clients.”
SYNTAX
6.6 Multi-threading
You cannot access a single SDOResultSet from more than one thread at a time. The results of
concurrent access to a single SDOResultSet by more than one thread are undetermined.
1. Errors that are caused by a bug in the application (such as an attempt to position the cursor
at a negative row number). This type of error causes a java.sql.Exception to be thrown,
with different messages for different errors.
2. Errors that can occur during an otherwise normal session (such as an update failure due to
a concurrency control collision on the AppServer). This type of error causes a specific
SDOResultSet Exception to be thrown that allows you to handle the error
programmatically.
This section describes the SDOResultSet Exception hierarchy and typical errors by method
category.
6–35
Progress Open Client Developer’s Guide
The following Exceptions from this hierarchy allow you to handle normal program conditions:
• DeletedRowAccessException
An attempt to access a deleted row generates this Exception. To prevent this Exception,
the application can use the boolean rowDeleted() method before trying to access a row.
• SDOModificationException
This Exception is thrown when the back-end SmartDataObject fails to insert a new row,
update an existing row, or delete an existing row. If the row operation is one of many in a
larger transaction, each update, insert, or delete failure causes a message to be added to a
list of messages held by the thrown SDOModificationException You can access all of the
error information provided by SDOModificationException using the following methods:
SYNTAX
String getFields()
Returns the list of fields (if any) related to this error message.
6–36
Using SmartDataObjects From Java Clients
SYNTAX
String getTable()
Returns the name of the table (if any) related to this error message.
SYNTAX
String getText()
SYNTAX
void nextMessage()
For more information on the SDOModificationException class and its methods, see the
SDOModificationException.html file in Progress-Install-Directory\java\doc\.
• Navigation Methods —The typical errors in this category include attempts to navigate to
rows that do not exist. If the row has been deleted, this error throws the
DeletedRowAccessException.
• Insert, Delete, and Update Row Methods — The typical errors in this category include:
– Concurrency control errors (the row was updated by another user, for example)
– Validation errors (the update was rejected by some AppServer validation routine)
– Trying to update a row while the cursor is not in an appropriate position (for
example, calling insertRow() while the cursor is not in an insert row position)
6–37
Progress Open Client Developer’s Guide
• Get and Update Column Value Methods — The typical errors in this category include:
– Trying to convert a value to the wrong data type (for example, trying to get an integer
column using a getDate() method)
– Trying to update a column with the wrong data type (for example, trying to set a date
object to an integer column)
– Trying to get or set data when the cursor does not point to a valid row
• Metadata Methods —The typical errors in this category occur when trying to get
metadata information about a column that does not exist.
• There is no 4GL business logic (such as 4GL triggers) that must be used.
• Higher than JDBC 1 level of access is required. SDOResultSet, which is based on JDBC 2,
is easier to use and does not require knowledge of SQL.
Progress-Install-Directory\src\samples\open4gl\SDO
6–38
7
Programming ActiveX Controller Clients
For the ActiveX client, ProxyGen generates a proxy as a set of ActiveX Automation objects to
access Progress AppServer functionality. The proxy follows COM conventions for method
names, data type mapping, and error handling. ProxyGen also generates a Type Library that
shows the methods available for the AppObject, each related SubAppObject, and each related
ProcObject that defines the proxy.
The default language used in this chapter to illustrate ActiveX client programming is Visual
Basic (VB), with additional references to C++. However, any ActiveX Controller can act as an
ActiveX client to the Progress AppServer.
The sections in this chapter describe:
• Connecting To an AppServer
• Handling Errors
Note the naming conventions shown in Table 7–1, where AppObject-name is the name of an
AppObject specified in ProxyGen.
AppObject CAppObject-name
SubAppObject CAO_AppObject-name
ProcObject CPO_AppObject-name
For more information on, proxy naming conventions, see Chapter 3, “Generating and Managing
Proxies.”
7–2
Programming ActiveX Controller Clients
• Change the AppObject name (Name field of the AppObject tab in the ProxyGen main
window).
• Change the package name (Package field in the Generate/Preferences dialog boxes) so
Package.AppObject-name is a new, unique value.
• Change the Prog ID directly (Prog ID field in the Generate/Preferences dialog boxes)
7–3
Progress Open Client Developer’s Guide
SYNTAX
Sub OC_Connect
( [ url As String ] ,
[ userId As String ] ,
[ Password As String ] ,
[ appServerInfo As String ]
)
The url parameter specifies the AppServer connection information. The userId, Password,
and appServerInfo parameters specify any information required by the AppServer application
at connection time. For more information on how to specify these parameters, see the
information on connecting to an AppServer in Chapter 4, “Programming Concepts.”
CHARACTER String
COM-HANDLE Long
DATE1 Double
DECIMAL Double
INTEGER Long
LOGICAL Boolean
7–4
Programming ActiveX Controller Clients
RECID Long
TABLE-HANDLE ProTempTable
TEMP-TABLE ProTempTable
WIDGET-HANDLE Long
1
Dates earlier than July 1, 1600 do not pass accurately between ActiveX open clients and the Progress AppServer.
The date gains or loses several days when passed in either direction.
NOTE: Open Clients do not support the Progress BUFFER data type.
7–5
Progress Open Client Developer’s Guide
• Convert the string value “12” to the integer value 12 before passing it to the Automation
object as the parameter value.
Some Automation objects do not do automatic conversions. Therefore to avoid errors, use of the
data types specified in Table 7–2 is recommended.
NOTE: There can be other unexpected behavior exhibited by an Automation controller. In
some versions of VB, for example, if a Variant, converted to a specific data type
(such as CStr(Var)), is passed as an output parameter, VB treats the parameter like
a String constant and does not alert you that the result is unsuitable as an output
parameter. Thus, it runs the method, but does not store the output value in the
Variant.
7–6
Programming ActiveX Controller Clients
Whatever mechanism you use, the proxy determines what kind of object you are passing and
calls the appropriate methods to access it.
NOTE: This section also applies to the input side of input/output TEMP-TABLE parameters.
The following sections provide information about:
If you do not have access to ADO technology, and the input data resides in a local database,
using a DAO Recordset is your best alternative. Otherwise, you must use the
IClientTempTable interface.
The source object (the DAO, ADO, or IClientTempTable object) is not passed directly as a
parameter. Instead, the client application creates a ProTempTable object and sets its DataSource
property to one of these source objects.
The implementation of an Automation object that supports the IClientTempTable interface can
obtain the data in whatever way is necessary. For example, it might read the data from an
ActiveX Grid control, obtain it from an array variable or load it from of a file. You can find an
example of how to implement this interface installed with the Open Client Runtime and located
in the directory: Progress-Install-Directory\src\samples\open4gl\IClientTempTable.
7–7
Progress Open Client Developer’s Guide
SYNTAX
Changes the current record to the next row of the Recordset. The current record is initialized to
the record before the first record of the set. Therefore, the first time MoveNext() is called it
moves to the first record. moreRecs is an output parameter that is set to FALSE when the end of
the Recordset is reached.
NOTE: Make sure the result set cursor is positioned before the first row if you plan to pass
the InputResultSet as an input parameter, and you want the receiving context to have
access to all rows from the beginning of the TEMP-TABLE. Only rows after the
current cursor position are passed to the AppServer.
SYNTAX
Gets the value for the column specified with fldIndex,a 1-based index. This must map to the
order in which the fields are defined in the 4GL TEMP-TABLE. For input, a 4GL array field is
viewed as a flattened set of columns (see Chapter 4, “Programming Concepts”). This is
generally convenient in VB because the likely data sources for input Recordsets (such as, grids,
arrays, or Access databases) do not themselves support array fields.
7–8
Programming ActiveX Controller Clients
Call rs.AddNew("AcctNum", 1)
Call rs.Update("Amount", 1000.11)
Call rs.Update("StartDate", 10 / 26 / 53)
Call rs.AddNew("AcctNum", 2)
Call rs.Update("Amount", 2000.22)
Call rs.Update("StartDate", 1 / 1 / 2000)
7–9
Progress Open Client Developer’s Guide
ProTT.DataSource = RecSet
‘ The proxy calls back through the DAO RecSet to get the input data
Call objAcct.SetDirectDeposit (ProTT)
ProTT.DataSource = VBTT
‘ The proxy calls back through VBTT to get the input data
Call objAcct.SetDirectDeposit (ProTT)
7–10
Programming ActiveX Controller Clients
If the data source is a standard DAO or ADO object, the proxy can obtain the metadata
automatically. When the proxy needs the schema information, it asks the DAO or ADO
object for it. The DAO or ADO data types obtained from these objects map to Progress
data types as shown in Table 7–3 and Table 7–4. Any data type not specified is
unsupported.
LOGICAL dbBoolean
DATE dbDate
7–11
Progress Open Client Developer’s Guide
LOGICAL adBoolean
This methodology does not support array fields. If the application requires that the
resulting server-side TEMP–TABLE have an array field, the application code must
provide a mapping between the flattened set of DAO/ADO fields and the array fields of
the TEMP–TABLE. You can do this by calling a ProTempTable method as follows:
SYNTAX
Identifies the array where startFld is the 1-based index of the field in the DAO/ADO
object (based on the flattened field model) and len is the length of the array.
You must call this method after the DataSource is specified and before the proxy method
call. You must call the method once for each array field that exists in the TEMP–TABLE.
For example, if the TEMP–TABLE has the following schema, you would call the method
twice:
7–12
Programming ActiveX Controller Clients
This new interface contains four properties that can return the metadata for the input
TABLE-HANDLE:
FieldCount as Integer
Name (fldIndex as Integer) as String
Type (fldIndex as Integer) as Integer
Extent (fldIndex as Integer) as Integer
The FldIndex is the 1-based index of the field as defined by the array model.
The proxy requests the FieldCount, then the Name, Type and Extent for each field before
it sends its request to the AppServer. As with TEMP–TABLE data, the metadata
information can be obtained in whatever way the application requires.
If the input result set is an updated version of a result set that was first obtained from the
AppServer through an OUTPUT parameter, the schema obtained on output can be passed
in as the schema for the input table. This schema is available from the CFields and CField
objects associated with CProTempTable. You can think of this as an OUTPUT–INPUT
TABLE-HANDLE parameter even though it is output from one method call and input
through another. This is accomplished by calling another new ProTempTable method:
SYNTAX
UseFieldsForMetaData(Object fields)
fields
A CFields object that was obtained from a CProTempTable object. If a null object is
passed, this setting is cleared, and some other source of metadata must be supplied.
7–13
Progress Open Client Developer’s Guide
This method must be called after the DataSource is specified and before the proxy method
call is made. Also, you must make this call even if the CProTempTable object is the same
instance that was used for the original output parameter and from which the CFields
object is obtained.
• CProTempTable Object
• CFields Object
• CField Object
CProTempTable Object
The CProTempTable object provides the following methods and properties for getting output
data:
SYNTAX
Close()
Closes the Recordset (used for output parameters only). Invoke this method if you want to close
the Recordset before reading all of the rows.
NOTE: Until you read all rows or invoke this method for the output Recordset, you can call
no other Open Client proxy method. For more information, see the sections on
streaming in Chapter 4, “Programming Concepts.”
SYNTAX
Variant GetRow()
7–14
Programming ActiveX Controller Clients
Returns a Variant that contains a Variant Array with one Variant for each field of the current
row. Only one row can be returned at a time. If the TEMP-TABLE contains an array field, it is
flattened such that each element is returned as another Variant in the array. You can only call
this method once for each row. Unlike the similar DAO or ADO method, after the data is
returned, the Recordset cursor is not automatically moved to the next row, and you must call
MoveNext() to move to the next row.
SYNTAX
Boolean MoveNext()
Changes the current record to the next row of the TEMP-TABLE. If MoveNext() has not been
called before, it assumes we are at the beginning of the set and MoveNext() moves to the first
record. It returns false when there are no more rows.
NOTE: If the parameter is a TABLE-HANDLE, the value returned can be unknown or
undefined. In this case, calling MoveNext() returns an error.
SYNTAX
CFields Fields
A collection object that holds a set of CField objects, where each CField object provides access
to the data and metadata of a field in the TEMP-TABLE. This property is read-only.
SYNTAX
Object DataSource
For an input TEMP-TABLE parameter, a property that you can set to an ADO, DAO, or
IClientTempTable object from which a proxy can obtain the data. For an output
TEMP-TABLE parameter, this property is ignored.
7–15
Progress Open Client Developer’s Guide
CFields Object
The CFields object provides the following methods and properties:
SYNTAX
Returns a CField object for the specified field. The index parameter can either be a number or
a string. If it is a number, it represents the 1-based field index which must correctly map to the
order in which the fields are defined in the 4GL TEMP-TABLE. Otherwise, it must be the
field’s name.
This method uses the Progress array model to access result set columns. For more information
on the array model and flat model, see Chapter 4, “Programming Concepts.”
If you specify the name for an array field, specify the simple name without any array element
reference. For example, specify Months, not Months[1].
This is the default method for the object.
SYNTAX
short Count
The number of fields in the TEMP-TABLE (including array fields). Each array field counts as
one because it is based on the Progress array model.
CField Object
The CField object provides the following methods and properties:
SYNTAX
The value of the field returned as a Variant. If the field is a scalar value, index can be 0, 1 or
left out. If the field is an array, index is a 1-based index into the array.
7–16
Programming ActiveX Controller Clients
Depending on your version of Visual Basic, if you access Value() indirectly without first
setting a CField object, you must provide a value for index. Otherwise, as in this example
(where proTT is a CProTempTable object), VB returns a run-time error indicating that there are
an invalid number of parameters:
x = proTT.Fields.Item(1).Value
x = proTT.Fields.Item(1).Value(0)
You can also access Value() directly on a CField object with or without an index in VB, again
without error:
You can invoke this method only once on the same CField object, and you must obtain each
field value in order. For more information, see the section on output result sets in Chapter 4,
“Programming Concepts.” This is the default method for the object.
NOTE: The limitation allowing you to call Value() only once per field might cause errors
when debugging your VB application. For example, if you hold your mouse cursor
over the call to the Value() method in order to display the value, in tooltip fashion,
this causes an error if the code has already been executed. In a similar manner, an
error results if you enter field.Value() in the watch window twice.
SYNTAX
String Name
SYNTAX
short Type
Data type of the field. A set of constants accessible from VB are defined as part of
ProTempTableLib called ProDataTypeConstants. Table 7–5 lists the constants and their values.
7–17
Progress Open Client Developer’s Guide
ProDataTypeConstants Values
ProChar 1
ProDate 2
ProLogical 3
ProInteger 4
ProDecimal 5
ProRecid 7
ProRaw 8
ProWidgetHandle 10
ProRowid 13
ProComHandle 14
SYNTAX
integer Extent
7–18
Programming ActiveX Controller Clients
Call objAcct.GetDirectDeposit(ProTT)
7–19
Progress Open Client Developer’s Guide
SYNTAX
Sends all trace messages equal or greater than the value specified with level to the file specified
with fileName. If filename is not specified, the output is Standard Error. The lower the value
for level, the greater the information. If the level is not specified, the value equals 2.
SYNTAX
traceOnDefaultLevel(String filename)
Sends trace information to the file specified with filename. If no file is specified, the output is
Standard Error.
7–20
Programming ActiveX Controller Clients
SYNTAX
traceoff()
SYNTAX
Boolean isTracing()
Returns TRUE if tracing is turned on. Returns FALSE if tracing is turned off.
NOTE: For ActiveX clients, tracing information is always written to a file.
SYNTAX
setWaitIfBusy()
Waits until all currently executing AppServer requests are complete before executing this
request.
SYNTAX
setNoWaitIfBusy()
Do not wait for a currently executing AppServer request to finish. Instead throw an exception
for any AppServer request that is made while the AppServer is executing another request.
SYNTAX
Boolean getWaitIfBusy()
Checks the thread control setting to determine if WaitIfBusy state is set or cleared. Returns
TRUE if setWaitIfBusy()is called and FALSE if setNoWaitIfBusy() is called.
7–21
Progress Open Client Developer’s Guide
SYNTAX
ProxyHost As String
The Proxy Web server host. This value can be a string with either the DNS name of the Proxy
Web server or its dot-formatted IP address.
SYNTAX
ProxyPort As Integer
The Proxy server port. This value can be an integer from 1 to 65536.
SYNTAX
ProxyUserID As String
The user Id needed to authenticate the Proxy server. This value can be string of up to 512
printable ASCIII characters.
SYNTAX
ProxyPassword As String
The password needed to authenticate the Proxy server. This value can be a string of up to 512
printable ASCII characters.
7–22
Programming ActiveX Controller Clients
SYNTAX
CertificateStore As String
Specifies the files that contain the Root Digital Certificates. If more than one directory, file, or
both is specified, they must be separated by semicolons.
SYNTAX
NoHostVerify As Boolean
Controls Domain Name checking. FALSE enables Domain Name checking. TRUE disables
Domain Name checking. The default value is TRUE (on).
7–23
Progress Open Client Developer’s Guide
0x80040206 Output result set error, for example, trying to get a column
(-2147220986 decimal) value out of column order or trying to make an illegal type
conversion
7–24
Programming ActiveX Controller Clients
AccountInfo.p
/* AccountInfo.p Procedure */
DEFINE INPUT PARAM account-num AS INTEGER.
PROCEDURE getPaymentsInfo:
END PROCEDURE.
7–25
Progress Open Client Developer’s Guide
fromDate = #1/10/98#
Set payeeList = New VBTempTable
Set payees = New CProTempTable
payees.DataSource = payeeList
Set payments = New CProTempTable
’ Make the call
Call info.getPaymentsInfo(fromDate, payees, paymentsNum, payments)
numCols = payments.Fields.Count
moreRecords = payments.MoveNext
While moreRecords
ColumnData = payments.GetRow
For i = 0 To numCols - 1
MsgBox columnData(i)
Next i
moreRecords = payments.MoveNext
Wend
7–26
Programming ActiveX Controller Clients
7–27
Progress Open Client Developer’s Guide
7–28
8
Special Considerations For Java Applets
The Open Client can support Java applets, by using an HTML page to distribute the appropriate
files. However, there are a number of factors you must consider, including:
• The Open Client applet obtains the HTTP Basic authentication and Proxy Web server
information from the end user and then passes the information to the Open Client.
However, you cannot rely on the browser to provide the user interaction. Your applet must
perform this task. You might also have to access to the Proxy Web server configuration
information from the browse. In this case, the applet also needs to obtain the Proxy Web
server information from the end user.
• An Open Client applets can run on both a company intranet and the Internet. As a result,
you need to sign your Java code with a Digital Certificate and your applet must get
permission to perform a network connection.
1 ♦ Down load the security classes for Microsoft by putting the security classes on your
CLASSPATH and adding the following import statement to your applet code:
import com.ms.security.*;
NOTE: The Microsoft security classes are not available as a standalone package. You can
get these security classes by downloading the latest Microsoft Java SDK from
www.microsoft.com.
2 ♦ Insert the following code into your applet just before creating your Java proxy AppObject:
8–2
Special Considerations For Java Applets
This code searches for the class com.ms.security.PolicyEngine. When found, the code
calls the static method assertPermission asking for NETIO permission. This method
verifies that the user selected yes in the security dialog box when the applet was
downloaded. If yes was selected, the user can connect to the AppServer.
NOTE: With the Microsoft, a user is prompted only once when the code is first
downloaded.
If you use HTTPS, you might also need to obtain file IO privileges from the Microsoft VM
security system in order to read the files containing the Root Digital Certificates. If this is
the case, add the following line to your code after the line of code that request NETIO
privileges:
PolicyEngine.assertPermission(PermissionID.FILEIO);
Permissions are only valid for a particular method call and that is why you should insert
this code right before you construct your Java proxy AppObject. For instance, if you put
this code in its own method, you would no longer have the permission when your method
returns. For more information on Microsoft's trust based security model, see the Microsoft
SDK for Java documentation.
1 ♦ Download Netscape’s Object Signing Tools and the Capabilities API Classes from the
Netscape Web Site.
2 ♦ Put the Capabilities API classes in your CLASSPATH and add the following import
statement in your applet
import netscape.security.PrivilegeManager;
8–3
Progress Open Client Developer’s Guide
3 ♦ Insert the following code into your applet just before creating your Java proxy AppObject:
try
{
if (Class.forName("netscape.security.PrivilegeManager") != null)
{
try
{
PrivilegeManager.enablePrivilege("UniversalConnect");
}
catch(Exception ex)
{
System.out.println("Netscape threw exception: " +
ex.toString());
}
}
}
catch(ClassNotFoundException e)
{
System.out.println("Netscape Security Manager not found");
When you use the Netscape security model, the user is prompted for the specific
permission each time you call the enablePrivilege method. If a user gives your applets
the requested permission, the Java proxy is instantiated. For more information on the
Netscape permission based security model, see the Netscape Web site.
8–4
Special Considerations For Java Applets
import com.ms.security.*;
import netscape.security.PrivilegeManager;
try
{
// Assert Net IO privileges
System.out.println("Checking for Internet Explorer Security Manager");
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.NETIO);
}
catch(ClassNotFoundException e)
{
System.out.println("IE Security Manager not found");
}
try
{
System.out.println("Checking for Netscape Security Manager");
if (Class.forName("netscape.security.PrivilegeManager") != null)
{
try
{
PrivilegeManager.enablePrivilege("UniversalConnect");
}
catch(Exception ex)
{
System.out.println("Netscape threw exception: " +
ex.toString());
}
}
}
catch(ClassNotFoundException e)
{
System.out.println("Netscape Security Manager not found");
}
8–5
Progress Open Client Developer’s Guide
• The fully qualified DNS address and port (usually port 80) of the Web server for the
AppServer Internet Adapter (AIA)
When using HTTPS in your Open Client applet, you might also need an additional Java
permission to read the Root Digital Certificate files in order to validate the identity of the Web
server for the AIA. If this is the case, you must add file read permissions that provide full read
ability. The following shows the entry:
The Java permissions should be placed in the Java 2 policy file Grant blocks. One permission
grants access to only your Open Client applet code and the other permission grants access to
only the Open Client Runtime.
8–6
Special Considerations For Java Applets
The following shows some sample code for these permission grants:
In this sample:
• The o4glrthsl.jar runtime and Root Digital Certificates are located in the
applicationhost Web server’s aia/jar path.
• The Open Client applet is located in the applicationhost Web server’s aia/applets path.
1 ♦ Generate your Java proxy. For more information, see Chapter 3, “Generating and
Managing Proxies.”
2 ♦ Code your applet. For more information, see Chapter 5, “Programming Java Clients.”
3 ♦ Create a .cab file for Internet Explorer browsers and a .jar file for Netscape browsers for
the Java applet code and proxy you created that includes a digital signature to download
the applet. For instructions about completing these tasks, see the Microsoft SDK for Java
and the Netscape Object Signing Tools documentation.
In order to sign your code, you need a code signing certificate. While both tools allow you
to create a test digital certificate, you need a real digital certificate to distribute your
application. If you distribute your application over the Internet, you usually get a digital
certificate from a public PKI provider such as VeriSign. If you distribute your application
on a company intranet, you can set up a Digital Certificate Server and create your own
certificates.
8–7
Progress Open Client Developer’s Guide
The steps for setting up and operating your own Certificate Server are not covered in this
document. However, you can get information about this tasks from the Microsoft or
Netscape Web sites.
NOTE: Although both Microsoft and Netscape use a standard digital certificate format,
the disk storage formats used in the respective signing tools are not interoperable.
As a result, you must get separate digital certificates if you want to support both
Microsoft and Netscape browsers.
4 ♦ Progress provides the Open Client Runtime packages in digitally signed .cab and .jar
files so that you can distribute these directly without additional work.
These.cab and.jar files are located in the Java directory under your Progress installation
directory and have file names that begin with o4glrt.
For more information about which of these files to choose for your Java applet see the
“Selecting an Open Client Runtime Package” section in Chapter 2, “Configuration and
Deployment.”
When you embed an Open Client Runtime package in a Web page, a verification dialog
box automatically opens when a user accesses the page. The user has the option of
accepting or not accepting the installation of the Open Client Runtime. If the user does not
accept, the Open Client is not installed and your Open Client applet cannot be run.
• Navigator
• Supporting Both Internet Explorer and Navigator With the Same Page
8–8
Special Considerations For Java Applets
Each of the Open Client Runtime.cab files has its own unique class ID. This allows your
application to change the types of network protocols it uses dynamically the next time the Web
page is run. The version number is supplied by Progress in the o4glrt.cab file's
open4glrt??.inf file and changes from release to release.
Once the .cab file is downloaded, a dialog box opens advising the user that this code needs to
be trusted, and that it is signed by Progress Software Corporation. If the user selects OK, the
.zip file is installed in their Windows/Java/TrustedLib directory, and all required registry keys
are added or updated.
8–9
Progress Open Client Developer’s Guide
The above tag also dynamically adds the.zip file to the TrustedClassPath. This entry is
volatile, and if the user restarts Internet Explorer, the.zip file is no longer included in its
CLASSPATH. Therefore, any time you have a Web page that uses the Open Client Runtime,
you should include that OBJECT tag. Once the code is installed, there is no further action
required by the user based on that OBJECT tag, even if they restart Internet Explorer. Since the
run time is installed on the TrustedClassPath, only trusted code can access it. Since you need
to be trusted to open a connection to a Progress server, you are required to package your applet
and proxies into a signed .cab file. Once you have done this, you can add an applet tag like the
following example:
The code attribute specifies your applet's class name that must be contained in the.cab file
specified with the cabbase PARAM. The value of the cabbase PARAM should point to the.cab
file's path that contains the applet and proxy on the distribution Web server.
Internet Explorer looks for the cabbase, and if it finds it, downloads the specified.cab file.
Since this is a signed .cab file, a dialog box opens and displays information from your code
signing certificate. Your Java code is saved in Internet Explorer's volatile cache. So, if the user
restarts the Internet Explorer, your.cab file is downloaded again.
8.3.2 Navigator
When adding your applet to a Web page for Navigator, you must consider the following:
• The earlier Navigator browsers did not support downloading and installing Java libraries.
Therefore, every time a user accesses the Web page for the first time in a session, the
applet, proxy, and the Open Client Runtime packages are downloaded.
• Navigator versions prior to 4.05 did not allow an applet to support multiple.jar files. If
you need to support a version of Navigator prior to 4.05, you must repackage everything
into a single.jar file and sign it.
For Navigator version 4.05 or later, you can use the following applet tag to embed your applet
in a Web page:
<applet code="AppletTest.class"
codebase="/cabs" name="AppletTest" width="320" height="240"
archive="apptest.jar,o4glrt.jar">
</applet>
8–10
Special Considerations For Java Applets
In the above example, the applet code and proxies are in the signed.jar file apptest.jar and
the Open Client Runtime package is in the.jar file o4glrt.jar. When Navigator encounters
this tag, it downloads both.jar files. When your applet requests UniversalConnection
privileges, a dialog box opens and prompts your user to grant the privilege.
<OBJECT CLASSID="CLSID:E79DA910-15D0-11d2-B591-00C04FD4A860"
CODEBASE="/cabs/o4glrt.cab#Version=9,0,1066,0"> <applet
code="AppletTest.class"
codebase="/cabs" name="AppletTest" width="320" height="240"
archive="apptest.jar,o4glrt.jar">
<PARAM NAME=cabbase VALUE=/cabs/apptest.cab> </applet>
When using the code in this example, you should be aware of the following issues that arise for
the difference browsers:
• Navigator ignores the OBJECT tag and the cabbase PARAM because it does not support
them.
• Internet Explorer supports the OBJECT tag and the cabbase PARAM and looks for
classes in the.cab file specified in the cabbase PARAM of the OBJECT tag before using
the.jar files specified in the applet tag's archive attribute.
• Internet Explorer does not support Netscape's code signing technology, as a result, any
code found in.jar files is untrusted and limits the servers to which the browser can
connect.
• Navigator does not support.cab files, and as a result, ignores the cabbase PARAM.
Therefore, you need to specify both.cab and.jar files.
For more information about supporting both Internet Explorer and Navigator with the same
Web page, see the Microsoft Knowledge Base article Q179652.
8–11
Progress Open Client Developer’s Guide
8–12
A
Accessing a SmartDataObject API Directly
You can directly access the complete 4GL API (including custom extensions) for any remote
Progress SmartDataObject from an Open Client application, where the SmartDataObject is
running in distributed mode on an AppServer. Use this direct access technique only if you need
to access SmartDataObjects from an ActiveX Open Client application or if you need to access
custom extensions to the default SmartDataObject API that have been provided by a 4GL
programmer. If you want to access only the default API generated by the Progress AppBuilder
and access it only from a Java Open Client application, use the Java SDOResultSet interface
provided by the Open Client Toolkit, instead. For more information on SDOResultSet, see
Chapter 6, “Using SmartDataObjects From Java Clients.” The following section describes how
to access the SmartDataObject API directly.
Progress Open Client Developer’s Guide
1 ♦ In the AppObject tab, check Allow Unknown for parameters and function return values.
2 ♦ In the Customize Persistent Procedure dialog box, check Use AppObject Unknown
Setting.
For more information on defining ProcObjects in ProxyGen, see Chapter 3, “Generating and
Managing Proxies.”
A–2
B
Certificate Management Utility
If your Open Client application uses HTTPS (SSL), you must provide digital certificates with
the application. Progress ships a small set of Root Digital Certificates with the Open Client
Toolkit.
Most likely, there will be times when you need to manage digital certificates. For example:
• You might want to use a digital certificate from a CA not included with the set from
Progress.
• A digital certificate expires, and you need to replace it with a newer version.
• You might want to create your own set of certificates using just those certificates you
know your application will use.
The certificate files included with the Open Client Toolkit are stored in .zip and .jar files
called Certificate Store files. For more information about digital certificates and the .zip and
.jar files, see Chapter 2, “Configuration and Deployment.”
Each Certificate Store file holds a number of individual Root Digital Certificates and contains
one digital certificate list (.dclfile) that lists all the certificate files stored in the file. The
individual certificates come in one of the following formats:
• DER — These file types have extensions of .cer and .crt. There is no difference between
and .crt files. One file stores one binary certificate.
.cer
• PEM —These file types have extensions of .pem, .txt and .0. There is no difference
between .pem, .txt and .0 files. One file stores one or more certificates.
Progress Open Client Developer’s Guide
To help you manage digital certificates, Progress provides the Certificate Management Tool
(procertm). The procertm tool runs on Windows platforms only and lets you import, export,
and remove certificates to and from.jar and.zip files. You can also use this tool to convert
digital certificates file formats.
. The following sections provide information about:
SYNTAX
cert_store
Path to the .zip or .jar certificate store file. If the certificate store file does not exist, and
you are importing Digital Certificates, a new file is created.
cert
When importing, the path is relative path to the working directory. When exporting or
removing Digital Certificates from the cert_store file, the path is the full Digital
Certificate path as specified in the cert_store file. Subdirectories should be specified
with the forward slash "/".
You can use "*" and "?" wildcards in the file-name and file-extension for the cert value.
B–2
Certificate Management Utility
• -v — Prints verbose information about the progress of the digital certificates import and
export. When used with the -l (Lists) option, additional Digital Certificate field
information is printed.
• -l — Lists the contents of the cert_store file after all import, export, and remove
operations are completed.
• -p — Prints the digital certificate list the cert_store contents to the file cert_store.dcl
after all of the import, export and remove operations have been completed.
• -i cert — Imports certificate file(s) matching cert to the cert_store file from the
working directory. The cert_store file is created as required. This option can be
specified multiple times.
• -e cert — Exports the certificate file(s) matching cert from the cert_store file to the
working directory. Any sub-directories are created if required. This option can be
specified multiple times.
• -r cert— Removes the certificate file(s) matching cert from the cert_store file. You
can specify this option multiple times.
• -d — Sets the working directory path where certificates are imported from or exported to.
The default working directory is the current working directory.
NOTE: The procertm utility supports a limited use of wildcard characters for the cert value
in the import, export, and remove options.
You can specify any number of options in any order. When you run procertm, it performs the
options in the following order:
1. Imports any certificates specified with the -i option from the working directory into the
cert_store file. If a certificate is not found, a warning message displays.
2. Exports any certificates specified with the -e option from the cert_store to the working
directory. If a certificate is not found, a warning message displays.
3. Removes any certificates specified with the -r option from the cert_store file. If a
certificate is not found, a warning message displays.
B–3
Progress Open Client Developer’s Guide
SYNTAX
in_cert
out_cert
The file format to which you want to convert the digital certificate.
The file utility performs the conversion based on the file-extension type. For example, if
in_cert has a file extension type of .crt and out_cert has a file extension type of .pem,
in_cert is converted from the .der to .pem format and written to the file out_cert.
B–4
Index
Index–2
Index
Index–3
Progress Open Client Developer’s Guide
G getFieldCount( ) method
ProResultSetMetaData interface 5–22
Generating
getFieldExtent( ) method
ActiveX proxies 2–8
ProResultSetMetaData interface 5–22
Java proxies
GUI ProxyGen 2–6, 2–7 getFieldJavaTypeName( ) method
Open Client proxies 2–6 ProResultSetMetaData interface 5–22
Generating proxies 3–14 getFieldName( ) method
Generation rules 3–23 ProResultSetMetaData interface 5–22
getFieldProType( ) method
geQuery( ) method, SDOResultSet 6–30
ProResultSetMetaData interface 5–22
geRow( ) method, SDOResultSet 6–20
getFields( ) method,
getColumnCount( ) method, SDOModificationException 6–36
SDOResultSetMetaData 6–32
getFieldTypeName( ) method
getColumnDisplaySize( ) method, ProResultSetMetaData interface 5–22
Index–4
Index
getObject ( ) method H
ProResultSet interface 5–18
Help
getObject( ) method
Progress messages 1–xxiii
InputResultSet class 5–11
ProResultSet interface 5–16, 5–17 Hierarchy of proxy objects 1–7
getPrefetchMaxRows( ) method, Holder classes 5–4
SDOParameters 6–12 super class definition 5–4
type-specific
_getProcReturnString() method. See
definitions 5–6
Getting the procedure return value mappings 5–5
GetRow( ) method HRESULT values 7–23
CProTempTable object 7–15
HTTP
getRowIdentity( ) method, SDOParameters Open Client Runtime packages 2–2
6–10
HTTP protocol
getRowIdentity( ) method, SDOResultSet connecting an AppServer 4–5
6–30 using password option 4–5
using with clients 4–5
getScrollingMode( ) method,
SDOParameters 6–12 HTTPS 4–5
getTableName( ) method,
SDOResultSetMetaData 6–33 I
getText( ) method, IClientTempTable example 7–10
SDOModificationException 6–37
IClientTempTable interface 7–7
Getting started with ProxyGen 3–2
IDLE state
Getting the connection ID 4–12 connection 5–31
INPUT-OUTPUT parameters
Index–5
Progress Open Client Developer’s Guide
Italic typeface
M
as typographical convention 1–xv
Manual
Item( ) method syntax notation 1–xvi
CFields object 7–16
Manual, organization of 1–xiv
Messages
J displaying descriptions 1–xxiii
Java applications, building with Metadata for Java output ResultSets 5–19
SmartDataObjects 6–7
Methods
Java client programming 5–1 Class Factory 4–11
4GL data type mapping Common 4–12
Index–6
Index
Open Client
N applications
building and running 1–3
Name property requirements 2–11
CField object 7–17 AppServer connections 4–2
architecture 1–2
NameServer deployment requirements
connecting to an AppServer 4–3 ActiveX 2–14
connecting to an AppServer. 4–4 Java 2–13
Java applets 5–37
Naming conventions object model 1–5
automatic conversions 3–20 programming 4–2
proxy object 3–18 supported applications 2–3
restrictions and side effects 3–21 supported protocols 2–3
next ( ) method types 1–3
SDOResultSet 6–18 Open Client application
next( ) method specifying an AppServer connection 4–2
InputResultSet class 5–11 Open Client proxies
Index–7
Progress Open Client Developer’s Guide
P Progress SmartDataObjects
direct API access A–1
Parameter passing in Open Clients 4–22 Progress unknown value. See Unknown
Persistent procedures value (?)
adding and deleting in ProxyGen 3–9 Project
definition 1–6 file
ppObject definition 3–5
SmartDataObject access in Java 6–5 saving 3–14
proxy directory 3–15
Preferences work directory 3–14
ProxyGen 3–15
PROPATH
specifying a file to save 3–28
AppObjects and SubAppObjects 3–8
PRO_* data type constants 5–21
ProResultSet interface
Procedure files definition 5–7
adding and deleting 3–9 extension methods 5–17
methods 3–11 getObject ( ) method 5–18
standard methods 5–16
Procedures using 5–16
examples of 1–xx
ProResultSetMetaData interface 5–19
ProcObject extension methods 5–21, 5–22
components 4–19 standard ResultSetMetaData methods
customizing 3–11 5–20
Index–8
Index
Index–9
Progress Open Client Developer’s Guide
Index–10
Index
Index–11
Progress Open Client Developer’s Guide
Index–12