T24 Software Development Kit – User Guide – Overview
TEMENOS T24 Software Development Kit
T24 Software Development Kit – Overview
Table of Content Introduction.............................................................................................................................................. 3 Overview.................................................................................................................................................. 3 TSDK Foundation ................................................................................................................................ 4 com.temenos.tsdk ............................................................................................................................ 4 ClassLoader ..................................................................................................................................... 4 com.temenos.tsdk.foundation .......................................................................................................... 4 com.temenos.tsdk.validation............................................................................................................ 6 com.temenos.tsdk.exception............................................................................................................ 6 com.temenos.tsdk.routines .............................................................................................................. 6 com.temenos.tsdk.utils..................................................................................................................... 8 Log4J Example................................................................................................................................. 8 TSDK Application Classes................................................................................................................... 8 TSDK for server side APIs ................................................................................................................... 9 TSDK for web server APIs................................................................................................................. 10 How it works .......................................................................................................................................... 11
T24 Software Development Kit – Overview
Introduction For many years, T24 has had an extensive range of API hooks to allow the customisation and extension of T24’s business logic to meet the needs of an individual institution. However, historically such code has had to be written in BASIC. The T24 Software Development Kit, or TSDK, exposes T24 tables, records and methods to the Java developer. It allows T24 server side API routines and web server API routines to be written using Java. This document describes the installation of the TSDK, gives an overview of the structure and philosophy and also contains details of how to create TSDK classes from local customisation. The TSDK is currently available in Java, with support for Microsoft’s .Net platform via C# planned for later releases. It is assumed that the reader has a good working knowledge of both java and object oriented programming. This document is not intended to teach either java or object oriented programming.
Overview The TSDK is comprised of the following components: Foundation
Main interface to TSDK Calls T24 business functions
Application Cl
A set of created classes that represent the business objects
T24 Software Development Kit – Overview
TS DK Foundation com.temenos.tsdk The main package for the TSDK contains the main T24 class and associated exceptions. The ClassLoader class is the main entry point to the T24 Routines that expose the T24 core basic classes. By splitting up the main T24Routines class in to different classes, we are able to call methods from each class, hence making them manageable. It contains subdirectories which will be discussed in the sections below, with what the whole T24 Foundation is about. These subdirectories (packages) include routines, validation, xml and utilities. The Classloader class provides access to contextual T24 data and allows access to the T24 business logic.
ClassLoader This class is the first call when we enter TSDK arena. It takes the common data that is tagged up as XML coming from a T24 routine. This XML document is a representation of the common area within T24. This contains data like company information, user ID and the current contract. In ClassLoader, we define the connection type, where a request is coming from. This is necessary because, a validation could be at the web server or at the T24 server. The connection type helps direct the request to the proper routine for validation. This is contained in the T24Context class. Using the T24API, a Java interface, a validation routine instance is created passing the t24Common and t24Routines objects to it. The TSDK is supplied with full javadoc documentation that is shipped with the T24 Browser release.
T24 Software Development Kit – Overview
The TSDK is supplied with full javadoc documentation, however a brief overview of a TProperty is provided here:
Method
Description
getName
Returns the name of the field.
get / setValue
Returns or sets the value of the field.
get / setMinimumLength
Returns or sets the minimum length of the field.
get / setMaximumLength
Returns or sets the maximum length of the field.
mandatory
Returns whether the field is mandatory or not.
setMandatory
Set whether the field is mandatory or not.
get / setRelatedFile
Returns or sets the name of a related file of the field.
getOptions
Returns a list of field values as defined in the T array.
get / setError
Returns or sets an error against the field.
get / setEnrichment
Returns or sets an enrichment against the field.
T24 Software Development Kit – Overview
com.temenos.tsdk.validation This package is used for processing validation requests on contracts – both at the Web Server and T24 Server levels. The most important class in this package is the ValidationResponse class – used to communicate the outcome of a TSDK invocation to the user. The ValidationResponse class contains a list of the field properties, as well as a list of general errors and messages, generated during the running of the user’s validation routine.
com.temenos.tsdk.exception This package is used for handling all java exceptions from the TSDK.
com.temenos.tsdk.routines This package contains T24 routines that make up the wrappers for T24 Server Basic routines. They are sub divided into 7 main classes each with related methods. The TSDK is supplied with full javadoc documentation, however a brief overview is provided here:
Below is the list of the breakdown of the classes within T24Routines.
T24 Software Development Kit – User Guide – Overview
T24 Routines
Date
ExchangeRate
FileHandling
calculateCustomerRate
clearFile
calculateExchangeRate
deleteRecord
calculateExchangeRateLocal
readCacheRecord
convertForeignCurrency
readRecord
convertMiddleForeignCurrency
writeRecord
Generic
Translation
Validation
translateText
calculateYield convertCurrency
calculateDate
formatAmount
calculateDateAndFrequencyCode
formatRate
convertJulianGregorianDate
getLocalRefs
convertT24DateToInternalDate
getSettlementDefaults getStandardSelectionDetails limitCheck
fieldNullCheck storeError
T24 Software Development Kit – User Guide – Overview
com.temenos.tsdk.utils This package contains a logger utility class for debugging purposes. It contains a TLogger class which is the main utility class for logging. TSDK uses Log4J, a Jakarta project for logging and debugging purposes. This makes use of 2 jars T24log4j.jar and t24trace.jar. This class handles all the log4j requests. It's a generic handler for all log4j calls implemented by the tsdkTrace class.This class contains a WriteToLog method that we can use to pass the Log Level, Callee program/function, message and arraylists. The WriteToLog will format the details in an appropriate manner and call the corresponding t24Trace method to invoke the log4j logic.
Log4J Example
TS DK A pplication C las s es Each release of T24 is shipped with a new set of created classes that represent the business objects within T24. The created classes expose every table as a class with corresponding get and set methods (with full support for multi and sub values). Developers can work with the java classes themselves – they do not need to know the fields that are defined in the application – these are exposed as properties on the classes. Here we can see the field names being exposed for the FOREX table:
T24 Software Development Kit – Overview
TSDK for s erver s ide AP Is T24 comes with an impressive list of server side API hooks that allow the T24 implementation to be customised. These are defined from the table EB.API, and it is here that the language, package and class or routine name of the API is defined.
Under the T24 architecture, these server side APIs are invoked at the T24 server under specified conditions, and normally this is at commit time on a contract.
T24 Software Development Kit – Overview
TS DK for web s erver AP Is EB.API is reused to define the web server APIs, by attaching the EB.API record to the WEB.VAL.RTN field on VERSION. The fields that are used to trigger the web validate API are defined as having the “WEB.VALIDATE” attribute.
T24 Software Development Kit – Overview
How it works As described earlier, the TSDK comprises of :!
Foundation Classes
!
Application Classes
!
T24 Server APIs
!
T24 Web Server APIs
In addition, a number of utilities applications exist to create and deploy the TSDK (e.g. WS.CREATE), and a number of other BASIC routines to support the TSDK. The following sections describe how the TSDK works. Please refer to the sequence diagram in Appendix 1 for a diagrammatic view of the flow for Web Server and T24 server validation.
Ins tantiation of the T24 Validation clas s Whether the TSDK validation routine is being invoked from the web server or T24 server, the Java validation class must be instantiated. In terms of Java, this is done using dynamic loading of the clas
T24 Software Development Kit – Overview
T24 S erver A PI When validation is required at the T24 server layer, the following actions are performed :1.
The T24 server code checks whether the VERSION record has any validation routines attached.
2.
If an EB.API Java routine has been attached to a field then EB.CALL.API is invoked.
3.
EB.CALL.API will make a call to EB.CALLJ.PROG.JBASE to call the Java class routine.
4.
EB.CALLJ.PROG.JBASE will create an XML document that represents the data in the T24 common area. This is done by calling TSDK.PRODUCE.COMMON.
5.
EB.CALLJ.PROG.JBASE will the create an instance of the TSDK foundation class ClassLoader. The name of the Java Validation routine will be passed as a parameter as well as the XML common document.
6.
The ‘getData’ routine of the ClassLoader is run. This is the start of TSDK processing.
7.
The ClassLoader class inspects the validation routine name passed and creates an instance of this class.
8.
The ClassLoader class converts the XML common document in to a T24Common class which holds the common data as Java objects.
9.
The ClassLoader class creates an instance of the T24Routines class which allows access to the T24 BASIC routines to read a record, date manipulations, etc.
T24 Software Development Kit – Overview
C alling T24 bus ines s log ic The T24Common and T24Routines objects contain the data and API routines to allow full validation using Java and BASIC routines. The T24Common area contains information such as the contract being validated, field data (including F, N , and T array data), the VERSION record, the SPF record, etc. The T24Routines contain APIs to the standard set of T24 BASIC routines such as date manipulation subroutines, file manipulation routines (e.g. read record, write record, etc). Please note that the T24Routines methods will involve calls to the existing BASIC routines, therefore, thought must be given to performance and bandwidth considerations when writing API routines. This is particularly true when validating at the web server as calls will need to be made back to the T24 server platform.
The TSDK T24Routines class is supplied with full javadoc documentation, however a brief overview of some of the routines are provided here: Method
Description
Basic equivalent
readRecord
Returns a contract object.
F.READ
readCache
Returns a contract object
CACHE.READ
updateRecord
Updates a row on a table.
F.WRITE
deleteRecord
Deletes a record from a file
F.DELETE
T24 Software Development Kit – Overview
T24 Software Development Kit – Overview
T24 Software Development Kit – User Guide – Overview
TS DK S equence Diag ram
End-user with T24 Browser
T24 Browser Web Server
Web Validation Request (HTTP)
T24 Server
TSDK - Web Deployed
TSDK - T24 Deployed
Validate (Java)
Validate Contract (Java) BASIC Routine Call using Browser XML (Optional) TSDK Web Validation API: Subroutine Call (BASIC) Web Validation Response (XML)
Validate Response (XML)
Subroutine Return (XML)
Optional Subroutine calls to BASIC routines via the TSDK can be made from both the Web and T24 Servers. This can be calls to general subroutines (e.g. to read a file) or IN2 routines (e.g. to validate a date field). These are shown in blue.
Server Validation Request (HTTP)
Validate (Browser XML)
Validate Contract using CALLJ to Java BASIC Routine Call using Java OBjEX (Optional)
TSDK Server Validation API:
Server Validation Response (XML)
Subroutine Call (BASIC) Validation Response (XML)
Subroutine Return (Java OBjEX)