OpenGamma UI - custom security configurations



We are using OpenGamma v2.1.0. We are going to implement our own security. We need few new configuration pages for our security. New pages should look similar to

As we see from code UI is build with JavaScript. Do you have some documentation about your UI framework which could help us create new pages?



A ‘Cash Security’ was recently added to the develop branch so you should be able to follow the same steps as seen in the following commits:

  1. Ensure the security type is supported by the blotter

  2. Specify whether the security is OTC

3.1. Create the js file to control the security called og.blotter.forms.yournewsecurity
3.2. Add the new security to the list of available types, note the data-type element should match the name above
3.3 Create the template to be used as markup
3.4 Add the js file to OG-Web/web-engine/WEB-INF/uiResourceConfig.xml

The instructions on adding a new security (not including the UI side of things) can be found here
The docs here might be a little out of date with some specifics, but generally it should be okay.


Thanks Ian,

Can we have more details about step - 3.3 Create the template to be used as markup?


Using this commit as and example:

We use templates. So anything in double curly brackets is replaced when the template is compiled.

In the example below, the name attribute translates to the json object that will be submitted with the form. I would suggest you save/or load an existing trade and inspect the json in your browsers developer tools.

<input name='security.rate' type='text' value='{{rate}}'/>

The {{rate}} part is replaced when you pass this variable to the template as part of the extras object.

new form.Block({
   module: 'og.blotter.forms.blocks.cash_tash',
   extras: {start:, maturity:,
      region:, amount:, 
   children: [
      new form.Block({module: 'og.views.forms.currency_tash', 
         extras: {name: "security.currency"}}),
      new og.blotter.forms.blocks.Regions({name: 'security.regionId', 
         value:, form: form}),
      new ui.Dropdown({ form: form, resource: 'blotter.daycountconventions', 
         index: 'security.dayCount', value: data.dayCount, 
         placeholder: 'Select Day Count' })

Above we have one of the building blocks of the form consisting of; the module which points to the html template, the extras object, and an array of children blocks. In this case they create a currency dropdown, a regions dropdown and a day count conventions dropdown. These children blocks replace {{item_0}}, {{item_1}} and {{item_2}} respectively.