Create a CIS 6 project

This page will show you how to create a new CIS 6 project.

Contents:

Creating a new project

You create a blade project using the CIS Toolkit's create command.

The create command takes the following options:

Options Mandatory Description

-n

--name

Yes The name of the new blade. The blade name will be used as the name of the blade's main class, and so the name must be in upper camel-case (first letter capitalised), in accordance with Java conventions for class naming.

-k

--kit

Yes The file path to the root folder of the unzipped Caplin Integration Suite kit. This is needed so that the correct APIs and other resources can be included in the new blade.

-i

--include

Yes

The Caplin Integration APIs that you want to include in this blade. This must be one or more of the following, separated by spaces:

  • pricing
  • trading
  • permissioning
  • notifications
  • charting
  • blotter

Some of the blade's other requirements will be determined by the APIs you pick.

-d

--directory

No The file path to the location where the blade-project is to be created. If the folder you specify doesn't yet exist, it will be created; if you don't specify one, the blade will be created in the current working directory.

-p

--package

No

The namespace of the base package that is to contain the source code for this blade.

For example: com.novobank.adapter

-s Dependent on selected APIs

Subject Prefix or Asset Class

You only need to use the -s option if you've selected the pricing and/or trading APIs. The rules for each are slightly different.

If you've included pricing but not trading, you have to specify a subject prefix. This must contain only alphanumeric characters, with a slash before and after; e.g. /FX/

If you've included trading, you have to provide an asset class, which is basically the same only without the slashes.

If you've included both pricing and trading, then provide just the asset class (i.e. without the slashes). The same string will be used for the subject prefix, but the slashes will be added automatically.

For example: The asset class FX would become the subject prefix /FX/

-L No

Connects the pricing adapter to a Liberator component.

If you've included the pricing API, it will connect to a Transformer component by default. Use this option if you want it to connect to a Liberator instead.

Note: the long form of option names uses this syntax: --option value. Do not use GNU syntax: --option=value.

Example: creating a pricing and trading project

The command below creates a new project for an adapter that provides pricing and trading functionality. The following command would be entered from a command prompt in the root directory of the Caplin Integration Suite kit:

#!/bin/bash
java -jar tools/cis-blade-toolkit-6.0.1-255011368.jar create \
        -n SampleBlade \
        -k . \
        -i pricing trading \
        -d ~/src/blades \
        -p com.mybank \
        -s FX

The options used in this example break down as follows:

Option Description
-n SampleBlade Specify the name of the project, and the blade that will be exported from it, as 'SampleBlade'.
-k . Specify the location of the CIS root directory as the current directory (.)
-i pricing trading Specify that the integration libraries 'pricing' and 'trading' should be included in the project.
-d ~/src/blades Specify the location for the new project as the src/blades directory under the user's home directory.
-p com.mybank Specify the package for generated code as com.mybank. This will translate into com/mybank in the src/java section of the blade project's directory structure.
-s FX Specify the asset class for trading as FX. The subject prefix for pricing will be automatically set to /FX/.

Note: No -L option has been set, so the adapter will connect to Liberator via Transformer (the default setting).

The blade project created from this example would look something like this:

SampleBlade
├── bin
├── Blade
│   ├── blade_config
│   │   └── fields.conf
│   ├── DataSource
│   │   ├── bin
│   │   │   ├── logcat
│   │   │   └── start-jar.sh
│   │   ├── etc
│   │   │   ├── datasource.conf
│   │   │   ├── trademodels.xml
│   │   │   └── trading-provider.properties
│   │   ├── lib
│   │   │   ├── datasource-java-6.2.9-657-b01314d.jar
│   │   │   └── trading-datasource-6.2.2-911-f0a7b45.jar
│   │   └── var
│   ├── Liberator
│   │   └── etc
│   │       └── rttpd.conf
│   └── Transformer
│       └── etc
│           └── transformer.conf
├── global_config
│   ├── bootstrap.conf
│   ├── environment.conf
│   ├── environment-defaults.conf
│   ├── fields.conf
│   ├── hosts-defns.conf
│   └── README.txt
├── README-Wizard.txt
└── src
    ├── main
    │   └── java
    │       └── com
    │           └── mybank
    │               ├── SampleBlade.java
    │               ├── SampleBladePricingProvider.java
    │               ├── SampleBladeTradeChannelListener.java
    │               ├── SampleBladeTradeListener.java
    │               └── SampleBladeTradingProvider.java
    └── test
        └── java
            └── com
                └── mybank

Importing a CIS 6 project into the Eclipse IDE

To import a new CIS 6 project into the Eclipse IDE, follow the steps below:

  1. Open the Eclipse IDE
  2. Click File > New > Java Project. The New Java Project dialog appears.
  3. In the Project name box, type the name of the project. This must be the same name you used for the -n argument to the CIS Toolkit's create command.
  4. Deselect Use default location.
  5. In the Location field, enter the location of the project you created using the CIS Toolkit.
  6. Click Next. The Java Settings page appears.
  7. In the Source tab, right-click the src/test/java folder, and click Use as source folder
  8. Click Finish

For example, importing the project created in the previous section into Eclipse creates the Eclipse project below: