# Adapter project structure

This page describes the structure of a CIS project.

## Overview

The majority of the files and folders within a CIS project are common to all blade projects; a minority are dependent on the settings you specified when you created the project.

The illustration below shows what a typical blade looks like, when viewed in the [Eclipse](https://www.eclipse.org) _Package Explorer_ tab.

**📌 NOTE**\
For the most part, this view replicates what the actual directories look like, but there are exceptions. The _JRE System Library_ and _Referenced Libraries_ for example, may be in a completely different location, and each part of the _Base Package namespace_ actually represents a separate folder.

![cis_platform_blade_structure](../../../images/cis_platform_blade_structure.png)

The name of this blade project is _TPBlade_. It has a Base Package of _example.novobank.java.code_, uses both the _Pricing Integration_ and _Trading Integration APIs_, and has connections to both _Transformer_ and _Liberator_. The structure and content of the project directory reflects this.

## Libraries

Starting at the top and working down, there’s the _JRE System Library_ and another node called _Referenced Libraries_, which contains a reference to the _DataSource API_. While the JRE System Library may well exist elsewhere, the _jar_ file containing the DataSource API usually resides in the _/Blade/DataSource/lib/_ directory.

## Java source files

The view of the directories containing the Java source files is simplified considerably in the _Eclipse Package Explorer_. All blade-projects will have the directory path _[BladeName]/src/main/java/_. If no _base package_ was defined, the Java files will be in that location, although _Eclipse_ will display them within an extra node called "**_(default package)_**". If you have defined a base package, _Eclipse_ will display the namespace you entered as a single node, while this will be broken down into multiple directories in the file structure itself.

**For Example:**

The base package namespace here is _example.novobank.java.code_.

The Java files would therefore be in the directory: _TPBlade/src/main/java/example/novobank/java/code/_.

The Java files themselves depend on which options you chose when you created the blade. There will be one file called _[BladeName].java_ (**_TPBlade.java_** in this case), and another file for each selected provider, called _[BladeName][Providertype]Provider.java_. As our example has both Pricing and Trading APIs, we have **_TPBladePricingProvider.java_** and **_TPBladeTradingProvider.java_** here.

## Blade configuration

The _/Blade/_ directory contains various pieces of configuration data, the first of which is the **_fields.conf_** file, which defines the fields that will be contained in records handled by this blade. It’s located in the _[BladeName]/Blade/blade_config/_ folder.

### DataSource configuration

The _[BladeName]/Blade/DataSource/etc/_ directory contains several files, some related to the DataSource API itself, and some that are specific to trading functionality, which are only present if the Trading Integration API has been selected.

* `datasource` - contains a script to start the DataSource Jar.
* `datasource.conf` - contains the DataSource configuration details for this blade.
* `trademodels.xml` - an XML file that - as the name suggests - contains any trade models that are to be applied by this blade. This file is only present if the Trading Integration API has been selected.
* `trading-provider.properties` - this too is only present if the Trading Integration API has been selected. It contains configuration details needed by the Trading Provider, such as the location of the trade model and the audit log, and the subject patterns to identify and extract relevant data from incoming requests.

### Liberator Configuration

The Liberator configuration details for a platform blade are contained in the **_rttpd.conf_** file, which is located in the _[BladeName]/Blade/Liberator/etc/_ directory. The _Liberator_ directory is only present if the blade needs to connect to a Liberator, so pricing blades will often not have one, as they usually connect to a Transformer instead.

### Transformer Configuration

Transformer configuration details can be found in the **_transformer.conf_** file, which lives in the _[BladeName]/Blade/Transformer/etc/_ directory (unless of course your blade doesn’t connect to a Transformer, in which case it will be conspicuous by its absence).

## Global Configuration

The _[BladeName]/global_config/_ directory contains various configuration files that in the live environment would be external to the blade itself, and would reside in the _global_config_ directory of the [**Caplin Deployment Framework**](../deployment-framework/index.md). The versions in the blade-project’s _global_config_ directory are there so that you can run the blade locally while you’re developing it. These include:

* `bootstrap.conf` - contains general "bootstrapping" configuration, including references to the environment and hosts configuration files.

  **📌 NOTE**\
  _bootstrap.conf_ contains a reference to the file **_hosts.conf_**, which does not initially exist within the blade project. It’s created after the blade is deployed, using the command `./dfw hosts` in the _Caplin Deployment Framework_.
* `environment-defaults.conf` - sets environmental defaults such as address, port and monitoring definitions for other Caplin Platform components.
* `environment.conf` - sets deployment-specific environmental definitions, and defines primary and failover nodes.
* `fields.conf` - contains definitions for global fields.
* `hosts-defns.conf` - defines both primary and failover settings for Transformer, Liberator and DataSource hosts. By default, all of these are set to _localhost_, but you can point them towards remote servers if necessary.

---

**See also:**

* [Deployment Framework Structure](../deployment-framework/cdf-deployment-framework-structure.md)
