Skip to main content
Version: 2.0.0

Creating UIs for the client

warning

This feature is work in progress. It will be added after the first release.

Example

With Caesar, you're able to create Caesar client pages just with JSON. The following JSON shows almost every possibility of this framework:

{
"tabName": "ExampleModule",
"icon": {
"enableIcon": true,
"iconURL": "https://example.com/icon.png"
},
"version": "1.0-SNAPSHOT",
"tabContent": {
"columnAmount": 1,
"column1": {
"permissionNeeded": true,
"components": [
{
"type": "header",
"size": 1,
"value": "Test Column 1",
"viewCondition": "true",
"minX": 100,
"minY": 50
},
{
"type": "container",
"dataSource": {
"type": "mysql",
"username": "root",
"password": "$config.mysql.password$",
"host": "localhost",
"port": 3306,
"dbName": "test",
"tableName": "test_table"
},
"viewCondition": "true",
"minX": 100,
"minY": 200
},
{
"type": "label",
"value": "That's a test",
"viewCondition": "true",
"minX": 100,
"minY": 50
},
{
"type": "button",
"value": "That's a test",
"viewCondition": "true",
"disableCondition": "false",
"minX": 100,
"minY": 50,
"toolTip": "Nothing to see here.",
"disabled": false,
"action": "example.button1"
},
{
"type": "image",
"url": "local::modules/example/image.png",
"alt": "Alternatie Text",
"viewCondition": "true",
"minX": 100,
"minY": 50
},
{
"type": "panel",
"direction": "HORIZONTAL",
"viewCondition": "true",
"minX": 300,
"minY": 100,
"content": "panel1"
}
]
},
"panel1": {
"components": [
{
"type": "header",
"size": 2,
"value": "Panel header",
"viewCondition": "true",
"minX": 100,
"minY": 50
}
],
"viewCondition": "true"
}
},
"actions": [
{
"name": "button1",
"type": "display",
"display": {
"type": "dialog_info",
"title": "Example Dialog",
"description": "This is just an example",
"acceptOK": true,
"acceptDeny": true,
"buttons": [
{
"name": "otherbutton",
"value": "Another Option",
"minX": 200,
"action": "button1.display.other"
}
]
}
},
{
"name": "button1.display.other",
"type": "execute",
"execution": {
"type": "database",
"statement": "INSERT INTO example.example (ID) VALUES('Test');",
"awaitResponse": true,
"onlyDisplayResponseError": true
}
}
]
}

JSON Documentation

Important general definitions

NameDescriptionPossible values
pageNameThe name of the pageString
iconSets an icon for your page in the sidebar.Icon
versionImportant for versioning.String
pageContentContent of the page goes here.PageDefinition
actionsActions to perform are going hereList of actions

pageContent

Here we define all the content displayed in the page. With columnAmount we define, how much columns should be used. Depending on the amount, you must define column elements. Example: We define a columnAmount of 3. pageContent must have these child nodes:

  • column1
  • column2
  • column3

In addition, you can define panels. They get the following options:

Components - A list of components to display.

Components

Default definition

Every object (component) needs specific settings.

NameDescriptionTypeDefault Value
typeThe type of the component.Stringnone
minXMinimum component size (X)Integer100
minYMinimum component size (Y)Integer100
viewConditionCondition for the object to be displayedStringtrue
Text Components   
valueDisplay valueStringEmpty text
Input Components   
disableConditionCondition when user input should be blockedStringfalse

Type: Database

With the action type Database, SQL queries can be executed on a database. The database connection settings are not passed directly, but rather a DatabaseConnection. This connection is server-side and controlled there. Here's an example of a simple database operation that modifies a value:

{
"database": {
"connection": "exampleConnection",
"database": "example",
"table": "process_validation",
"sql": "UPDATE {tbl} SET valid = 1 WHERE {var1} = 0",
"variables": [
{
"short": "tbl",
"replace": "var$table"
},
{
"short": "var1",
"replace": "valid"
}
]
}
}

This example shows the configuration of a database query. Important: Variables are used here. They are inserted into the text as {VarName} and defined in variables. They can be replaced by a string (like the variable var1 in the example) or dynamically.


Definition type: header

A header. In addition to the standard definitions, it also has these values:

NameDescriptionTypeDefault Value
sizeTitle sizeInteger1-5

Label

Definition type: label

A simple text. It has no additional values beyond the standard definitions.

Button

Definition type: button

A button. In addition to the standard definitions, it also has these values:

NameDescriptionTypeDefault Value
themeDisplay theme pathStringthemes/default
toolTipTooltip shown when hovering with the mouseStringempty
disabledDefines the button as not interactable regardless of disableCondition. State can be updated by changing the condition result.booleanfalse
actionAction to be executed. The name is defined in actions.Stringempty

Container

Definition type: container Displays data as a table. In addition to the standard definitions, it also has these values:

NameDescriptionTypeDefault Value
dataSourceSpecifies the data sourceDataSourceempty
DataSource
typeSpecifies the data source typeString, - "mysql" - "mssql" - "json"empty
usernameDatabase usernameStringempty
passwordDatabase user passwordStringempty
hostDatabase server IPStringlocalhost
portDatabase server portInteger3306
dbNameDatabase nameStringtabula
tableNameTable/View name to accessStringempty
customStatementA custom statement for data queries. The statement must be SELECT.Stringempty
whereConditionsList of WHERE conditionsList of Stringempty
whereConditionCustom WHERE conditionStringempty

Panel

Definition type: panel A panel. In addition to the standard definitions, it also has these values:

NameDescriptionTypeDefault Value
directionPanel layout. Possible values: HORIZONTAL; VERTICALStringHORIZONTAL
contentThe name of the defined panelStringempty

Image

Definition type: image An image. In addition to the standard definitions, it also has these values:

NameDescriptionTypeDefault Value
urlURL of the image file. See URL Definitions for detailsStringlocal::empty
altAlt text displayed when the image file cannot be loadedStringempty

Actions

In Tabula, actions can be defined that can be executed under certain conditions.

NameDescriptionTypeDefault Value
nameThe name/ID of the actionString
typeThe type of the action. It can be one of the values below.String
[type-action]Values for the specific type are defined here. See below.Type

Action Types

An action can have different types. These are the action types:

  • display: Shows a dialog/message.
  • database: Executes an action in a database instance.
  • execute: Executes a server-side script.
  • cexecute: Executes a client-side script.
  • http: Executes an HTTP request to a server.
  • sound: Plays a sound.
  • file-export: Saves data optionally as a CSV or JSON file.

Depending on the type, an additional field section must be defined in the action declaration named after the type. Here are two examples:

{
"type": "display",
"display": {
"options": "here"
}
}
{
"type": "database",
"database": {
"options": "here"
}
}

Type: Display

Display has further subtypes:

  • dialog_info
  • dialog_hint
  • dialog_warn
  • dialog_error
  • dialog_critical
  • toast_info
  • toast_hint
  • toast_warn
  • toast_error

Dialogs are windows that open and can be interacted with. Toasts are notifications shown at the top edge of the window.

A display field contains the following fields:

NameDescriptionApplied To
titleTitle displayed at the window edge of the dialog boxDialogs
descriptionDescription shown in the dialog window or in the notificationDialogs/Notifications
acceptOKCreates a default "OK" button if true. For buttons, see [Buttons](#buttons).Dialogs
acceptDenyCreates a default "Cancel" button if true. For buttons, see [Buttons](#buttons).Dialogs
buttonsA list of buttons to display. See [Buttons](#buttons) for more.Dialogs
displayTimeSpecifies how long the notification should be visible. Values are in milliseconds. Minimum value: 500, Default: 2000Notifications

DButtons

DButtons are declared for dialog boxes. They are distinguished by the D for Dialog from regular button components. They still share some similarities with their fields:

NameDescriptionValue TypeDefault ValueRequired?
nameThe unique name of the buttonStringnone
valueThe text displayed on the buttonStringempty
minXThe minimum horizontal size of the buttonInteger200
positionThe relative position of the button in the dialog"Integer, Integer"Automatically calculated
actionThe action ID of the action to be executed when the button is clickedStringnone
disable-conditionCondition when the button can be clickedBooleanfalse
type(Optional, if another input type is requested)Stringbutton

Type: Database

With the action type Database, SQL queries can be executed on a database. The database connection settings are not passed directly, but rather a DatabaseConnection. This connection is server-side and controlled there. Here's an example of a simple database operation that modifies a value:

{
"database": {
"connection": "exampleConnection",
"database": "example",
"table": "process_validation",
"sql": "UPDATE {tbl} SET valid = 1 WHERE {var1} = 0",
"variables": [
{
"short": "tbl",
"replace": "var$table"
},
{
"short": "var1",
"replace": "valid"
}
]
}
}

This example shows the configuration of a database query.

tip

Variables are used here. They are inserted into the text as {VarName} and defined in variables. They can be replaced by a string (like the variable var1 in the example) or dynamically calculated via a function.

Type: Execute

With execute as an action, server-side scripts can be executed. A list of the system-declared scripts can be found here. An action of type execute only contains one additional field: script with the ID of the script or a path.

Type: CExecute

With cexecute, client-side scripts are executed. More about Client Scripts. An action of type cexecute only contains one additional field: script with the ID of the script or a path.

Type: HTTP

The http type allows requests to be sent to HTTP(S) servers. These are the fields that can be passed:

NameDescriptionValue TypeDefault ValueMust be declared?
methodThe HTTP method to be used for the request. See HTTP for more information.StringGET
customheadersCustom request headersString-Arrayempty
resulthandlerA list of ResultHandlers. See ResultHandler for more.List of ResultHandlerempty
urlThe query URLStringlocalhost

Type: Execute

With execute as an action, server-side scripts can be executed. A list of the system-declared scripts can be found [here](#).
An action of type execute only contains one additional field: script with the ID of the script or a path.

Type: CExecute

With cexecute, client-side scripts are executed. More about [Client Scripts](#).
An action of type cexecute only contains one additional field: script with the ID of the script or a path.

Type: HTTP

The http type allows requests to be sent to HTTP(S) servers. These are the fields that can be passed:

NameDescriptionValue TypeDefault ValueMust be declared?
methodThe HTTP method to be used for the request. See HTTP for more information.StringGET
customheadersCustom request headersString-Arrayempty
resulthandlerA list of [ResultHandler](https://chatgpt.com/c/68109b55-1eb4-8012-9a92-d41c5ac9b100#)s. See ResultHandler for more.List of ResultHandlerempty
urlThe query URLStringlocalhost

ResultHandler
A ResultHandler is specified as an element of a list, as there are many HTTP status codes. Here's an example handler:

{
"code": 200,
"actions": [
"exampleResultActionID"
]
}

Type: Sound

With the sound type, sounds can be played. There are two types of sounds:

  • Local sounds: Used to play sounds that are stored within the software.
  • External sounds: These are sounds downloaded by the Tabula module.
  • Cloud sounds: Sound files that need to be downloaded first. Important: Cloud sounds become external sounds after the first use. They can still be retrieved as cloud sounds, but without the forceupdate field, the local (external) sound file will be played automatically.

A Sound can also have the following additional fields:

NameDescriptionValue TypeDefault ValueMust be declared?
resourceThe sound resource type. Allowed values are local, external, and cloud.String
pathThe path/ID/URL of the sound fileString
loopThe number of times the sound should repeat consecutively. -1 disables repetitions.Integer0
loop-delayThe pause between repetitions in millisecondsInteger0
volumeThe volume. Percentage (%).Float10
pitchThe playback speedFloat1
clearafterplayIndicates whether the sound should be unloaded after playback.Booleantrue
warning

Setting the clearafterplay value to false with many sounds may produce performance problems.

Type: File Export

file-export exports the current data as a JSON or CSV file.