J2EE[tm] Blueprints > Java[tm] Pet Store Administrator > Running the StarOffice demo

Running the StarOffice demo

The StarOffice demo illustrates how to import data from the Java Pet Store Administrator—using XML over HTTP—into a StarOffice spreadsheet. This document describes how to set up the demo.


Note: These instructions use $JPS_HOME (UNIX) and %JPS_HOME% (Win32) to denote the root directory of the J2EE Blueprints bundle.

Before you begin

Before running this demo, make sure the following items are installed on your system:

The following table lists the shorthand forms used to denote the root installation directories of the first two items:

  UNIX Win32
StarOffice $STAROFFICE_HOME %STAROFFICE_HOME%
StarOffice SDK $STAROFFICE_SDK_HOME %STAROFFICE_SDK_HOME%

Configuring StarOffice

  1. Replace the file sandbox.jar that comes with StarOffice with the one that comes with the StarOffice SDK.

  2. Add the following line to the [Common] section of $SOFFICE_HOME/user/sofficerc (UNIX) or %SOFFICE_HOME%\user\soffice.ini (Win32):

    Connection=socket,host=localhost,port=8100;iiop;
  3. Open the file $SOFFICE_HOME/user/config/javarc (UNIX) or %SOFFICE_HOME%\user\config\java.ini (Win32).

    Make sure that the SystemClassPath entry in the [Java] section of the file includes the full paths to the JAR files sandbox.jar, jurt.jar and unoil.jar:

      Full paths of JARs
    UNIX $SOFFICE_HOME/program/classes/sandbox.jar
    $SOFFICE_HOME/program/classes/jurt.jar
    $SOFFICE_HOME/program/classes/unoil.jar
    Win32 %SOFFICE_HOME%\program\classes\sandbox.jar
    %SOFFICE_HOME%\program\classes\jurt.jar
    %SOFFICE_HOME%\program\classes\unoil.jar

    Also make sure that the UserClassPath entry in the [Java] section of the file includes $JPS_HOME (UNIX) or %JPS_HOME% (Win32), or create this entry if it doesn't exist. For example, if %JPS_HOME% is c:\jps1.1.2, then you would add this line:

    UserClassPath=c:\jps1.1.2

Compiling the demo

  1. Add the full paths to the JAR files sandbox.jar, jurt.jar and unoil.jar to your CLASSPATH environment variable. These are listed in the following table:

      Full paths of JARs
    UNIX $SOFFICE_HOME/program/classes/sandbox.jar
    $SOFFICE_HOME/program/classes/jurt.jar
    $SOFFICE_HOME/program/classes/unoil.jar
    Win32 %SOFFICE_HOME%\program\classes\sandbox.jar
    %SOFFICE_HOME%\program\classes\jurt.jar
    %SOFFICE_HOME%\program\classes\unoil.jar

    Also make sure that the current working directory, denoted by a dot ("."), is part of your CLASSPATH.

  2. Bring up a shell or command prompt, change the current directory to $JPS_HOME/src/petstoreadmin/staroffice/ (UNIX) or %JPS_HOME%\src\petstoreadmin\staroffice\ (Win32) and execute the following command to compile the demo:

  3. javac PendingOrders.java

Running the demo

  1. Deploy the Java Pet Store and use it to order some pets.

  2. Deploy the Java Pet Store Administrator.

  3. Bring up a command or shell prompt, change the current directory to $STAROFFICE_HOME/program/ (UNIX) or %STAROFFICE_HOME%\program\ (Win32), and execute the following command to start StarOffice:

    soffice

  4. Bring up a shell or command prompt, change the current directory to $JPS_HOME/src/petstoreadmin/staroffice/ (UNIX) or %JPS_HOME%\src\petstoreadmin\staroffice\ (Win32) and execute the following command to start the demo:

    java PendingOrders localhost 8000

    The program will get the pending orders for the Java Pet Store and display their details in a StarOffice spreadsheet.


    Note: These instructions assume that the Java Pet Store and Java Pet Store Administrator are deployed on a machine named localhost and port 8000. You should substitute localhost and 8000 with the name of the machine and the port on which these applications are deployed.

Copyright © 2001 Sun Microsystems, Inc. All Rights Reserved.