WORKSPACE SETUP

This Workspace Setup includes following topics:

In order to implement the DIGX architecture, we will create separate projects for different framework components in Eclipse (with JDK 8)

Why separate projects? : Ensures high extensibility and loose coupling between different components of the system. Also, in later stages, sustenance becomes easier and it helps developers also to effectively maintain the ever-growing code.

Moving on, let’s create the following projects as shown in the Figure 2:

Extensibility Guide

Basic Setup

Create a new workspace in Eclipse and launch that workspace.

Go to Window > Preferences. Go to Java > Build Path > Classpath Variables. Set following variables there

Classpath Variable

Description

DIGX_LIB

Refers to the base location of OBDX libraries

OBPClosedOracle Banking Platform_LIB

Refers to the base location of OBP libraries

EXT_LIB

Refers to the base location of external libraries

The screen will look like this.

Extensibility Guide

DTO (xface) Project

Create a Java Project with the project name ‘com.ofss.digx.cz.app.xface’. Now create a package in that project with the name ‘com.ofss.digx.cz.app.<module_name>.dto’ .

This package consists of Data Transfer Object classes, also referred as Plain Old Java Objects or POJO. All the request as well as response DTO classes are created under this project. The Request DTO classes in this project extend DataTransferObject present in OBP libraries whereas the Response DTO classes extend BaseResponseObject.

Project dependencies for xface project:

Not needed.

Classpath variables:

Extend the following classpath variables to the jars found in OBDX_Installer:

Classpath Name

Jars to extend

DIGX_LIB

com.ofss.digx.app.xface.jar

com.ofss.digx.appcore.dto.jar

com.ofss.digx.infra.jar

OBP_LIB

com.ofss.fc.appcore.dto.jar

com.ofss.fc.infra.jar

REST endpoint

Create a Java Project (Note: No need to create Dynamic Web Project from 18.1 onwards) with the project name ‘com.ofss.digx.cz.appx.service.rest’. Now create a package in that project with the name ‘com.ofss.digx.cz.appx.<module_name>’ .

This package contains the endpoint class to take requests and send responses back to server. The REST classes usually contain JAX-RS annotations and URIs which help them to locate themselves whenever a request is made through a REST call.

All the classes in this project extend AbstractRESTApplication and also have a default interface class prefixed with ‘I’ before the name of the corresponding REST implementation class. For instance, Account REST class will have IAccount Interface class in the same the package of this project.

Project Dependencies for REST Project

Add the following projects (to be created later) in the Java build path of this project:

com.ofss.digx.cz.app.xface, com.ofss.digx.cz.module.<module_name>

Classpath Variables

Create the following classpath variables (left column) and extend them to the jars (names on the right side column). Note that these libraries can be found in the OBDX Installer folder and the exact location of each jar can be found in the section 8 (last part) of this document.

Classpath Name

Jars to extend

DIGX_LIB

com.ofss.digx.appcore.jar

com.ofss.digx.appcore.dto.jar

com.ofss.digx.common.jar

com.ofss.digx.datatype.jar

com.ofss.digx.enumeration.jar

com.ofss.digx.infra.audit.jar

com.ofss.digx.infra.jar

com.ofss.digx.infra.crypto.jar

com.ofss.digx.app.xface.jar

com.ofss.digx.appx.core.rest.jar

com.ofss.digx.module.<Module Name>.jar (Based on which module service you are going to consume)

EXT_LIB

All jersey2 libraries found in OBDX installer folder

OBP_LIB

com.ofss.fc.appcore.dto.jar

com.ofss.fc.appcore.jar

com.ofss.fc.enumeration.jar

com.ofss.fc.infra.jar

Module

Create a new Java project with this name. This project contains the vital business logic, extension points, constraints, security checks like authorization and access control. The following packages need to be created inside this project:

With this ends the package structure for service classes. The implementation of this project takes maximum time and involves majority of the DIGX service layer handling. It is therefore a very crucial part to look for while developing a REST API in DIGX.

Project dependencies for module project:

Add the following projects in the Java build path of this project:

com.ofss.digx.cz.adapter, com.ofss.digx.cz.app.xface

Classpath variables:

Extend the following classpath variables to the jars found in OBDX_Installer:

Classpath variable name

Jars to extend

DIGX_LIB

com.ofss.digx.framework.domain.jar

com.ofss.digx.infra.jar

com.ofss.digx.appcore.jar

com.ofss.digx.common.jar

com.ofss.digx.datatype.jar

com.ofss.digx.adapter.jar

com.ofss.digx.module.alerts.jar

com.ofss.digx.module.approval.jar

com.ofss.digx.module.party.jar

com.ofss.digx.enumeration.jar

com.ofss.digx.module.common.jar

com.ofss.digx.appcore.dto.jar

OBP_LIB

com.ofss.fc.framework.domain.jar

com.ofss.fc.enumeration.jar

com.ofss.fc.datatype.jar

com.ofss.obp.patch.jar

com.ofss.fc.infra.jar

com.ofss.fc.appcore.dto.jar

com.ofss.fc.appcore.jar

com.ofss.fc.framework.dto.jar

Adapter

Create a Java Project with name com.ofss.digx.cz.extxface which contains all the Adapter Interfaces in this project. This project is required if you are creating new adapter interfaces. Within this project create a package with the name com.ofss.digx.cz.extxface.<module_name>.adapter. Now include the adapter interface for the adapter implementation class for your module. For example, in case of Account module, name of the interface created should be IAccountAdapter.

Project dependencies for adapter project:

Add the following projects in the Java build path of this project:

com.ofss.digx.cz.app.xface

Classpath Variables

Extend the following classpath variables to the jars found in OBDX_Installer:

Classpath Name

Jars to extend

DIGX_LIB

com.ofss.digx.infra.jar

Adapter Impl

Create a project with name com.ofss.digx.cz.extxface.<Host Name>.impl This project will contain implementation classes for all the adapter interfaces created in the com.ofss.digx.cz.adapter project for required host. Create a package named com.ofss.digx.cz.extxface.<module_name>.adapter.impl and add the following classes:

Project dependencies for adapter impl project:

Add the following projects in the Java build path of this project:

com.ofss.digx.cz.adapter
com.ofss.digx.cz.app.xface
com.ofss.digx.cz.module.<module_name>

Classpath Variables

Extend the following classpath variables to the jars found in OBDX_Installer:

Classpath Name

Jars to extend

DIGX_LIB

com.ofss.digx.appcore.dto.jar

com.ofss.digx.infra.jar

com.ofss.digx.adapter.jar

com.ofss.digx.datatype.jar

OBP_LIB

com.ofss.fc.framework.dto.jar

Database Scripts to be Added

There are few places where we decide which classes to be invoked in runtime. These are the possible database configurations done in an ideal case. Please add the following entries in the DIGX_FW_CONFIG_ALL_B table: (Account Service taken as an example and in accordance with the workspace example)

INSERT INTO digx_fw_config_all_b (PROP_ID, CATEGORY_ID, PROP_VALUE, FACTORY_SHIPPED_FLAG, PROP_COMMENTS, 
SUMMARY_TEXT, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE, OBJECT_STATUS, OBJECT_VERSION_NUMBER)
 VALUES ('ACCOUNT_CZ_REPOSITORY_ADAPTER', 'repositoryadapterconfig', 'com.ofss.digx.domain.account.entity.repository.
adapter.RemoteAccountRepositoryAdapter', 'N', null, 'Adapter repository adapter class', 'ofssuser', sysdate, 
'ofssuser', sysdate, 'Y', 1);

 

INSERT INTO digx_fw_config_all_b (PROP_ID, CATEGORY_ID, PROP_VALUE, FACTORY_SHIPPED_FLAG, PROP_COMMENTS, 
SUMMARY_TEXT, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE, OBJECT_STATUS, OBJECT_VERSION_NUMBER) 
VALUES ('ACCOUNT_CZ_ADAPTER_FACTORY', 'adapterfactoryconfig', 'com.ofss.digx.app.account.adapter.impl.
AccountAdapterFactory', 'N', null, 'adapter factory class', 'ofssuser', sysdate, 'ofssuser', sysdate, 'Y', 1);

 

INSERT INTO digx_fw_config_all_b (PROP_ID, CATEGORY_ID, PROP_VALUE, FACTORY_SHIPPED_FLAG, PROP_COMMENTS, 
SUMMARY_TEXT, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE, OBJECT_STATUS, OBJECT_VERSION_NUMBER) 
VALUES ('ACCOUNT_CZ_ADAPTER_MOCKED', 'adapterfactoryconfig', 'false', 'N', null, 'Flag to decide to go to Mocked 
adapter or Remote', 'ofssuser', sysdate, 'ofssuser', sysdate, 'Y', 1);

SOAP Client

This is a project that will contain stubs that will be used to invoke Host services. This can contain stubs generated by importing the WSDL published by host. This is an optional project and depends on the kind of host integration pattern followed.

Deployment

Package customized code in library EAR:

Once all the classes are created and implemented, generate the required ear deployments. The following two EARs need to be created: com.ofss.digx.cz.appx.service.rest.ear and obdx.app.cz.domain.ear.

To generate an EAR in eclipse, we need to create an Enterprise Application Project and include the required project/s during the creation. I am adding screenshot for creating com.ofss.digx.cz.appx.service.rest.ear , similar changes can be made for second EAR as well.

Steps to generate EAR in Eclipse:

Create an Enterprise Application Project (EAP) from the “New” option. Give details as mentioned in the Figure 3 and click on Next button

Extensibility Guide

Select all the projects created above. Do not check the ‘Generate application.xml deployment descriptor’ option as this EAR will be deployed as a library.

Extensibility Guide

Click on Finish to create the EAR.

Inject customized REST into com.ofss.digx.appx.service.rest.ear:

Extensibility Guide

Deploying application in Weblogic

The two EARs created in the previous step should be deployed in the existing deployment setup. Please deploy the com.ofss.digx.appx.service.rest.ear as an application and obdx.app.cz.domain.ear as library.

Test the Application

Once the application is up, please go to the deployments section of the Weblogic Server. In the control option, you’ll find the option to test the application. Just to verify, check whether the context-root of the custom application is changed to digx/cz. The request URL for testing this application will be –s

http://<hostname>:<port>/digx/cz/v1/application.wadl

Back