Chapter 12 Calling Jaguar Component Methods from PowerDynamo
Setting up PowerDynamo as a client
For PowerDynamo to access Jaguar as a client,
the machine on which PowerDynamo is installed must be set up properly.
This setup depends on the type of calls that the Dynamo client will
be making to Jaguar:
Jaguar client software
To call Jaguar components from PowerDynamo,
you must install the client software (select Runtime), when installing
Jaguar.
Setting up PowerDynamo to use Jaguar components through ActiveX
To access a Jaguar component with ActiveX objects:
- Install Jaguar Manager on the Dynamo machine.
- Install the ActiveX Proxy Automation
Server using the Client Installation Program (JagClient.exe) on
the Dynamo machine.
- From Jaguar Manager, connect to the
Jaguar server that contains the required components.
- Generate TLB/REG files for
the package. This generates ActiveX proxy objects that you can then
use to create instances and invoke methods on remote Jaguar components.
- Register the package.
You are now ready to run the Dynamo application.
For detailed information on setting up an
ActiveX client, see the Jaguar Programmer's Guide.
Setting up PowerDynamo to use Jaguar components through Java
To create Java objects to access a Jaguar component:
- Install Jaguar Manager on the Dynamo machine.
- From Jaguar Manager, generate stubs
for the desired package using these options:
- generate stubs
- Java stubs
- JDK 1.1
- Ensure that the Java Code Base path
is in your class path.
- Compile the generated Java files
as instructed in the Jaguar Programmer's Guide.
- Configure Dynamo for Java support.
See "Configuring Dynamo to use
Java".
- Set your default Jaguar settings.
For information about the default Jaguar settings, see "Changing Dynamo
configuration settings".
Setting up PowerDynamo to use MASP
To set up Dynamo as a client machine to use
MASP method calls you need only to create a connection to the Jaguar
server.
For detailed information on accessing Jaguar
MASP methods, see the Jaguar Programmer's Guide.
There are two types of
connections that may be created to access Jaguar from PowerDynamo.
- Sybase System 11 ODBC data source connection
- Open Client connection
ActiveX and Java object calls
If you are creating instances of
either ActiveX or Java objects within a script and no MASP method
calls are involved, a connection to the Jaguar server as described
here is not required. For ActiveX objects, a connection is made through
the ActiveX proxy server that you install on your machine as explained in "Setting up PowerDynamo
as a client". For Java objects, a connection
is made through the Object Request Broker (ORB). See the Jaguar Programmer's
Guide for more information on ORBs.
Using an ODBC
data source to connect to Jaguar
To create an ODBC data source connection:
- Register Jaguar in the Dynamo machine's sql.ini file.
- Create an ODBC data source.
- Create a permanent user connection
to Jaguar. If you do not require connection pooling you can create
a temporary user connection instead of a permanent user connection.
To register Jaguar in the Sybase\sql.ini
file:
-
On the machine running Jaguar,
open <Jaguar CTS>\ini\sql.ini.
-
From the Jaguar machine, copy <Jaguar
CTS>\ini\sql.ini file to the Dynamo
machine; for example, Sybase\ini\sql.ini.
The file should look something like this. If
you have configured the Jaguar TDS listener to something other than
localhost, replace localhost with this value.
[Jaguar]
master=NLWNSCK,localhost,7878
query=NLWNSCK,localhost,7878
http=NLWNSCK,localhost,8080
iiop=NLWNSCK,localhost,9000
To create an ODBC data source for Jaguar:
-
Start the ODBC Administrator.
-
Click Add.
-
Select the Sybase System 11 driver and
click Finish.
-
On the General tab, enter an ODBC data
source name (for example, Jaguar_dsn), and a Server name
(for example, Jaguar).
-
Click OK to create the data source.
To create a permanent user connection to Jaguar:
-
Start the Jaguar server.
-
Use Sybase Central to connect to the
Dynamo Web site that contains the scripts requiring a connection
to Jaguar.
-
Open the Connection folder.
-
Click Add Connection.
-
Give the connection a name. Click Next.
-
Enter a description for the connection.
Click Next.
-
Select ODBC as the connection type. Click
Next.
-
Select the data source for the connection,
which is the name of the ODBC data source that you created in the
previous procedure. Click Next.
-
Enter a user ID for this connection.
The Jaguar samples use jagadmin as the user ID. Click Next.
-
Enter a password for this connection.
The Jaguar samples use a blank password. Click Next.
-
Click Finish.
Your permanent user connection should now be
visible from the connection folder in Sybase Central. To use this
connection for scripts that require a Jaguar connection, right-click
on the script, select Properties, and choose the new connection.
You can also do this at the folder level. If you set the connection
to at the folder level any scripts within that folder with a connection
type set to <inherited> will use the Jaguar connection
as their default connection.
You can also access the Jaguar connection using
the DynaScript method site.GetConnection or the
Dynamo SQL tag and attributes.
Using
an Open Client connection to connect to Jaguar
If an Open Client connection is required, you
must:
- Register Jaguar in the sql.ini file.
- Create a permanent user connection
to Jaguar.
To register Jaguar in the Sybase\sql.ini
file:
-
Open the sql.ini file
that resides in <Jaguar CTS>\ini\.
-
Copy the contents of the sql.ini file
to the sql.ini file on the Dynamo machine.
For example, Sybase\ini\sql.ini.
The content being copied should look something
like the following. If the Jaguar TDS listener has been configured
to something other than localhost, for example the machine name,
replace localhost with this value.
[Jaguar]
query=NLWNSCK,localhost,7878
To create a permanent user connection to Jaguar:
-
Start the Jaguar server.
-
Use Sybase Central to connect to the
Dynamo Web site containing the scripts that require a connection
to Jaguar.
-
Open the Connection folder.
-
Click Add Connection.
-
Give the connection a name. Click Next.
-
Enter a description for the connection.
Click Next.
-
Select Open Client as the type of connection
you want to create. Click Next.
-
Enter the Jaguar Server name. Click Next.
-
Leave the database name blank. Click
Next.
-
Enter a user ID for the connection. The
Jaguar sample uses jagadmin as a user ID. Click Next.
-
Enter a password for this connection.
The Jaguar samples use a blank password. Click Finish.
Your permanent user connection should now be
visible from the connection folder. To use this connection for scripts
that require a Jaguar connection, right-click on the script, select
Properties and choose the new connection. You can also do this at
the folder level. Any scripts in the folder you select that have
a connection type of <inherited> will use the
Jaguar connection as their default connection.
You can also access the Jaguar connection using
the DynaScript method site.GetConnection or the Dynamo SQL tag and
attributes.
Copyright © 1999 Sybase, Inc. All rights reserved.
|
|