Skip to main content
Version: 7.0

System

System is the root system module of the platform. It is pulled in automatically — every other module depends on it without an explicit REQUIRE. The module declares the root classes, the standard groups of properties and actions, the change-session control surface, the incoming HTTP-request context, the form-lifecycle actions, the application-identity properties, and the local buffers that the export, import, and value-request operators write to.

Root classes​

ClassPurpose
Objectthe base class of all user objects; parent of all user-defined classes
StaticObjectthe base class for static objects (values declared in the module's source)
CustomObjectClassmeta-class object: every user class is represented here by one static object that carries statistics and skeleton properties

Standard groups​

root / public / private are the roots of the group hierarchy. base (inside public), id (inside base), uid (inside id) are the standard subgroups for key properties. drillDown and propertyPolicy are separate roots for drill-down properties and access-policy properties. objects is a group typically used for properties that collect JSON structures in interactive forms.

Object metadata​

class[Object] — the class of an object (as a CustomObjectClass). className[Object] — the class name as STRING. prevClassName[Object] — same, for the class value at the start of the session. For static objects: name[StaticObject] (name), caption[StaticObject] (display caption), order[StaticObject] (sort order), image[StaticObject] (picture). For a class as a whole: stat[CustomObjectClass] — estimated object count.

Change-session control​

Property / actionWhat it does
apply[] / cancel[]wrappers over the APPLY and CANCEL operators
canceled[]flag set when the last APPLY was cancelled by a constraint
applyMessage[]error message of the last APPLY (filled in by the platform itself)
ApplyFiltera class with filter shortcuts: onlyCalc, onlyCheck, onlyData, session, withoutRecalc
applyFilter[] / applyOnlyCalc[] / applyOnlyCheck[] / applyOnlyData[] / applySession[] / applyOnlyWithoutRecalc[] / applyAll[]set / clear the filter for the next APPLY
check[]run APPLY under the onlyCheck filter with guaranteed filter restoration
sessionOwners[] / manageSession[]the count of session owners and the flag for being a standalone session
throwException[TEXT]raises an exception with the given message
setNoCancelInTransaction[] / dropNoCancelInTransaction[]forbid / re-allow rollback inside a transaction
setNoEventsInTransaction[] / dropNoEventsInTransaction[]forbid / re-allow events inside a transaction
executeLocalEvents[TEXT] / executeLocalEvents[]force-run local events (optionally by filter)
beforeCanceled[] / requestCanceled[] / requestPushed[]request-lifecycle flags
logMessage[]message emitted into the system log on certain events
empty[] / empty[Object]no-op actions

Under the onlyCheck filter the apply transaction runs only the handlers that can cancel the apply — constraint checks among them — and what they depend on, directly or through other handlers: the event handlers changing the properties they read and the updates of the materializations they read. The other handlers and deferred actions are not executed, and after the checks the transaction is rolled back: nothing is written to the database, the changes of the handlers are rolled back with it, the session changes made before the apply remain, and canceled[] and applyMessage[] carry the result. This makes check[] a trial constraint check, but its outcome can differ from a real apply, which runs all the handlers.

HTTP request context​

The platform fills the following NESTED LOCAL properties from an incoming HTTP request and reads the response ones when answering it. The last group serves the outgoing calls to an external system: local properties declared without NESTED, and the calculated failedHttp[].

Incoming request: headers[TEXT], cookies[TEXT], params[TEXT, INTEGER] (and the shortcut params[TEXT]), fileParams[TEXT, INTEGER] / fileParams[TEXT], actionPathInfo[], contentType[], body[], appHost[], appPort[], exportName[], method[], scheme[], webHost[], webPort[], contextPath[], servletPath[], pathInfo[], query[].

Outgoing response: headersTo[TEXT], cookiesTo[TEXT], statusHttpTo[].

Derived URLs: origin[] (scheme://webHost:webPort), webPath[] (origin + contextPath), url[] (webPath + servletPath + pathInfo), apiOriginUrl[STRING] / apiOriginUrl[LINK] (API URL relative to origin), apiContextUrl[STRING] (API URL relative to webPath).

Calls to an external system: timeoutHttp[] and insecureSSL[] are read before an HTTP call, and the status of its response is written to statusHttp[] (errors). failedHttp[] is TRUE when statusHttp[] is below 200 or at least 300. timeoutTcp[] is read before a TCP call, and responseTcp[] receives its response.

Caught-exception state​

Inside a CATCH block, messageCaughtException[], javaStackTraceCaughtException[], lsfStackTraceCaughtException[] give the message, the Java stack trace, and the lsFusion stack trace of the most recently caught exception.

Pausing execution​

sleep[LONG] pauses the current action for the given number of milliseconds. Only the thread executing the action waits: the change session and its unsaved changes stay as they are, and the other threads of the server, including new threads and scheduler tasks, keep running. A cancellation request from the process monitor ends the pause with an error.

open[STRING] / open[FILE] / open[NAMEDFILE] / open[RAWFILE] / open[LINK] / open[RAWLINK] (with shorter overloads for the file name and the noWait flag) open the given value on the client in the associated application or browser.

htmlLinkInTab[HTMLLINK] opens an HTML link in a separate tab. The htmlLinkInTab form hosts the HTML viewer itself.

Form lifecycle​

Property / actionWhat it does
formApply[]apply (save) the form's changes (Alt+Enter)
formCancel[]cancel the form's changes (Shift+Esc)
formRefresh[]re-read the form's data (F5)
formOk[]confirm and close a dialog (Ctrl+Enter)
formClose[]close the form (Esc)
formDrop[]drop the current form object (Alt+Delete)
formEditReport[]edit the form's report template (Ctrl+E)
formShare[] / formCustomize[]share the current state / open the form customization
formCustomizeBackground[] / formCustomizeShowIf[]abstract properties (ABSTRACT COLOR() / ABSTRACT BOOLEAN()) used to customize the form-customization dialog
formApplied[]abstract list of actions called after a successful form APPLY (the default shows a success notification)
navigatorRefresh[]refresh the navigator
forceUpdate[STRING]apply the pending update of an object group (given by its name on the form) that is in manual update mode
seek[Object]locate and activate an object on the current form

Form context flags​

isActiveForm[], isDocked[], isEditing[], isAdd[], isManageSession[], isExternal[], showOk[], showDrop[], isDataChanged[] reflect the state of the current form and its interaction with the session. isEditable[] / isReadonly[] track whether the form is editable.

Polymorphic edit and delete​

edit[Object] and delete[Object] are declared as abstract actions with default implementations (SHOW EDIT and DELETE) and are available for extension by specific user classes. formEdit[Object] is a direct pass-through to edit[Object]. formEditObject[Object] wraps formEdit[Object] in NEWSESSION only when the object already exists in the database (PREV(o IS Object)), and calls formEdit[Object] directly otherwise. formDelete[Object] calls delete[Object] directly when sessionOwners[] is set. Otherwise it shows a confirmation prompt and on confirmation runs delete[Object] followed by APPLY.

Local buffers​

The platform provides three parallel sets of local properties for different exchange stages:

  • export… — where EXPORT writes its intermediate result. One property per built-in class: exportObject[], exportInteger[], exportLong[], exportDouble[], exportNumeric[], exportString[], exportText[], exportRichText[], exportHTMLText[], exportDate[], exportTime[], exportDateTime[], exportZDateTime[], exportYear[], exportBoolean[], exportTBoolean[], exportInterval<Type>[] for every interval class, exportColor[], exportJSON[] / exportJSONText[], exportXML[], exportHTML[], and the matching export<Class>File[] / export<Class>Link[] for every file and link class.
  • requested… — the same buffers declared as NESTED for batched value prompts (INPUT / REQUEST).
  • Import: importFile[] — the file a form is imported from by default. imported[INTEGER] and importedString[STRING[10]] — the mark that the corresponding "row" was read from the file: imported[INTEGER] is the default condition of data import, and form import fills it only when it is used in a filter of the form. inputList[INTEGER] / displayInputList[INTEGER] — the buffer of list values and captions. readFile[], readDialogPath[], showResult[] — the results of file reading, path selection, and message display.

Application identity​

logicsName[] (from dataLogicsName), logicsCaption[], topModule[], displayName[] (computed as dataDisplayName ?? logicsCaption ?? topModule) — the application's name, caption, and display name. hashModules[] — the hash of the module set the server sees as initialized.

Graphics: logicsLogo[] (logo image), logicsIcon[] (application icon), PWAIcon[] (PWA icon, expected 512×512). Each comes with a triple load<Name>[] / open<Name>[] / reset<Name>[].

UI defaults​

PropertyPurpose
defaultBackgroundColor[] / defaultOverrideBackgroundColor[]base background color; the OVERRIDE variant returns yellow (RGB(255,255,0)) when empty
defaultForegroundColor[] / defaultOverrideForegroundColor[]base text color; the OVERRIDE variant is red
selectedRowBackgroundColor[] / selectedCellBackgroundColor[] / focusedCellBackgroundColor[] / focusedCellBorderColor[] / tableGridColor[]user-defined colors for rows, cells, and grid
customReportCharWidth[] / reportCharWidth[]character width in reports (default 8)
customReportRowHeight[] / reportRowHeight[]row height in reports (default 18)
reportNotToStretch[] / reportToStretch[]report content stretching control

Runtime and checks​

checkIsServer[] / isServer[] — checks and the flag that the current execution runs on the server. random[] — DOUBLE between 0 and 1, randomUUID[] — md5 of a pair of random values, randInt[INTEGER] — an integer in [1; max]. notEmpty[STRING] — converts an empty string to NULL. upper[STRING] / lower[STRING] — case.

requestCanceled[] — a native property, flag of the current request being cancelled. noSystemToolbarCaptions[] — abstract flag for hiding system-toolbar captions. isHTMLSupported[] — a native property indicating whether the client supports HTML.

File helpers​

file[RAWFILE, STRING] — assemble a FILE from raw bytes and an extension. file[FILE, STRING] — clone a FILE with a different extension. namedFile[…] — same for NAMEDFILE (with a name). name[NAMEDFILE], extension[FILE], extension[NAMEDFILE] — file components. md5[FILE] — MD5 hash. resourceImage[STRING] — a resource path as a file image for the UI.

Client-side loading​

loadLibrary[STRING] / loadFont[STRING] — load a JS library or font on the client. reload[] — reload the client.

Windows and navigator​

The module fixes the main windows: logo, root, system (the top horizontal bar), toolbar (the left vertical strip), forms (the central area), log (the right notification strip). The CSS classes of these windows are the abstract properties logoWindowClass[], rootWindowClass[], systemWindowClass[], formsWindowClass[], toolbarWindowClass[], logsWindowClass[], implemented by the SystemEvents module from the appearance settings (the theme background class such as bg-dark-subtle plus navbar helper classes). They are declared in the value-based form that allows several implementations, so a project replaces a window's classes by adding an implementation of its own: the implementation of a module that requires SystemEvents, directly or through its required modules, is added later and is therefore checked first (without that requirement the order of the two modules is not guaranteed), and it applies whenever it returns a value, otherwise the module's classes remain. The two are not concatenated, so an implementation that keeps the theme classes repeats them. The look of the system windows is also customized through those settings and the project's stylesheet (registered through onWebClientInit[STRING]). A window with classes of its own is declared by the project, and navigator elements are placed into it.

The navigator gets a system folder Administration with subfolders Application (options / integration / migration) and System (performance, notifications, scheduler, logs).

Language​

See also​

  • System modules — the general inventory of platform modules.
  • Time — the separate Time module pulled in via REQUIRE Time.
  • Utils — the helper-property collection.
  • Change sessions — the session concept and its commit.
  • Forms — what a form is and how its lifecycle relates to the system actions.