TUTORIALS

Tutorials to get you started with ESDK App Development.

VERY FIRST SIMPLE APP

Are you wondering how to start your ESDK App development project? In this tutorial we will demonstrate how to build a very simple ESDK App using the ESDK Project Builder, a dockerized abas ERP client and Nexus Artifact Server and abas Tools.

Implementation-wise this is a very simple project. It only consists of an Infosystem with very basic logic. On start button after the head field is evaluated and a Hello-World message is generated in the table field.

However, the tutorial starts right at the beginning. First, a dockerized abas ERP client is started and the Infosystem is created. Then the ESDK Project Builder is used to generate the basic ESDK project structure. The Infosystem's logic is implemented and changes are installed in the abas client and exported from the abas client using the ESDK Gradle Plugin tasks. In the end an ESDK App is created and installed using the ESDK App Installer.

The Infosystem from the example project is configured as follows:

Search Word
ESDKTEST
Description
Test IS for ESDK
Working directory
ow1
Classname
EsdkTest
Field
testhead
Type
GL10
Field
testrow
Type
GL100

The EventHandler for the Infosystem contains the following logic:

package
de.abas.esdk.app;
import
de.abas.erp.axi2.EventHandlerRunner;
import
de.abas.erp.axi2.annotation.ButtonEventHandler;
import
de.abas.erp.axi2.annotation.EventHandler;
import
de.abas.erp.axi2.type.ButtonEventType;
import
de.abas.erp.db.DbContext;
import
de.abas.erp.db.infosystem.custom.ow1.EsdkTest;
import
de.abas.erp.jfop.rt.api.annotation.RunFopWith;
@EventHandler
(head = EsdkTest.
class
, row = EsdkTest.Row.
class
)
@RunFopWith
(EventHandlerRunner.
class
)
public class
EsdkTestEventHandler {
@ButtonEventHandler
(field =
"start"
, type = ButtonEventType.
AFTER
)
public void
startAfter(DbContext
ctx
, EsdkTest
head
) { String
testhead
=
head
.getTesthead();
head
.table().clear(); EsdkTest.Row
row
=
head
.table().appendRow();
row
.setTestrow(
"Hello, "
+
testhead
+
"!"
); } }

CONVERT EXISTING COMPONENTS INTO AN APP

Are you wondering how to start your ESDK App development project? In this tutorial we will demonstrate how to convert your existing additional database into an ESDK App using the ESDK Project Initializer and abas Tools.

Implementation-wise this is a very simple project. It only consists of four event handlers with very basic logic and integration tests.

However, the tutorial starts right at the beginning. First, the ESDK Project Initializer is used to generate the basic ESDK project structure. Then the additional database and its screen gets exported using the ESDK Gradle Plugin tasks. After that, some logic is developed and the ESDK App gets installed and a standalone App JAR is created.

The EventHandler for the DatabaseScreen contains the following logic:

package
de.abas.esdk.app;
import
import java.math.BigDecimal;
import
import de.abas.eks.jfop.annotation.Stateful;
import
import de.abas.erp.axi.event.EventException;
import
import de.abas.erp.axi.screen.ScreenControl;
import
import de.abas.erp.axi2.EventHandlerRunner;
import
import de.abas.erp.axi2.annotation.EventHandler;
import
import de.abas.erp.axi2.annotation.FieldEventHandler;
import
import de.abas.erp.axi2.annotation.RowEventHandler;
import
import de.abas.erp.axi2.annotation.ScreenEventHandler;
import
import de.abas.erp.axi2.event.FieldEvent;
import
import de.abas.erp.axi2.event.RowEvent;
import
import de.abas.erp.axi2.event.ScreenEvent;
import
import de.abas.erp.axi2.type.FieldEventType;
import
import de.abas.erp.axi2.type.RowEventType;
import
import de.abas.erp.axi2.type.ScreenEventType;
import
import de.abas.erp.common.type.enums.EnumEditorAction;
import
import de.abas.erp.db.DbContext;
import
import de.abas.erp.db.schema.custom.kpi.KPIEditor;
import
import de.abas.erp.jfop.rt.api.annotation.RunFopWith;
@EventHandler
(head = KPIEditor.
class
, row = KPIEditor.Row.
class
)
@RunFopWith
(EventHandlerRunner.
class
)
@Stateful
public class
KPIEventHandler {
int
rowCounter
= 0;
@ScreenEventHandler
(type = ScreenEventType
.ENTER
)
public void
rowDeletionAfter(ScreenEvent
event
, ScreenControl
screenControl
, DbContext
ctx
, KPIEditor
head
)
throws
EventException { EnumEditorAction
command
=
event
.getCommand(); if (
command
.equals(EnumEditorAction.
New
) ||
command
.equals(EnumEditorAction.
Edit
)) {
rowCounter
=
head
.table().getRowCount(); } }
@ScreenEventHandler
(type = ScreenEventType
.VALIDATION
)
public void
rowDeletionAfter(ScreenEvent
event
, ScreenControl
screenControl
, DbContext
ctx
, KPIEditor
head
)
throws
EventException { EnumEditorAction
command
=
event
.getCommand(); if (
command
.equals(EnumEditorAction.
New
) ||
command
.equals(EnumEditorAction.
Edit
)) {
if
(
rowCounter
<= 1) {
throw new
EventException(
"Row count has to be two."
, 1); } } }
@RowEventHandler
(type = RowEventType
.DELETION_AFTER
)
public void
rowDeletionAfter(RowEvent
event
, ScreenControl
screenControl
, DbContext
ctx
, KPIEditor
head
)
throws
EventException { EnumEditorAction
command
=
event
.getCommand(); if (
command
.equals(EnumEditorAction.
New
) ||
command
.equals(EnumEditorAction.
Edit
)) {
rowCounter
--; } }
@RowEventHandler
(type = RowEventType
.INSERTION_BEFORE
)
public void
rowDeletionAfter(RowEvent
event
, ScreenControl
screenControl
, DbContext
ctx
, KPIEditor
head
)
throws
EventException { EnumEditorAction
command
=
event
.getCommand(); if (
command
.equals(EnumEditorAction.
New
) ||
command
.equals(EnumEditorAction.
Edit
)) {
if
(
rowCounter
>= 2) {
throw new
EventException(
"Row count has to be two."
, 1); }
rowCounter
++; } } }