Child pages
  • Servoy Concepts

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
This chapter provides an overview of the anatomy of a Servoy solution.

A *Solution* is is a single application. It contains *Forms*, *Business Logic* and *datalayer definitions.*

A *Form* is an object that provides a UI and/or contains business logic. The UI of a form is built up of *Form Parts*, which in turn contain *elements*.

Form Parts are horizontal regions of the UI, like a header, a body and a footer.

*Elements* are UI components like fields, labels, buttons etc, or *container* elements, like a TabPanel, SplitPane or TablessPanel. Containers contain other forms, thus allowing the nesting of forms.

*Business Logic* is written in JavaScript and the an individual piece of business logic is called a *Function*.

Functions are grouped together in *scopes*. Inside a Servoy solution, there is the solution

...

Solution  

In Servoy an application is called a Solution and as such is a container for business logic and UI.

UI

A UI in Servoy is called a Form.  

Business logic

The business logic, made up of variables and methods, is is organized in scopes. A solution has three distinct scope levels:

Application scope:
A solution has one application scope (also referred to as Top Level scope). This scope contains all the predefined scripting libraries that come with Servoy and also contains a customizable scope called "globals" in which custom business logic can be placed that should be accessible through the solution 

Datasource scope:
Below the application scope come the datasource scopes. In general each table (or view) in a database to which the solution has access is considered a datasource. In the datasource scope extensions to the datasource can be defined, in the form of table events and calculations 

Form scope:
Each form has it's own scope for business logic. If a Form is tied to a datasource, the Form scope extends from the datasource scope

Form

In Servoy a UI is called a Form. Forms consist of Form parts and the parts contain elements, like labels, buttons and fields.

Forms can have three different layouts:

Record View:

List View:

Table View:

Abstract forms

Inheritance

Containers

Element
Media
Scripting API

application:

solutionModel:
The SolutionModel class exposes all scripting API related to the on-the-fly generation and modification at runtime of the 

databaseManager:

utils:

history:

security:

i18n:

ServoyException:

jsunit:

plugins:

...

-wide *globals* scope and multiple *form scopes*: one for each form.

The *datalayer definitions* inside a solution are *valuelists* and *relations*.

*ValueLists* are objects to translate internal values of the solutions into displayable values that make sense to the user. For example the translation of an product_id to a product_description value


*Relations* are links between 2 *datasources.*

A *datasource* is typically a table in a database. Each column in the table is called a *dataprovider *inside Servoy. Besides dataproviders that are columns in tables in a database, other types of dataproviders are: *calculations*, *aggregations*, 

/*\*
 \* Calculate the row background color.
 \*
 \* @param {Number} index row index
 \* @param {Boolean} selected is the row selected
 \* @param {String} elementType element type
 \* @param {String} dataProviderID element data provider
 \* @param {Boolean} edited is the record edited
 \*
 \* @returns {Color} row background color
 \*
 \* @properties={type:12,typeid:36,uuid:"5A83465B-BF05-453A-8FDF-FF87D688D913"}
 */
function rowBGColorCalc(index, selected, elementType, dataProviderID, edited)
{
// if (globals.test == 0) {
// return '#ff0000'
// }
// return '#ffffff' var id = amt_discount if (id < 10) { if (globals.test) { return '#ff0000' } else { return '#ff0080' } } else if (id < 20) { return '#80ff00' } else { return '#ffff80' }
}
and *form variables*.

h5. Solution &nbsp;

In Servoy an application is called a Solution and as such is a container for business logic and UI.

*UI*

A UI in Servoy is called a Form. &nbsp;

*Business logic*

The business logic, made up of variables and methods, is is organized in scopes. A solution has three distinct scope levels:


_Application scope_:
A solution has one application scope (also referred to as Top Level scope). This scope contains all the predefined scripting libraries that come with Servoy and also contains a customizable scope called "globals" in which custom business logic can be placed that should be accessible through the solution&nbsp;

_Datasource scope_:
Below the application scope come the datasource scopes. In general each table (or view) in a database to which the solution has access is considered a datasource. In the datasource scope extensions to the datasource can be defined, in the form of table events and calculations&nbsp;

_Form scope_:
Each form has it's own scope for business logic. If a Form is tied to a datasource, the Form scope extends from the datasource scope



h5. Form

In Servoy a UI is called a Form. Forms consist of Form parts and the parts contain elements, like labels, buttons and fields.

Forms can have three different layouts:

_Record View_:

_List View_:

_Table View_:

Abstract forms

Inheritance

Containers

h5. Element


h5. Media


h5. Scripting API

_application_:



_solutionModel_:
The SolutionModel class exposes all scripting API related to the on-the-fly generation and modification at runtime of the&nbsp;

_databaseManager_:



_utils_:



_history_:



_security_:



_i18n_:



_ServoyException_:



_jsunit_:



_plugins_:




h5. Data layer