OBDX UI Extensions Configurations Guide

This document includes following topics:

1. OBDX Component Extension

This documentation will guide you on how to override existing OBDX components

Pre-requisites

Steps

 

This entry is in two parts.

- Add entry of your component, in array, named as components “{moduleName}/{componentName}”

- If your component requires partial then add its name, in array, named as partials. “folder-name/file-name”

 

Sample extension.json

{

"components": ["loans/loan-calculations"], "partials": [“account-access/casa-account-access”]

}

2. Segment & JSON context Extension

To evaluate this two parameters there are respective functions in <CHANNEL_ROOT_PATH>/extensions/override/extensions.js file

 

evaluateUserType function,

Arguments ( roles: [], defaultSegment : String )

roles[] (array) will contain all the roles mapped to the user defaultSegment (string) will contain system evaluated default segment

Return Value

(String,), Should return string representing what is the segment for respective component (possible values: ANON | CORPADMIN | RETAIL | CORP | ADMIN)

 

Description

If you want to change user type for your application, you can do so by implementing this function and return required user type for your application.

 

evaluateContext function,

Arguments

( segment , roles ) roles[] (array) will contain all the roles mapped to the user segment (string) will contain evaluated user segment

 

Return Value

(String) Should return string representing what is the context for respective component (Possible values: index | retail | corporate | admin | corp-admin or any custom value)

Description

This function will set context for your components to fetch json artifacts from correct folder. Return possible value and then json will be fetch from respective location. Using this you can specify menu for your context.

Note:
• Core functionality of Framework Elements like (header, dashboard, menu etc.) are not available for the modification. You can customize menu options.
• If any component is present in <CHANNEL_ROOT_PATH>/extensions/components will take precedence over the <CHANNEL_ROOT_PATH>/components.
• All components available under component folder are available for the extension
• If menu.json is to be changed and other are not changed, irrespective of the change, all files/folders within the base role, for example json/retail need to be copied for new role even if one file is changed. This is because when you change the context, using evaluateContext function above, the root for JSON lookup changes, that is why all the JSON files are then looked up from whatever value is being returned from the evaluateContext method. So, all the JSON files need to be present in new directory.

How to create/modify menu.json for new Context

Basic structure of your menu.json file should be as follows

OBDX UI Extension & Configurations Guide

All your entries will go in array named as “default”

There are two types of entries

Here you can specify following options

OBDX UI Extension & Configurations Guide

name name of the component you want to load
module module name of the component

Note: Also add component specific configurations wherever required. Please refer out of the box “menu.json” for each segment. For example below entries are required for some specific components only.

applicationType (optional) it is component specific configuration
moduleURL (optional) it is component specific configuration
type (optional) it is component specific configuration

 

This option you can use to group related menus together.

Following JSON denotes 1 menu group

OBDX UI Extension & Configurations Guide

In above JSON name is, key in resource bundle icon is,

name of icon from OBDX font. This icon will be the icon you want along with the name.

submenus [] will contain entries same as entry you will do for Single menu option

Sample menu.json

OBDX UI Extension & Configurations Guide

3. OBDX Validation Extension

All the validation available in the application are maintained in <CHANNEL_ROOT_PATH>/framework/js/base-models/validations/obdx-locale.js. Implementer can override and add new validations in the application without changing this file.

An extension hook is given at

For OBDX 18.1 at <CHANNEL_ROOT_PATH>/extensions/validations/obdx-locale.js

From OBDX 18.2 onwards <CHANNEL_ROOT_PATH>extensions\override\obdx-locale.js

In this file Implementer can add or override validations.

For Example: If you need to change the pattern which validate Mobile Number. Add updated pattern in this file as below.

OBDX UI Extension & Configurations Guide

4. Calling Custom REST Services

In implementation if any new services are written by implementer it has been directed to change the context root for new REST to digx/cz/v1.

For supporting it from the UIClosedUser Interface, implementer has to pass cz/v1 in the version field of the AJAX setting from his model.

For example see the snippet below:

OBDX UI Extension & Configurations Guide

 

Home