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:

Note  

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:

  1. Install Jaguar Manager on the Dynamo machine.
  2. Install the ActiveX Proxy Automation Server using the Client Installation Program (JagClient.exe) on the Dynamo machine.
  3. From Jaguar Manager, connect to the Jaguar server that contains the required components.
  4. 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.
  5. 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:

  1. Install Jaguar Manager on the Dynamo machine.
  2. From Jaguar Manager, generate stubs for the desired package using these options:

  3. Ensure that the Java Code Base path is in your class path.
  4. Compile the generated Java files as instructed in the Jaguar Programmer's Guide.
  5. Configure Dynamo for Java support. See "Configuring Dynamo to use Java".
  6. 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.

Note  

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:

  1. Register Jaguar in the Dynamo machine's sql.ini file.
  2. Create an ODBC data source.
  3. 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.

Steps To register Jaguar in the Sybase\sql.ini file:

  1. On the machine running Jaguar, open <Jaguar CTS>\ini\sql.ini.

  2. 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

Steps To create an ODBC data source for Jaguar:

  1. Start the ODBC Administrator.

  2. Click Add.

  3. Select the Sybase System 11 driver and click Finish.

  4. On the General tab, enter an ODBC data source name (for example, Jaguar_dsn), and a Server name (for example, Jaguar).

  5. Click OK to create the data source.


Steps To create a permanent user connection to Jaguar:

  1. Start the Jaguar server.

  2. Use Sybase Central to connect to the Dynamo Web site that contains the scripts requiring a connection to Jaguar.

  3. Open the Connection folder.

  4. Click Add Connection.

  5. Give the connection a name. Click Next.

  6. Enter a description for the connection. Click Next.

  7. Select ODBC as the connection type. Click Next.

  8. 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.

  9. Enter a user ID for this connection. The Jaguar samples use jagadmin as the user ID. Click Next.

  10. Enter a password for this connection. The Jaguar samples use a blank password. Click Next.

  11. 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:

  1. Register Jaguar in the sql.ini file.
  2. Create a permanent user connection to Jaguar.

Steps To register Jaguar in the Sybase\sql.ini file:

  1. Open the sql.ini file that resides in <Jaguar CTS>\ini\.

  2. 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

Steps To create a permanent user connection to Jaguar:

  1. Start the Jaguar server.

  2. Use Sybase Central to connect to the Dynamo Web site containing the scripts that require a connection to Jaguar.

  3. Open the Connection folder.

  4. Click Add Connection.

  5. Give the connection a name. Click Next.

  6. Enter a description for the connection. Click Next.

  7. Select Open Client as the type of connection you want to create. Click Next.

  8. Enter the Jaguar Server name. Click Next.

  9. Leave the database name blank. Click Next.

  10. Enter a user ID for the connection. The Jaguar sample uses jagadmin as a user ID. Click Next.

  11. 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.