Programmer's Guide



Chapter 34   Deploying and Distributing Applications

This chapter describes how to put your SilverStream application into production by deploying the server and client objects you've developed. You'll learn about the deployment tasks needed to:

Publishing to a production database   Top of page

While building and testing an application, you typically work on a development version of your application's SilverStream database. When the application is complete, you need to copy the appropriate objects from that development database to a production version of it. This process is called publishing.

Basics of publishing   Top of page

SilverStream provides a couple of ways to publish. You can use:

Either way you publish, you can:

Publishing SilverStream objects   Top of page

Publishing lets you copy forms, views, business objects, pages, and media. If the destination database has objects with the same name and type as those being copied, publishing overwrites those objects. For example, publishing a page named pgOrder overwrites the existing pgOrder page in the destination database.

For first-time publishing, you should publish all referenced objects. For example, if one of your forms references an image, make sure you publish that image too. For subsequent modifications, you can simply publish new or changed objects.

Publishing database tables   Top of page

When you ask to publish tables, SilverStream modifies the schema of the destination database to incorporate all of the tables from the source database (you can't select individual tables to publish). It tries to synchronize the destination database with the source database by:

Publishing tables does not copy table data or elements that the SilverStream Designer can't build. For example, it doesn't copy indexes or stored procedures from the source database to the destination database. Also, you must manage any database inconsistencies (such as data type and auto-increment support) across database platforms.

The synchronization process doesn't affect existing components of the destination database. For example, if the destination database contains tables unknown to the source database, the unknown tables are retained. This also applies to columns.

Handling table publishing errors

If you get an error while publishing tables, the destination database might be left in a state that is not fully in synch with the source database. That's because SQL DDL actions are not atomic. The publishing process issues all DDL changes and caches any errors until all DDL actions are attempted.

The SilverStream Management Console (SMC) provides a schema synchronization facility that you can use in this situation to clean up certain aspects of the destination database. (Note however that this facility does not roll back any tables already created by a failed publishing process.)

    For details on synchronizing database schema with the SMC, see the chapter on database configuration in the Administrator's Guide.

Considerations when publishing   Top of page

This section provides information about specific issues you may encounter when publishing.

Publishing across server versions

You can publish only among SilverStream servers of the same major version. For example, you can publish from a Version 3.x server to another Version 3.x server, but not to a Version 2.x server.

Setting security for the published database

Publishing does not copy permissions set in the development or test environments to the production environment. You need to set these permissions after publishing is complete.

    For details, see the chapter on setting security in the Administrator's Guide.

Defining users and groups for the published database

Publishing does not copy users and groups from the development or test environments to the production environment. You need to define any appropriate users and groups yourself.

    For details, see the chapter on setting up users and groups in the Administrator's Guide.

Maintaining valid references across SilverMaster databases

If your application references objects (such as images) from your local SilverMaster database, make sure the production SilverMaster has the same name. Otherwise, those references won't be valid once you publish to the production environment and you'll need to change them manually.

For example, if your development environment has a SilverMaster database named MySilverMaster, then the production environment should also have one named MySilverMaster.

Maintaining valid references across other databases

If your application references objects (such as subpages, subforms, or views) from another database in your development environment, make sure that database is also present in your production environment. Otherwise, those references won't be valid once you publish to production.

For example, suppose frmCust (a parent form) from database Mydb1 references frmOrder (a subform) from database Mydb2. If you publish frmCust to a database on your production server, Mydb2 will also have to be available on that server to enable the parent form to access the frmOrder subform.

In some cases, you might choose to avoid this database reference issue by publishing the child object to the parent's database and adjusting your application accordingly.

Publishing across database types

If you choose to publish across different database platforms (such as Adaptive Server Anywhere to Oracle), you may need to handle certain database incompatibilities yourself. For instance:

Deploying Enterprise JavaBeans   Top of page

If you've developed or acquired Enterprise JavaBeans (EJBs) for use in your applications, you'll need to deploy them into your production server environment. This involves:

  1. Publishing the appropriate EJB JAR files from your development database to a database on your production SilverStream server (the same way you publish other objects)

        For details, see Publishing to a production database.

  2. Deploying those EJB JAR files on that production server

        For details, see Deploying EJBs.

Deploying Enterprise Data Connectors   Top of page

If you access SilverStream Enterprise Data Connectors (EDCs) in your applications, you'll need to deploy them into your production server environment. The deployment steps to perform depend on the kind of EDC you're using:

Setting up SilverJRunner clients   Top of page

If your production environment includes SilverStream forms that you want to run in the context of a Java application (instead of in a browser), the client machines using those forms will need to install and use SilverJRunner. SilverJRunner is a low-administration Java client that hosts your forms with support for the full set of form features, as well as encryption and application file caching.

The following sections describe how to set up SilverJRunner clients, including:

Installing SilverJRunner   Top of page

SilverJRunner is self-updating, so you just need to install it once per client machine. To minimize administration effort, the SilverStream Server provides an installer that clients can download to set up the current version of SilverJRunner. It also provides a SilverJRunner install page that users can browse to for easy selection of the appropriate installer flavor (Windows, UNIX, or Linux).

Going to the SilverJRunner install page

By default, the SilverJRunner install page is available from your SilverStream server at the following URL:

  http://servername/SilverStream/Pages/SilverJRunner.html 

You can instruct users to type this URL directly in their browsers, or you can supply a page that links to it for easier access.

Using the install page

Once displayed, the SilverJRunner install page provides links that users can click to download:

This page also includes instructions for using the installers and for starting SilverJRunner once installed.

Customizing the install page

By default, the SilverJRunner install page is named SilverJRunner.html and stored in the SilverMaster database under Pages. You're free to customize this page as necessary to suit the requirements of your environment and user audience.

If you need to restrict access to the SilverJRunner installers, you can secure this page or even delete it from the server.

Providing direct access to the installers

You may want to let users download a SilverJRunner installer directly, without going to the SilverJRunner install page first. In that case, you can instruct them to type one of the following URLs, or you can link to it from your own pages. These URLs all begin with:

  http://servername/SilverStream/silverJRunnerInstall/

To link directly to

Use this URL

Windows version of the SilverJRunner installer

SilverJRunnerInstall.exe

UNIX (Solaris) version of the SilverJRunner installer

SilverJRunnerInstallSolaris.sh

Linux version of the SilverJRunner installer

SilverJRunnerInstallLinux.sh

Installing on Windows

Once you download the Windows version of the SilverJRunner installer, you'll have the following file on your local machine:

  SilverJRunnerInstall.exe 

Run this file to install SilverJRunner and the supporting components it requires.

What gets installed

When the installer is done, you'll have a directory for SilverJRunner on your local machine that contains:

SilverJRunner should now be ready to use on this machine.

Installing on UNIX or Linux

Once you download a UNIX or Linux version of the SilverJRunner installer, you'll have the following file on your local machine: SilverJRunnerInstallPlatform.sh. Run this file to install SilverJRunner and the supporting components it requires.

For example:

What gets installed

When the installer is done, you'll have a directory for SilverJRunner on your local machine that contains:

SilverJRunner should now be ready to use on this machine.

    For detailed information about UNIX or Linux platform support, see the SilverStream Release Notes.

Installing from your SilverStream product CD

Another way to install SilverJRunner is to use the SilverStream installation (Setup) program from your SilverStream product CD. It provides choices to install SilverJRunner (and supporting files) alone or along with other SilverStream components.

Installing SilverJRunner this way is primarily for developers. The result is the same as accessing the SilverJRunner install page (SilverJRunner.html) from the SilverStream Server to do the installation.

    For more information on using the SilverStream installation program, see these chapters in the Installation Guide:

Starting SilverJRunner   Top of page

You can start SilverJRunner in several different ways, depending on the platform you're using (Windows, UNIX, or Linux).

Running on Windows

In Windows, you can start SilverJRunner by doing either of the following:

Using the SilverJRunner executable

You can start SilverJRunner from the command prompt by invoking the executable program SilverJRunner.exe. Type:

  installdirectory\bin\SilverJRunner [options]  
     [protocol://]hostname[:port] databasename formname [appargs] 

where:

For this value

You specify

installdirectory

The root directory where SilverJRunner is installed on the client machine. For example:

  c:\SilverJRunner 

options

(Optional) Startup options for controlling the execution of SilverJRunner. Specify zero or more of these. For example:

  -ss_username=sam -ss_password=icecream 

    See Using startup options.

protocol

(Optional) One of the following HTTP protocols:

  • http:// (default)

  • https:// (for SSL connections)

hostname

The host name (or Internet address) of the SilverStream server to access. For example:

  corporate 

port

(Optional) The TCP/IP port number that server uses. For example:

  8080 

The default is 80.

databasename

The name of the SilverStream database containing the form (or view) to run. For example:

  sales 

formname

The name of the form (or view) to run. For example:

  frmMonthlyQuota 

appargs

(Optional) Application-specific arguments that you want to pass through to your form for processing. Specify zero or more of these. For example:

  myarg -myswitch -y 2001 

    See Passing application arguments.

For example:

  c:\SilverJRunner\bin\SilverJRunner  
     -ss_username=sam -ss_password=icecream  
     http://corporate:8080 sales frmMonthlyQuota  
     myarg -myswitch -y 2001 

If you don't want to type this command every time, you can create a batch (BAT) file to issue it.

Using SJR files

Another alternative to starting SilverJRunner from the command prompt is to use SJR files. SJRs are SilverJRunner application files in which you store all the arguments you'd otherwise type. Opening an SJR file automatically invokes the SilverJRunner executable SilverJRunner.exe and uses those arguments. (The association between the SJR file extension and SilverJRunner.exe is automatically set up in Windows when you install SilverJRunner.)

To create an SJR file:

  1. Open a new text file in an editor of your choice.

  2. Type the following on a single line:

      [options] [protocol://]hostname[:port] databasename formname  
         [appargs] 
    

    For example:

      -ss_username=sam -ss_password=icecream  
         http://corporate:8080 sales frmMonthlyQuota  
         myarg -myswitch -y 2001 
    
  3. Save this text file with the extension SJR. For example:

      quota.sjr 
    

Once you have an SJR file, you can:

Running on UNIX or Linux

In UNIX or Linux, you can start SilverJRunner by doing either of the following:

Using the SilverJRunner script

You can start SilverJRunner from the command prompt by invoking the executable script SilverJRunner. Type:

  installdirectory/bin/SilverJRunner [options]  
     [protocol://]hostname[:port] databasename formname [appargs] 

where:

For this value

You specify

installdirectory

The root directory where SilverJRunner is installed on the client machine. For example:

  /export/home/sam/SilverJRunner 

options

(Optional) Startup options for controlling the execution of SilverJRunner. Specify zero or more of these. For example:

  -ss_username=sam -ss_password=icecream 

    See Using startup options.

protocol

(Optional) One of the following HTTP protocols:

  • http:// (default)

  • https:// (for SSL connections)

hostname

The host name (or Internet address) of the SilverStream server to access. For example:

  corporate 

port

(Optional) The TCP/IP port number that server uses. For example:

  8888 

The default is 8080.

databasename

The name of the SilverStream database containing the form (or view) to run. For example:

  sales 

formname

The name of the form (or view) to run. For example:

  frmMonthlyQuota 

appargs

(Optional) Application-specific arguments that you want to pass through to your form for processing. Specify zero or more of these. For example:

  myarg -myswitch -y 2001 

    See Passing application arguments.

For example:

  /export/home/sam/SilverJRunner/bin/SilverJRunner  
     -ss_username=sam -ss_password=icecream  
     http://corporate:8888 sales frmMonthlyQuota  
     myarg -myswitch -y 2001 

If you prefer to work in the desktop environment, you can start the SilverJRunner script from your file manager or you can set up an icon to issue the entire command.

Executing the JRunner class yourself

When you invoke the SilverJRunner script, it sets some environment variables and executes the class com.sssw.jrunner.JRunner (from the SilverJRunner.zip file in your SilverJRunner lib directory). An alternative way to start SilverJRunner is to execute this class yourself, either from the command prompt or in your own script.

The recommended approach for doing this is to copy the statements from the SilverJRunner script and then modify them to fit your situation:

  #!/usr/bin/sh 
  # 
  # this script is generated by the SilverStream installation 
  # 
   
  SILVERSTREAMROOT="/export/home/sam/SilverJRunner" 
  JRE_HOME=$SILVERSTREAMROOT/jre ; export JRE_HOME 
  JBROKER_HOME=$SILVERSTREAMROOT/jbroker ; export JBROKER_HOME 
  PATH="$JRE_HOME/bin:$PATH" 
   
  $SILVERSTREAMROOT/jre/bin/java \ 
  -cp "$SILVERSTREAMROOT/lib/SilverJRunner.zip:$SILVERSTREAMROOT/lib/ejb.jar:$SILVERSTREAMROOT/lib/javax_trans.zip" \ 
  com.sssw.jrunner.JRunner \ 
  -ss_root="$SILVERSTREAMROOT" \ 
  -ss_noconsole \ 
          "$@" 

Note that:

Displaying a console window

Normally, SilverJRunner displays windows only for the forms (and views) that make up your application. But when necessary, you can force it to display a Java console window as well. The console enables you to see the System.out and System.err output from your application, which can be particularly useful if you need to debug a problem on the client.

Include the option -ss_showconsole when starting SilverJRunner if you want to display the console window.

    For details, see Using startup options below.

Coding forms to display the console

When developing a form in the SilverStream Form Designer, you can use the showConsole() method of the agGeneral instance variable (com.sssw.rt.form.PvHelperGeneral class) to display the Java console programmatically. In that case, you won't need the -ss_showconsole option when starting SilverJRunner.

Using the console version of SilverJRunner

The SilverStream development environment on Windows NT provides another way to display standard output and error messages from SilverJRunner. SilverJRunner_c.exe (in the SilverStream35\bin directory) is a console version of SilverJRunner that you can invoke instead of the usual end-user executable (SilverJRunner.exe). You can start it from the command prompt by typing:

  silverstream35directory\bin\SilverJRunner_c [options]  
     [protocol://]hostname[:port] databasename formname [appargs] 

For example:

  c:\SilverStream35\bin\SilverJRunner_c  
     -ss_username=sam -ss_password=icecream  
     http://corporate:8080 sales frmMonthlyQuota  
     myarg -myswitch -y 2001 

Any standard output and error messages from SilverJRunner then display in the command prompt window you're running from. An advantage of this approach is that you can see messages related to startup issues.

Using startup options   Top of page

There are two kinds of options you can provide when starting SilverJRunner:

Using - options

The following table describes the - options you can provide when starting SilverJRunner:

Option

Description

-ss_username=username

Specifies the username to use when logging in to a SilverStream server. For example:

  -ss_username=sam 

If you don't supply this option and user authentication is required, the application will display a dialog prompting for username and password.

-ss_password=password

Specifies the password to use when logging in to a SilverStream server. For example:

  -ss_password=icecream 

If you don't supply this option and user authentication is required, the application will display a dialog prompting for username and password.

-ss_proxy=proxyserver

Specifies a proxy server that you want SilverJRunner to use. Include the proxy server name and, optionally, its port number (the default is 80). Examples:

  -ss_proxy=corpproxy 
  -ss_proxy=corpproxy:8080 

Using SSL    To use SSL with a proxy server, simply specify the HTTPS protocol for your SilverStream server:

  SilverJRunner -ss_proxy=corpproxy 
     https://finance payroll frmSalary 

    To learn about configuring a SilverStream server for SSL, see the chapter on setting security in the Administrator's Guide.

-ss_showconsole

Displays a Java console window for the SilverJRunner session.

    For more information, see Displaying a console window.

-c cachesize

Specifies the size (in bytes) of the SilverJRunner disk cache. This cache is used to hold any downloaded JAR files needed to run a form (or view).

You can type the size in any of the following formats:

  -c 2000000 
  -c 2000K 
  -c 2M 

The default is 5M (usually enough for most applications).

-v

Required to run a view. This option tells SilverJRunner that the formname you've supplied is the name of a view.

If you omit -v, SilverJRunner won't find your view (because it will look for a form with that name).

-?

-h

-help

Displays usage information about SilverJRunner and how to start it.

Using + options

The following table describes the SilverStream + options you can provide when starting SilverJRunner in Windows:

Option

Description

+profile

Turns on profiling of SilverJRunner applications.

HotSpot troubleshooting    If you're running a version of the Sun HotSpot JVM that doesn't support the Java Virtual Machine Profiler Interface (JVMPI), you'll need to turn off HotSpot to do profiling. Specify the following additional option to turn off HotSpot and use the classic JVM instead:

  +classic 

    For more information, see the SilverStream Profiler chapter in the online Tools Guide.

+verbose:vmopts

Tells SilverJRunner to output only startup options to the console (if displayed), without all the other information generated in verbose mode.

You can also pass standard VM options directly to the Java interpreter by specifying them as + options. The + character is automatically converted to - as the option is passed.

For example, specifying:

  +verbose 

passes this option to the Java interpreter as:

  -verbose 

Passing application arguments   Top of page

When developing a form, you can code it to look for one or more application-specific arguments at runtime and then perform some processing based on those arguments. To help you do that, this section describes how to:

  1. Pass application arguments to a form when starting SilverJRunner

  2. Enable the form to access and use those arguments

Specifying the arguments to pass

When starting SilverJRunner, add any application arguments to the end of the command (after the name of the form to run). For instance, to pass the arguments -dollars and 2 to the frmRates form (in the service database on the custserv server), you specify:

  SilverJRunner custserv service frmRates -dollars 2 

Here are some additional rules to keep in mind:

    For more information on SilverJRunner command syntax, see Starting SilverJRunner.

Accessing the arguments

You can access the application arguments that SilverJRunner passes by coding the agGeneral.getArguments() method on your form. (agGeneral is a variable that's automatically included on your form to provide an instance of the PvHelperGeneral class from com.sssw.rt.form.) The getArguments() method returns a string array containing the passed application arguments.

For example, you might code the following for the form's formActivate event:

  // Get the arguments passed in from SilverJRunner 
  String[] passedArgs; 
  passedArgs = agGeneral.getArguments(); 
   
  // Check those arguments, then use them 
  if (passedArgs != null && passedArgs.length == 2) { 
    Field1.setText(passedArgs[0]); 
    Field2.setText(passedArgs[1]); 
  } 
  else { 
    agDialog.showMessage("Please supply exactly 2 args"); 
  } 

Setting up HTML clients that use forms or views   Top of page

NOTE   Including forms or views in pages is not supported in SilverStream Version 3.0 due to limitations of the Sun Java 1.2 browser plug-in. We hope to re-enable this support in SilverStream in the future. See the release notes for updated information.

If your application displays any pages that include SilverStream forms or views (or your own custom applets), you need to make sure all client machines have Java-enabled browsers installed. You must also make sure those browsers have an appropriate level of JVM (Java virtual machine) support, depending on how you've designed your pages:

If your pages

The browsers on your clients must

Use the Java 1.2 Plug-in to run forms and views

Download the Java 1.2 Plug-in from Sun (if not already present) and be able to support it. Your pages automatically link to the Sun Web site for this download.

The Java 1.2 Plug-in enables you to run Java 2 code (such as forms, views, or your own custom applets) inside browsers that have older JVMs. Browsers currently known to support the Java 1.2 Plug-in include Internet Explorer 4 or higher.

Run forms and views as applets (without the Java 1.2 Plug-in)

Support the Java 2 Runtime Environment (version 1.2 of the Java virtual machine).

For your own custom applets, the JVM requirement depends on the version you've coded them to.

    For more information, see Including Java forms and views in a page (in Programming Pages).

Setting up external Java clients   Top of page

If your application includes Java clients built outside of the SilverStream development environment, you'll need to set up each client machine with:

    For details, see Writing External Java Clients.

Configuring security   Top of page

Before launching the production use of your deployed application, you should review its security requirements. Then you can set security options in the SilverStream Management Console (SMC) to meet those requirements, ensuring the integrity of your application, the server, and the data sources they access.

    For details, see the chapter on setting security in the Administrator's Guide.

Tuning performance   Top of page

You can also use the SMC to adjust the performance of your SilverStream server and the applications you've deployed there. It enables you to monitor server activity, set performance options, and scale your production environment to meet demand.

    To find the performance tuning features you need, see the quick reference chapter in the Administrator's Guide.

Profiling performance

An additional performance tool you can use is the SilverStream Profiler. It enables you to study processes running on your server or clients to identify and analyze performance bottlenecks in your Java code.

    To learn about using this tool, see the SilverStream Profiler chapter in the online Tools Guide.






Copyright © 2000, SilverStream Software, Inc. All rights reserved.