# Create a CIS 6 project

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

## Creating a new project

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

The `create` command takes the following options:

* **-n &lt;value>, --name &lt;value>**\
 [Required] 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 &lt;value>, --kit &lt;value>**\
 [Required] 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 &lt;value>, --include &lt;value>**\
 [Required] 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, and blotter.

  Some of the blade’s other requirements will be determined by the APIs you pick.
* **-d &lt;value>, --directory &lt;value>**\
 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 &lt;value>, --package &lt;value>**\
 The namespace of the _base package_ that is to contain the source code for this blade.

  For example: `com.novobank.adapter`
* **-s &lt;value>**\
 Subject prefix or asset class, depending on which APIs have been selected.

  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**\
 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 syntax is: `--_option value_`. Do not use GNU long-form 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_:

```sh
java -jar tools/cis-blade-toolkit-6.0.1-255011368.jar create \
    --name       SampleBlade \
    --kit        . \
    --include    pricing trading \
    --directory  ~/src/blades \
    --package    com.mybank \
    -s           FX
```

The options used in this example break down as follows:

* **--name SampleBlade**\
 Specify the name of the project, and the blade that will be exported from it, as 'SampleBlade'.
* **--kit .**\
 Specify the location of the CIS root directory as the current directory (.)
* **--include pricing trading**\
 Specify that the integration libraries 'pricing' and 'trading' should be included in the project.
* **--directory ~/src/blades**\
 Specify the location for the new project as the `src/blades` directory under the user’s home directory.
* **--package 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 scaffolding created from the above command looks like this:

```
~/src/blades/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**
