Standalone Install instructions

Installing COBOL Transformers Generator standalone

These instructions apply if you are installing from the coxbgen standalone distribution. If you are installing the complete LegStar distribution please refer to legstar distribution.

Alternatively, the COBOL Transformers generator can be installed as an Eclipse plugin which contains all the necessary components. More details on this option are available on the LegStar Eclipse site. However, the plugin does not include the samples. Furthermore, the libraries that you would need to run your Transformers are not easily accessible with the plugin so we still recommend that you perform a standalone installation as described in this document.

Pre-requisites

Java 1.5+ and ant 1.6.5+ are both prerequisites for LegStar. This module requires a JDK, or an international version of the JRE, that includes charsets.jar. Make sure JAVA_HOME and ANT_HOME environment variables are set and that $JAVA_HOME/bin (%JAVA_HOME%/bin on Windows) and $ANT_HOME/bin (%ANT_HOME%/bin on Windows) are both in your system path.

Coxbgen relies on Sun's JAXB. The JAXB implementation must be at least 2.1 compliant. Such an implementation is part of the LegStar distribution.

You will likely need the LegStar tools that generate XML Schemas with COBOL annotations as this is the major input to COBOL Transformers generator:

Installing

Download the latest coxbgen standalone distribution.

Unzip the binary distribution package into the directory of your choice, referred to as <installDir> in the following steps.

The directory tree should look like this:


    <installDir>
      |-->LICENSE
      |-->NOTICE
      |-->readme.html
      |--><samples>
          |--><quickstarts>
              |--><adapter_lsfileae>
                  |-->build-jaxb.xml
                  |-->build-coxb.xml
                  |--><schema>
                      |-->lsfileae.xsd
              |--><proxy_pojo_jvmquery>
                  |-->build-jaxb.xml
                  |-->build-coxb.xml
                  |--><src>
                      |-->**/*.java
                  |--><schema>
                      |-->jvmquery.xsd
              |--><proxy_ws_cultureinfo>
                  |-->build-jaxb.xml
                  |-->build-coxb.xml
                  |--><schema>
                      |-->jvmquery.xsd
      |--><lib>
          |-->*.jar


At this stage, you will probably want to run the samples provided

Uninstalling

To uninstall, remove the <installDir> folder.

Running the Transformers ant samples

Generate Transformers for the lsfileae adapter

run command ant -f build-coxb.xml from the samples/quickstarts/adapter_lsfileae folder and check the result.

build-coxb.xml uses the sample XML Schema in the schema folder. It generates JAXB classes in the src folder in the com.legstar.test.coxb.lsfileae package.

The JAXB classes are identical to the classes generated using Sun's XJC utility apart from additional Java 5 annotations holding COBOL meta-data.

Under the com.legstar.test.coxb.lsfileae.bind package, you will find the Transformers classes. They are generated by reflecting on the JAXB classes.

The Transformers classes provide a high performance alternative to reflecting on the JAXB classes at runtime. They are used by higher level LegStar modules.

Generate Transformers for the jvmquery proxy

run command ant -f build-coxb.xml from the samples/quickstarts/proxy_pojo_jvmquery folder and check the result.

You will notice that there are 2 jaxbRootClass parameters in the generateCOXB target. This is because the input and output structures from the jvmQuery POJO are different.

Generate Transformers for the cultureinfo proxy

run command ant -f build-coxb.xml from the samples/quickstarts/proxy_ws_cultureinfo folder and check the result.

You will notice that there are 2 jaxbRootClass parameters in the generateCOXB target. This is because the input and output structures from the cultureinfo Web service are different.