## JSDAI Introduction

Last update: 2003-08-05

# Installation of JavaTM 2 SDK and JSDAITM for application development

Table of contents:

- Install JavaTM 2 SDK.

- System requirements.
- Java 2 SDK v1.4.x installation instructions.

- Automatic JSDAI installation.
- Manual installation instructions for JSDAI @JSDAI.VERSION.MAJOR@.@JSDAI.VERSION.MIDDLE@.@RUNTIME.VERSION.MINOR@.

- Copying files.
- Configuration of jsdai.properties file.
- Persistent SdaiRepositories.
- Classpath.

- Testing the installation of the core JSDAI.

- Starting the SdaiTerm application.
- SdaiTerm documentation and source.

- Developing programs.

## Install JavaTM 2 SDK

To develop and run JSDAI applications, Java 2 Software Development Kit needs to be installed on the target computer.

### System requirements:

- Java 2 Software Development Kit, Standard Edition: JSDK 1.3.1 or later (JSDK 1.4.1 recommended);

These packages can be downloaded from http://java.sun.com .

### Follow Java 2 SDK v1.4.x installation instructions:

- For the SolarisTM Operating Environment;
- For Microsoft Windows;
- For Linux.

## Automatic JSDAITM installation

JSDAITM and the JSDAI applications come with an automatic installation procedure.

- Start `jsdai354.exe` on a MS-Windows system
- Start `./jsdai354.bin` for any kind of UNIX system
- Start `java -cp jsdai354.zip install` on any other Java-enabled system

Follow the instructions on the screen to install JSDAI and JSDAI Applications.

Notes for MS Windows users: With the installation of JSDK, two copies of JRE are installed: one in JSDK directory, another in `c:\Program Files\JavaSoft\jre\1.4.1\` directory. Automatic JSDAITM installation procedures detect both copies of the JRE and suggest to install the programs in the JSDK runtime directory or JRE directory. For the software development JSDAI is to be installed in JSDK runtime directory. System `PATH` variable is to be changed in such a way, that the path to JSDK directory were the first one in the `PATH` variable.

Now JSDAITM is ready to run. You can try out by launching JSDAI Applications: `

- JSDAI_SdaiTerm
- JSDAI_SdaiEdit
- JSDAI_STEP-Book

` which are now installed in `LKSoft-JSDAI` directory.

## Manual installation instructions for JSDAI @JSDAI.VERSION.MAJOR@.@JSDAI.VERSION.MIDDLE@.@RUNTIME.VERSION.MINOR@

Only JSDAI kernel, constituting of JSDAI runtime and JSDAI environment can be installed manually. All applications such as SdaiEdit and STEP-Book can only be installed through the automatic installation procedure.
Before JSDAI installation, Java 2 SDK need to be installed on the target computer.

- ### Copying files

  For the manual installation of JSDAITM, the files provided in the `ext` directory of the installation CD ROM should be copied into the `ext` directory of Java 2 JSDK. The `ext` directory on the CD contains several `.jar` files and `jsdai.properties` file.

  JSDAI API consists of the following JSDAI jar-files:

  > `jsdai_runtime.jar` - file containing the basic JSDAI API code;
  > `jsdai_library.jar` - for all Integrated Resources, AICs and APs (STEP part 4x, 6x, 1xx, 2xx, 5xx, ARM only), also PLIB.

  The JSDAI EXPRESS compiler converts one or several EXPRESS schemas into the corresponding Java classes and interfaces. The EXPRESS compiler itself is not included into this release.

  The Java classes and interfaces which the EXPRESS compiler generates, needs to be further compiled into the Java byte code by using a default Java compiler. The resulting class-files are then packed into jar files. Because this is a lengthy and complicated process the work is already done for the EXPRESS schemas of the STEP standard. This can be done either for long form schemas or for short form schemas. In STEP, short form schemas have references to other schemas (use from, reference from). Long form schemas are created from the related short form schemas by resolving all the external references to other schemas into local objects. Traditionally, only the long form schemas are used. The advantage of the short form schemas is that they support AP interoperability. This means that application instances may belong to several AP populations simultaneously.

- ### Configuration of `jsdai.properties` file

  JSDAI configuration is set by the values of properties in `jsdai.properties` file of the `ext` directory. For an application to find schema entity instances the property `repositories` in `jsdai.properties` file should be adjusted accordingly, e.g.

  > `repositories=c:\\LKSoft-JSDAI\sdairepos` in Windows or
  > `repositories=/home/<user_directory>/LKSoft-JSDAI/sdairepos` for Unix systems.

  `repositories` is the only mandatory property, other properties are optional.

  Below is an example `jsdai.properties` file. It needs to be configured for a given installation as described above. Use a simple text editor to do this.

      #  properties file for JSDAI, LKSoftWare GmbH
      #
      # This properties file is loaded by jsdai.lang.SdaiSession class
      # during openSession().
      #
      # The jsdai.properties file is searched in the following order
      # 1) If system property "jsdai.properties" is set to some directory,
      #    jsdai.properties file is being searched in this directory
      # 2) otherwise, if system property "java.ext.dirs" is set to some directory,
      #     jsdai.properties file is being searched in this directory
      # 3) otherwise jsdai.properties file is being searched in the directory,
      #    specified by the system property "java.home".
      # If the file jsdai.properties cannot be located in any of these directories,
      # a SY_ERR exception is thrown during openSession().
      #
      # These properties are needed:
      #   repositories=directory-path
      #     specifies an existing directory for persistent data storage.
      #     For every SdaiRepository a subdirectory is created there
      #     Example:
      #      repositories=c:\\Program Files\\LKSoft-JSDAI\\sdairepos
      #
      # here goes the directory where repositories are located
      #
      repositories=/home/<user_directory>/LKSoft-JSDAI/sdairepos
      #
      #   Schema alias can be specified as follows:
      #   jsdai.SXxx=ALIAS[;ALIAS1] ... [;ALIASn]
      #     Example:
      #       jsdai.SAutomotive_design=AUTOMOTIVE_DESIGN;AUTOMOTIVE_DESIGN_CC2
      #
      # ALIAS[1...n] give the names of other EXPRESS schemas which are represented by
      #   this SdaiModel. Alternatively, each of these names may be an alias of the EXPRESS
      #   schema described by the model. Also, the model may represent a combination of
      #   two or more EXPRESS schemas.
      #
      # Aliases:
      #
      jsdai.SAutomotive_design=AUTOMOTIVE_DESIGN;AUTOMOTIVE_DESIGN_CC2
      #
      #   JSDAI trace log output. System.out - directs log output to the screen.
      #   Optionally log file name can be set.
      #log=System.out
      #
      # If the value of "toStringUnicode" is TRUE, then strings as values of
      # entity attributes are returned by toString methods in unicode;
      # if FALSE - in ASCII. This property is optional. (FALSE by default).
      #
      #toStringUnicode=FALSE
      #
      # Mapping of APs
      # mapping.schema.AIM_SCHEMA=MAPPING_DATA
      # If AIM schema is mapped to ARM schema then a dictionary model that contains
      #mapping data must be specified.
      # There can be several different mappings for one AIM schema and one mapping
      #model can specify mapping for several AIM schemas to one ARM schema.
      # Examples:
      #    mapping.schema.ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN=AP210_ARM_MAPPING_DATA
      #    mapping.schema.ELECTROTECHNICAL_DESIGN=AP212_ARM_MAPPING_DATA
      #    mapping.schema.AUTOMOTIVE_DESIGN=AP214_ARM_MAPPING_DATA
      #
      mapping.schema.ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN=AP210_ARM_MAPPING_DATA
      mapping.schema.ELECTROTECHNICAL_DESIGN=AP212_ARM_MAPPING_DATA
      mapping.schema.AUTOMOTIVE_DESIGN=AP214_ARM_MAPPING_DATA

- ### Persistent SdaiRepositories

  JSDAI uses the directory set by `repositories` property as persistent data storage. Every `SdaiRepository` is stored in its own sub-directory which includes several binary files.

  During the opening a JSDAI session, all repository sub-directories within the specified repositories directory are made available as "known servers". This repositories directory is also the default place where new repository directories are created.

  Create the directory with the full name as configured by `repositories` property in `jsdai.properties` file, where the persistent repositories files will be placed, e.g.

  > `c:\Program Files\LKSoft-JSDAI\sdairepos` in Windows or
  > `/home/<user_directory>/LKSoft-JSDAI/sdairepos` for Unix systems.

- ### Classpath

  The classpath variable assigns the class loader from where to load Java classes. It can specify either directories or jar-files where to find Java class-files. For the exact definition and usage of the classpath variable please refer to the Java documentation or these notes.

  The default class path is the current directory. In order to gain access to different directories, `CLASSPATH` variable or the `-classpath` command-line option should be used.

## Testing the installation of the core JSDAI

- ### Start the SdaiTerm application:

  > `java jsdai.util.SdaiTerm`.

  You will see a prompt `":"`
  Type `"?"` to see the list of available commands
  Type `"so"` to open a session
  Type `"si"` to see the version information
  Type `"q"` to quit

- ### SdaiTerm

  JSDAI comes with the SdaiTerm utility applications in the package `jsdai.util` included in the `jsdai_runtime.jar`.

  > jsdai.util.SdaiTerm: Documentation, Source

  It is the best to start this application after the installation has been finished to verify that all is installed correctly.

## Developing Programs

Assume on MS Windows system the automatic installation goes to the directory `c:\Program Files\LKSoft-JSDAI\`. Then you can:

- compile a Java program `xxx.java` using JSDAI with

  > `javac xxx.java`

- run the resulting `xxx.class` file with

  > `java xxx`

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. JSDAI is a trademark of LKSoftWare GmbH in Germany and other countries.

Copyright 1998-2003, LKSoftWare GmbH