You are on page 1of 41

TAFJ-D SP a c k a g e I n s t all e r

R20
TAFJ-D SP a c k a g e I n s t all e r

Amendment History:

Revisio
Date Amended Name Description
n
1 27th March 2018 JN.Charpin Initial version
2 9th May 2018 JN.Charpin Staging operations for all packages from package list
21st March Sanofar Nisha
3 R19 AMR Review
2019 H
4 25th March 2020 Siranjeevi M R20 AMR Review

Page 2
TAFJ-D SP a c k a g e I n s t all e r

Copyri g h t
Copyright (c) Temenos Headquarters SA 2009-2020.
All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this document may
be reproduced, transmitted, or made available directly or indirectly to a third party without the express
written agreement of TEMENOS UK Limited. Receipt of this material directly TEMENOS UK Limited
constitutes its express permission to copy. Permission to use or copy this document expressly excludes
modifying it for any purpose, or using it to create a derivative therefrom.

Errat a and Com m e n t s


If you have any comments regarding this manual or wish to report any errors in the
documentation, please document them and send them to the address below:
Technology Department

Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland

Tel SB: +41 (0) 22 708 1150


Fax: +41 (0) 22 708 1160

Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com

Page 3
TAFJ-D SP a c k a g e I n s t all e r

Table of Contents
Copyright................................................................................................................................................ 3
Errata and Comments............................................................................................................................ 3
Goal........................................................................................................................................................ 6
Principle.................................................................................................................................................. 6
Package structure within the webapp..................................................................................................... 7
Package-list file..................................................................................................................... 8
Package-detail file................................................................................................................. 8
Staging area management and population............................................................................................. 9
Component definition and convention................................................................................... 9
Default implementation.................................................................................................... 12
Defining a custom implementation...................................................................................... 13
Application deployment........................................................................................................................ 13
REST API to interact with staging area................................................................................................ 14
API description.................................................................................................................... 15
Package(s) operations..................................................................................................... 15
Staging area operations................................................................................................... 16
REST Interaction examples by using POSTMAN client...................................................... 19
Basic authentication all requests..................................................................................... 19
Check staging area status............................................................................................... 19
Drop the staging area...................................................................................................... 20
Create the staging area................................................................................................... 21
Check the package list..................................................................................................... 22
Check the package detail................................................................................................ 22
Check a record content.................................................................................................... 23
Write all package(s) to the staging area.......................................................................... 24
Write a package to the staging area................................................................................ 25
Write a single record........................................................................................................ 27
Read a record from the staging area............................................................................... 28
Read a package from the staging area........................................................................... 28

Page 4
TAFJ-D SP a c k a g e I n s t all e r

Clear the staging area..................................................................................................... 30


Delete all package(s) from the staging area.................................................................... 30
Delete a package from the staging area.......................................................................... 31
Delete a single record from the staging area................................................................... 32
DS Packager Installer servlet............................................................................................................... 32
Staging area management.................................................................................................. 33
Package parsing operations................................................................................................ 34
Package staging operations................................................................................................ 35

Page 5
TAFJ-D SP a c k a g e I n s t all e r

Goal

Avoid file system usage during Design Studio (referred as DS) package installation.

Prin c i p l e

Persist a DS package content in T24 RDBMS, within a “staging area” (set of tables), instead
of unzipping it to file system, UD folder.

The following steps of installation process remain the same.

The DS generated package content has to be deployed, exploded, within the following tafj
artifact.
<dependency>
<groupId>com.temenos.tafj</groupId>
<artifactId>DSPackageInstaller</artifactId>
<type>war</type>
</dependency>

This DSPackageInstaller artifact is a web application, war file, which is going to be deployed
under client JEE environment, through the standard web application deployment capability of
the application server.

Once deployed DSPackageInstaller.war provides webservices (REST API) and servlet


access to manage and populate the RDBMS staging area.

T24 services need to adapt their process to read packages from this staging area instead of
reading from the former UD file system.

Page 6
TAFJ-D SP a c k a g e I n s t all e r

Pac k a g e stru c t u r e withi n th e web a p p

Design Studio package builder needs to pull from the nexus repository the raw
DSPackageInstaller.war artifact mentioned above.

The following convention is used to embed a DS package within the webapp.

Create the following structure within the war file:

/DSPackageInstaller.war

/WEB-INF

/packages

/package-list

/R17_FT_Modelbank_1_JAVA_17.0

/package-detail

/ds-generated

/eson

/IF

/REC001

The yellow part represents a standard DS package content, named


R17_FT_Modelbank_1_JAVA_17.0. It has to be exploded under a packages directory under
WEB-INF.

A war file can contain multiple packages.

Packages are referenced within the package-list file which needs to be generated by DS
package builder

A package content is listed within the package-detail file which has to be generated by DS
package builder.

Page 7
TAFJ-D SP a c k a g e I n s t all e r

Pac k a g e - list file

The package-list contains the list of all packages, represented by their name, corresponding
to the root directory level of the package.

Packages part of the package-list are visible for staging, and must be present under WEB-
INF/packages.

i.e.

R17_FT_Modelbank_1_JAVA_17.0
R17_FT_Modelbank_1_JAVA_17.1

Pac k a g e - det a i l file

The package-detail represents the list of files or package entries which are visible for staging.

Files not intended to be staged and part of a package, must not be part of this list.

A package entry format is made of 2 parts separated with # sign.

technicalUniquePackageEntryKey#path/To/The/File/Within/The/Package

The first part is a technical key generated by DS package builder, it must be unique as it will
be used as a primary key within the staging area. Since the record management will be
handled differently by T24 based on its type, this type is also part of the key.

It could be built by using the following convention:

package name + “-“ + sequence ID + “.” + file type

Re-using same key will lead to a record overwrite at staging time, in case of an existing key
with same value is already defined in the staging area.

The second part after # sign is the path to the record from the package root directory.

The file must exist under this path to be read by the installer.

i.e.

Page 8
TAFJ-D SP a c k a g e I n s t all e r

R17_FT_Modelbank_1_JAVA_17.0-9.xml#R17_FT_Modelbank_1_JAVA_17.0/ds-
generated/PP.STANDING.ORDER.enquiry.xml
R17_FT_Modelbank_1_JAVA_17.0-
10.eson#R17_FT_Modelbank_1_JAVA_17.0/Eson/CATEGORY!1001!
GB0010001.eson
R17_FT_Modelbank_1_JAVA_17.0-
11.event#R17_FT_Modelbank_1_JAVA_17.0/IF/ACCOUNT.event
R17_FT_Modelbank_1_JAVA_17.0-
12.flow#R17_FT_Modelbank_1_JAVA_17.0/IF/ACCOUNT.flow
R17_FT_Modelbank_1_JAVA_17.0-
13#R17_FT_Modelbank_1_JAVA_17.0/R17_FT_Modelbank_1
R17_FT_Modelbank_1_JAVA_17.0-
14#R17_FT_Modelbank_1_JAVA_17.0/R18_IF_TestIF_1
R17_FT_Modelbank_1_JAVA_17.0-
15.d#R17_FT_Modelbank_1_JAVA_17.0/REC001
R17_FT_Modelbank_1_JAVA_17.0-
16.d#R17_FT_Modelbank_1_JAVA_17.0/REC002
R17_FT_Modelbank_1_JAVA_17.0-
17.d#R17_FT_Modelbank_1_JAVA_17.0/REC003

Sta g i n g are a ma n a g e m e n t and pop u l a t i o n

The staging area management and CRUD operations are done through a JBC component
called DS.PackageStaging.component. The initial version of this component has been
provided by TAFJ team to T24 AFW team which will take the ownership.

The component defines several methods to:

- Check the existence of the staging area

- Create the staging area

- Drop the staging area

- Clear the staging area

- Write records into the staging area

- Read records from the staging area.

- Delete records from the staging area.

Page 9
TAFJ-D SP a c k a g e I n s t all e r

Com p o n e n t defi n i t i o n and co nv e n t i o n


Components methods must define the following INOUT parameters:

- ReturnStatus: “0” for SUCCESS and “1” for FAILURE.

- ReturnInfo: An array of information built during method processing.

component DS.PackageStaging
# Component Isolation Definition
metamodelVersion 1.6
# -------------------------------------------------
public method CheckStagingArea (
INOUT ReturnStatus string
INOUT ReturnInfo string
)

{
jBC: DS.CHECK.STAGING.AREA
}

Check whether all table part of the staging area are existing.
ReturnStatus=0 when all table exist.
ReturnStatus=1 when a table is missing.
ReturnInfo= List of table name and their status OK / NOK.

public method CreateStagingArea (


INOUT ReturnStatus string
INOUT ReturnInfo string
)

{
jBC: DS.CREATE.STAGING.AREA
}

Create all table part of the staging area.


ReturnStatus=0 when all table are created.
ReturnStatus=1 when a table failed to be created.
ReturnInfo= List of table name and their creation status OK / NOK. Plus
any exception in case of creation error.

public method DropStagingArea (


INOUT ReturnStatus string
INOUT ReturnInfo string
)

{
jBC: DS.DROP.STAGING.AREA

Page 10
TAFJ-D SP a c k a g e I n s t all e r

Drop all table part of the staging area.


ReturnStatus=0 when all table are dropped.
ReturnStatus=1 when a table failed to be dropped.
ReturnInfo= List of table name and their drop status OK / NOK. Plus any
exception in case of dropping error.

public method ClearStagingArea (


INOUT ReturnStatus string
INOUT ReturnInfo string
)

{
jBC: DS.CLEAR.STAGING.AREA
}

Clear all table part of the staging area.


ReturnStatus=0 when all table are cleared.
ReturnStatus=1 when a table failed to be cleared.
ReturnInfo= List of table name and their clear status OK / NOK. Plus any
exception in case of clearing error.
public method WriteStagingArea (
IN Recid string,
IN RecordKey string,
IN RecordValue string,
INOUT ReturnStatus string
INOUT ReturnInfo string
)

{
jBC: DS.WRITE.STAGING.AREA
}

Write a record to staging area based on provided RecordKey and


RecordValue.
ReturnStatus=0 when record is written.
ReturnStatus=1 when record failed to be written.
ReturnInfo= Any exception in case of write error.

public method ReadStagingArea (


IN Recid string,
INOUT RecordValue string,
INOUT ReturnStatus string
INOUT ReturnInfo string
)

{
jBC: DS.READ.STAGING.AREA
}

Page 11
TAFJ-D SP a c k a g e I n s t all e r

Read a record from staging area based on provided RecordKey.


ReturnStatus=0 when record is read.
ReturnStatus=1 when record failed to be read.
ReturnInfo= Any exception in case of read error.

public method DeleteStagingArea (


IN Recid string,
INOUT ReturnStatus string
INOUT ReturnInfo string
)

{
jBC: DS.DELETE.STAGING.AREA
}

Delete a record from staging area based on provided RecordKey.


ReturnStatus=0 when record is deleted.
ReturnStatus=1 when record failed to be deleted.
ReturnInfo= Any exception in case of delete error.

Defa u l t impl e m e n t a t i o n
A default implementation is provided, to build a staging area made of 2 tables:

- TAFJ.PACKAGE

- TAFJ.PACKAGE.RECORD

TAFJ.PACKAGE stores the technical package entry key as the record key and the path to
the record within the package as the record value.

i.e.

SQL> describe tafj_package;


Name Null? Type
----------------------------------------- --------
----------------------------
RECID NOT NULL VARCHAR2(255)
XMLRECORD CLOB

Page 12
TAFJ-D SP a c k a g e I n s t all e r

RECID
-------------------------------------------------------------------
-------------
XMLRECORD
-------------------------------------------------------------------
-------------
R17_FT_Modelbank_1_JAVA_17.1-2
R17_FT_Modelbank_1_JAVA_17.1/ds-generated/151.xml

TAFJ.PACKAGE.RECORD stores the technical package entry key as the record key and the
file content as the record value.

i.e.

SQL> describe tafj_package_record;


Name Null? Type
----------------------------------------- --------
----------------------------
RECID NOT NULL VARCHAR2(255)
XMLRECORD CLOB

RECID
-------------------------------------------------------------------
-------------
XMLRECORD
-------------------------------------------------------------------
-------------
R17_FT_Modelbank_1_JAVA_17.1-2
<?xml version="1.0" encoding="UTF-8"?>┐<localref:LocalRef
xmlns:xsi="http://www....

Defi n i n g a cu s t o m impl e m e n t a t i o n

It is possible to override this default implementation however in case of component definition


modification DSPackageInstaller.war logic will have to be adapted accordingly and
recompiled to match the expected methods and number of arguments.

Hence it’s important to respect the component definition contract defined above.

Page 13
TAFJ-D SP a c k a g e I n s t all e r

Appli c a t i o n depl o y m e n t

DSPackageInstaller.war deployment is done following the standard web application


capability of the application server used.

i.e. for JBoss 7EAP, webapp deployment.

The DS package staging component must be available within the application classpath.

i.e. for JBoss 7EAP by using tafj module.xml

<resource-root path="/ext/DS_PackageStaging.jar"/>

REST API to int e r a c t with sta g i n g are a

A REST API allowing staging area management and packages read, write and delete
operations, through http.

DSPackageInstaller webapp is secured using BASIC Authentication mechanism, a proper


user with appropriate privilege (TAFJAdmin by default) must be defined within the application
server context.

i.e. for JBoss 7EAP

Make use of ‘add-user’ tooling and create a user part of the TAFJAdmin group.

The application context root is /DSPackageInstaller.

The REST API is documented below and also available online since the application is
deployed. It can be accessed by using following URL: /DSPackageInstaller/html/help.html.

Page 14
TAFJ-D SP a c k a g e I n s t all e r

API de s c r i p t i o n

Pac k a g e ( s ) op er a t i o n s
Design Studio packages are part of the DSPackageInstaller.war webapp and their content
can be browsed by using the following operations.

Requ
est Resource URI Action Description
type

Returns the package


names referenced within
the 'package-list' file.
/ Get /WEB-
These file entries must
GET DSPackageInstaller/resources/p INF/packages/package-list
represent a valid package
ackage content
directory under /WEB-
INF/packages/
{packageName}.

GET / Get /WEB-INF/packages/ Returns the package


DSPackageInstaller/resources/p {packageName}/package-detail records referenced within
ackage/{packageName} content the 'package-detail' file. A
package record entry
format is
{uniqueKey}#{recordPath}
where the record path
must be a valid file path

Page 15
TAFJ-D SP a c k a g e I n s t all e r

under /WEB-
INF/packages/{recordPath}

Returns the record or file


/ content for the specified
Get /WEB-INF/packages/
GET DSPackageInstaller/resources/p recordPath which must
{recordPath} content
ackage/{recordPath} exist under /WEB-
INF/packages/{recordPath}

Sta g i n g are a op er a t i o n s
The DSPackageInstaller staging area is a T24 RDBMS set of tables allowing packages
storage for their installation. The staging area can be created, cleared and dropped by using
the following operations.

Request
Resource URI Action Description
type

Check whether the table(s)


making the staging area
/DSPackageInstaller/resources/ are existing or missing. If
GET Get staging area status
staging they are missing they must
be created prior to any
staging operation.

Triggers the staging area


tables creation, returns a
/DSPackageInstaller/resources/
POST Create staging area successful status if all
staging
table(s) have been created
successfully.

Delete all records from the


staging area tables,
/DSPackageInstaller/resources/
POST Clear staging area returns a successful status
staging/clear
if all table(s) have been
cleared successfully.

Drop all staging area


tables, returns a
/DSPackageInstaller/resources/
DELETE Drop staging area successful status if all
staging
table(s) have been
dropped successfully.

Pac k a g e ( s ) sta g i n g op er a t i o n s

Since the staging area is correctly initialized and valid package(s) are present within
DSPackageInstaller.war it is possible to perform the following write, read and delete
operations.

Page 16
TAFJ-D SP a c k a g e I n s t all e r

Form URL
Request
Resource URI encoded Action Description
type
parameters

For each package part of


package-list, write all
Put all records, part of the
/ package(s) package-detail file to
PUT DSPackageInstaller/resources/st into staging area tables. A
aging/all staging successful status is
area returned when all records
have been written
successfully.

Write all records, part of


the package-detail file
Put a identified by the path
/ package parameter packageName,
PUT DSPackageInstaller/resources/st packageName into to staging area tables. A
aging staging successful status is
area returned when all records
have been written
successfully.

Write a single record,


identified by the form URL
parameters recordKey and
recordPath, to staging area
tables. The recordKey
must be a unique key as
Put a
/ defined in the
recordKey  record into
PUT DSPackageInstaller/resources/st package.detail file, and the
recordPath staging
aging/record recordPath must be the
area
valid path to the record file
under WEB-INF/packages/
{recordPath}. A successful
status is returned when the
records has been written
successfully.

Check whether all records


part of the package-detail
file, identified by the path
parameter packageName,
Get a
are part of the staging area
/ package
tables. Returns the list of
GET DSPackageInstaller/resources/st from
files successfully found in
aging/{packageName} staging
staging area and the list of
area
missing files. Operation
status is success when all
files are present in staging
area.

Page 17
TAFJ-D SP a c k a g e I n s t all e r

Check whether a specific


Get a record identified by the
/ record path parameter recordKey
GET DSPackageInstaller/resources/st from is present in the staging
aging/record/{recordKey} staging area tables. Returns
area success if the record is
present.

For each package part of


package-list, delete all
records part of the
package-detail file from the
Delete all
staging area tables.
/ package(s)
Returns the list of files
DELETE DSPackageInstaller/resources/st from
successfully deleted in
aging/all staging
staging area and the list of
area
files for which it failed.
Operation status is
success when all files have
been deleted.

Delete all records part of


the package-detail file,
identified by the path
parameter packageName,
Delete a
from the staging area
/ package
tables. Returns the list of
DELETE DSPackageInstaller/resources/st from
files successfully deleted in
aging/{packageName} staging
staging area and the list of
area
files for which it failed.
Operation status is
success when all files have
been deleted.

Delete a specific record


Delete a identified by the path
/ record parameter recordKey from
DELETE DSPackageInstaller/resources/st from the staging area tables.
aging/record/{recordKey} staging Returns success if the
area record has been
successfully deleted.

Page 18
TAFJ-D SP a c k a g e I n s t all e r

REST Int er a c t i o n exa m p l e s by usi n g POST MA N cli e n t

Ba s i c aut h e n t i c a t i o n all req u e s t s


First enter the basic authentication parameters, user and password as defined at application
server level for the user having “TAFJAdmin” privileges or equivalent allowing access to
the /DSPackageInstaller root URL. This credentials will be used by all requests.

Che c k sta g i n g are a stat u s


GET request to the root /resources/staging resource.

curl --request GET \


--url
http://localhost:8080/DSPackageInstaller/resources/staging \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \

--header 'postman-token: 9596b48f-3a0f-c1f7-3cb1-f8f149511274'

Page 19
TAFJ-D SP a c k a g e I n s t all e r

If staging area doesn’t exist, status’nok’ is returned with missing tables list.

If it exists, status ‘ok’ is returned with existing tables making the staging area.

Drop th e sta g i n g area


DELETE request to /resources/staging

curl --request DELETE \


--url
http://localhost:8080/DSPackageInstaller/resources/staging \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 63e05ff6-b791-dc13-61ed-41dfe2905b7e' \

If staging area exists and is successfully dropped status ‘ok’ is returned.

Page 20
TAFJ-D SP a c k a g e I n s t all e r

If staging area doesn’t exist yet status’nok’ is returned.

Creat e th e sta g i n g are a


POST request to /resources/staging

curl --request POST \


--url
http://localhost:8080/DSPackageInstaller/resources/staging \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 37f51819-9a15-cf5d-99a2-5a598437a889'

Same than for the requests presented above, response status depends on the existence of
the staging area.

For non-existing staging area status is success: ‘ok’.

Page 21
TAFJ-D SP a c k a g e I n s t all e r

For an already existing staging area status is failure: ‘nok’.

Che c k th e pac k a g e list


To get what are the packages available within the webapp (inferred from package-list file).

GET request to /resources/package

curl --request GET \


--url
http://localhost:8080/DSPackageInstaller/resources/package \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 610bc27e-805a-d968-ebb7-b453ddef12eb'

Page 22
TAFJ-D SP a c k a g e I n s t all e r

If a package-list file is found status ‘ok’ is returned with packages present and available for
staging.

Che c k th e pac k a g e det a i l


To check what are the files available for staging (inferred from the package name and its
related package-detail file).

GET request to /resources/package/{packageName}

Where packageName is a valid name returned from the package list request above.

curl --request GET \


--url
http://localhost:8080/DSPackageInstaller/resources/package/R17_FT_M
odelbank_1_JAVA_17.1 \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 8dae6110-531d-026c-5394-d6d2bd851d0f'

If a package-detail is found for the package name, status ‘ok’ is returned with an array of
records, represented by their technical key and their path within the webapp.

Page 23
TAFJ-D SP a c k a g e I n s t all e r

….

Che c k a rec o r d co n t e n t
To read a file content within the webapp.

GET request to /resources/package/record/{recordPath}

Where recordPath is the path to the record as returned from the package detail above.

Note that path separator have to be escaped and replaced by %2F.

i.e. to access

R17_FT_Modelbank_1_JAVA_17.1/ds-generated/AI.ACCTMANDATE.VIEW.enquiry.xml

Escape separators to

R17_FT_Modelbank_1_JAVA_17.1%2Fds-generated
%2FAI.ACCTMANDATE.VIEW.enquiry.xml

Page 24
TAFJ-D SP a c k a g e I n s t all e r

curl --request GET \


--url
http://localhost:8080/DSPackageInstaller/resources/package/record/R
17_FT_Modelbank_1_JAVA_17.1%2Fds-generated
%2FAI.ACCTMANDATE.VIEW.enquiry.xml \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: d59c7bee-cdc3-dd78-e031-ee1663e3e054'
If the record path exists the record content is returned with
status ‘ok’.

Writ e all pac k a g e ( s ) to th e sta g i n g are a


To write all files part of each package from the package-list (to TAFJ_PACKAGE and
TAFJ_PACKAGE_RECORD with default component implementation).

Place a PUT request to /resources/staging/all

curl --request PUT \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/all \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: e9905ea1-ddb4-be05-9091-8a335305ae4e'

If the staging area has been created and all files are successfully written to the staging area
tables, the list of files persisted with their technical key and path are returned with status ‘ok’.

Page 25
TAFJ-D SP a c k a g e I n s t all e r

Otherwise status will be ‘nok’ with the list of files which have failed to be written.

Writ e a pac k a g e to th e sta g i n g are a


To write all files part of a package to the staging area (to TAFJ_PACKAGE and
TAFJ_PACKAGE_RECORD with default component implementation).

Place a PUT request to /resources/staging

The package to be persisted has to be passed through a “form url encoded” parameter as
shown below with parameter name packageName.

Page 26
TAFJ-D SP a c k a g e I n s t all e r

curl --request PUT \


--url
http://localhost:8080/DSPackageInstaller/resources/staging \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 6a092c9d-334a-2a27-0a8e-3629b68ee796' \
--data packageName=R17_FT_Modelbank_1_JAVA_17.1

If the staging area has been created and all files are successfully written to the staging area
tables, the list of files persisted with their technical key and path are returned with status ‘ok’.

Otherwise status will be ‘nok’ with the list of files which have failed to be written.

Page 27
TAFJ-D SP a c k a g e I n s t all e r

Writ e a sin g l e rec or d


Place a PUT request to /resources/staging/record/

The record to be persisted has to be passed through “form url encoded” parameters as
shown below with parameter name recordKey and recordPath.

Record path, path separators, needs to be escaped, ‘/’, replaced by ‘%2F’ as already
explained.

curl --request PUT \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/record \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 78707c51-ccaf-4cd1-55e3-5c6be2104d89' \
--data 'recordKey=R17_FT_Modelbank_1_JAVA_17.1-
2&recordPath=R17_FT_Modelbank_1_JAVA_17.1%2Fds-generated%2F151.xml'

Page 28
TAFJ-D SP a c k a g e I n s t all e r

Rea d a rec or d fro m th e sta g i n g area .


To check if a record has effectively been persisted, its content can be read from the staging
area by placing a GET request to /resources/staging/record/{recordKey}.

Where recordKey is the technical record key, RECID at staging area level.

curl --request GET \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/record/R
17_FT_Modelbank_1_JAVA_17.1-2 \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 74c5cee1-6b50-4c6b-d7a8-0fa400d01f24'

If it is found status ‘ok’ is returned with record content.

Page 29
TAFJ-D SP a c k a g e I n s t all e r

Rea d a pac k a g e fro m th e sta g i n g are a


To check whether all records part of the package (package-detail entries) are written to the
staging area.

GET request to /resources/staging/{packageName}

Where packageName is the package name as shown in the package-list.

curl --request GET \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/R17_FT_M
odelbank_1_JAVA_17.1 \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 05358b10-d116-aafa-39ff-259551f27aad'

It returns a status ‘ok’ and the list of records successfully written to the staging area.

In case of some records are missing, it means entries present in the package-detail but not
at staging area level, their list will be returned with status ‘nok’.

….

Page 30
TAFJ-D SP a c k a g e I n s t all e r

Clear th e sta g i n g area


To clear all tables part of the staging area issue a POST request to /resources/staging/clear

curl --request POST \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/clear \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 26d33642-6748-efa2-3b88-d297a76e1d02'

Status ‘ok’ with list of tables cleared is returned.

Del e t e all pac k a g e ( s ) fro m th e sta g i n g are a


To delete from the staging area all entries related to all package(s) part of the package-list.

DELETE request to /resources/staging/all

Page 31
TAFJ-D SP a c k a g e I n s t all e r

curl --request DELETE \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/all \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 3e71d9e9-d637-7721-2bab-5150485cd26b' \

Del e t e a pac k a g e fro m th e sta g i n g are a


To delete from the staging area all entries related to a specific package.

DELETE request to /resources/staging/{packageName}

curl --request DELETE \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/R17_FT_M
odelbank_1_JAVA_17.1 \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 503d55f1-deff-75de-a64c-898d00e32593' \

Page 32
TAFJ-D SP a c k a g e I n s t all e r

Del e t e a sin g l e rec o r d fro m th e sta g i n g are a


DELETE request to /resources/staging/record/{recordKey}.

curl --request DELETE \


--url
http://localhost:8080/DSPackageInstaller/resources/staging/record/R
17_FT_Modelbank_1_JAVA_17.1-1 \
--header 'authorization: Basic dGFmajp0YWZqITIwMTY=' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'postman-token: 8ecbee0d-c249-fb57-08c3-25ed2d3a582f' \

DS Pac k a g e r Inst a l l e r servl e t

All API operation described in former section are available through the following servlet
(webapp root).

/DSPackageInstaller/

Page 33
TAFJ-D SP a c k a g e I n s t all e r

Same basic authentication rules apply and a valid user part of appropriate group (default
‘TAFJAdmin’) must be used to login.

Sta g i n g are a ma n a g e m e n t
On first access, the staging area will be reported as not initialized and the missing tables are
listed.

Page 34
TAFJ-D SP a c k a g e I n s t all e r

It needs to be created by clicking “Create”.

Since creation succeed, a new status is available and service output is being displayed in a
text area.

It is now possible to “Clear” and eventually “Drop” it on demand.

Pac k a g e par s i n g op e r a t i o n s

If there are some packages present within the webapp they will be in the second part of the
servlet.

Page 35
TAFJ-D SP a c k a g e I n s t all e r

In the example above, we have a webapp containing a “package-list” referencing two


packages.

None of them has been written to staging area yet.

“View” operations are available at package and package entry level. They are outputting the
webapp content.

Clicking “View” at package level will return the related “package-detail” content if present
within the webapp.

The expected path is /WEB-INF/packages/{packageName}/package-detail

Clicking “View” at package entry level will return the related package entry content if present
within the webapp under the specified path (second part, after ‘#’ sign, of the package entry).

The expected path is /WEB-INF/packages/{packageEntryPath}

Pac k a g e sta g i n g op er a t i o n s

All “Read”, “Write” and “Delete” operations are staging area operations.

They are available at package level and at package-entry level if needed.

It is also possible to stage or remove from staging all package(s) part of the package list with
a single call.

Page 36
TAFJ-D SP a c k a g e I n s t all e r

The above action of “Read” on package “R17_FT_ModelBank_1_JAVA_17.0” will check


whether all package entries are part of the staging area tables.

Since they are not, a failure status is returned and all files which are not part of the staging
area are reported as “FileNOk”.

Performing the below “Write” action on same package will write all package entries to staging
area.

If all entries are written successfully, the returned status is success along the list of package
entries successfully processed as “FileOk”.

In case of files not successfully written, they would be reported as “FileNOk” and final status
would be failure.

The package status is now reported as “OK al file(s) are part of staging area”.

Page 37
TAFJ-D SP a c k a g e I n s t all e r

It is now possible to trigger “Read” action, which is now returning success since all package
entries are found in staging area tables.

To access the staging area content for a package entry, simply trigger a “Read” action at
package entry level.

The staging area record content will be displayed.

Page 38
TAFJ-D SP a c k a g e I n s t all e r

All staging area entries for a specific package can be deleted by clicking the “Delete” button
at package level as shown below.

On successful deletion of all package entries a successful status is returned.

Same action can be triggered at package entry level to delete a specific record from staging
area.

Page 39
TAFJ-D SP a c k a g e I n s t all e r

Reading the package from staging area will now report the missing record in the “FileNOk”
list since it has been deleted.

The global package status is also changed to “NOK some file(s) are missing in staging area”.

To write this package entry only, simply trigger the “Write” action at record level.

Page 40
TAFJ-D SP a c k a g e I n s t all e r

The record is successfully written to staging area and the global package status is changed
to “OK” since all package entries are now staged.

Page 41

You might also like