Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

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

R18
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

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

Table of Contents
Goal........................................................................................................................................................ 5
Principle.................................................................................................................................................. 5
Package structure within the webapp..................................................................................................... 6
Package-list file..................................................................................................................... 7
Package-detail file................................................................................................................. 7
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.................................................................................................................... 14
Package(s) operations..................................................................................................... 14
Staging area operations................................................................................................... 15
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..................................................................................................... 21
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........................................................................................................ 26
Read a record from the staging area............................................................................... 27
Read a package from the staging area........................................................................... 28
Clear the staging area..................................................................................................... 29
Delete all package(s) from the staging area.................................................................... 30
Delete a package from the staging area.......................................................................... 30
Delete a single record from the staging area................................................................... 31

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

DS Packager Installer servlet............................................................................................................... 32


Staging area management.................................................................................................. 33
Package parsing operations................................................................................................ 33
Package staging operations................................................................................................ 34

Page 4
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 5
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 6
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 is 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.

R17_FT_Modelbank_1_JAVA_17.0-9.xml#R17_FT_Modelbank_1_JAVA_17.0/ds-
generated/PP.STANDING.ORDER.enquiry.xml

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

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

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

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.

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
}

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

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
}

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.

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

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
}

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:

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

- 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

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....

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

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.

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"/>

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

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.

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.

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

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}.

Returns the package


records referenced within
the 'package-detail' file. A
package record entry
/ Get /WEB-INF/packages/
format is
GET DSPackageInstaller/resources/p {packageName}/package-detail
{uniqueKey}#{recordPath}
ackage/{packageName} content
where the record path
must be a valid file path
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.

POST /DSPackageInstaller/resources/ Clear staging area Delete all records from the

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

staging area tables,


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.

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.

PUT / recordKey  Put a Write a single record,


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

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

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.

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 / Delete a Delete a specific record


DSPackageInstaller/resources/st record identified by the path
aging/record/{recordKey} from parameter recordKey from
staging the staging area tables.
area Returns success if the

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

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'

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

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

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.

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

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

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’.

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

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

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'

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'

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

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.

….

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 23
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’.

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

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

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.

curl --request PUT \

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

--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.

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.

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/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'

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'

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

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

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 28
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.

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

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

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}

Page 30
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/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' \

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' \

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

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/

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

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

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.

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 33
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 34
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 35
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 36
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 37
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.

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 38
TAFJ-D SP a c k a g e I n s t all e r

Page 39

You might also like