Skip to content

Application

Configuration Editor allows you to define core settings that define how the zAppDev application works.

The Configuration editor: the sections on the left (Application, Security, Implementation Strategy) and the General settings on the right

The editor lists its sections on the left:

Group Sections
Application General, Default Pages, Localization, Global Resources, Settings, Events, Indexes, Caching, Software License
Security Authentication, Permissions, Roles, Encryption Strategies
Implementation Strategy Overview, Settings

General shows the application Name (read-only), the Description, the Default Theme and the Implementation Strategy. Deployment settings are not here: they belong to the deployment environments.

General

Property Description
Name The name of your application, as defined when you created it. It is read-only.
Description A friendly description of the application you are modeling.
Default Theme The theme the application uses by default, from the list of your themes.
Implementation Strategy The target with which you build the application. For example, .NET Core - Angular generates a .NET server, an Angular client and the database. See Targets.

The General section of the Configuration editor

Default Pages

The Default Pages let you choose the form and the controller action (its Entry Point) that are shown or run for each of the following pages. A link button at the end of each row opens the action. The page also shows the code that reads them, Application.DefaultPages.DefaultPage.GetLink(); and .Execute();:

The Default Pages section, with the form and the controller action of each page

  • Default Page: the Landing Page of your Application
  • Error Page: the page to load whenever an unexpected/uncought Error is detected during the Application's execution
  • First Admin Setup Page: used most oftenly with a[Windows Authentication], this is the page that the very first Administrator of your Application is to be set
  • Not Found Page: the page to load whenever a user requests a non-existent URL within your Application
  • Sign In Page: the page that is used to authenticate a user
  • Unauthorized Page: the page to load whenever a user makes an Unauthorized request

Localization

Using the Localization configuration you can define the Languages and Formats you want your Application to use in any of its parts (Forms, Logic, Functionality e.t.c.). The values you chose here will be used:

  • Throughout your Application Models, in their Localization parts (e.g. translations of texts in Forms, Business Objects, Operations and more)
  • In your generated Application, for a User to choose from.

The section also has the buttons Export Resources and Import From File, for the translations. The table describes its fields:

The Localization section

Property Description
Available Languages A comprehensive list of Languages. You can add one or more, to be used in your Application. The languages you choose here, will be available as the Default Language and Default Regional Formatting options.
Default Language The Language to be presented to a User by default, before he/she selects his/her preffered one (out of the Available Languages selection)
Default Timezone Information The time zone used by default.
Default Regional Formatting The Regional Formatting to be used for a User by default, before he/she selects his/her preferred formattings (e.g. for dates, times, numbers etc.)

Global Resources

The Global Resources are mere translations of texts that you can use throughout your whole Application. They differ from the Local Resources (e.g. Localization Resources in a Business Object in that they can be defined once and used in any other Model (be that a Business Object, a Form, an API adapter etc.)

The Global Resources, with the value of RES_SITE_ApplicationTitle

As you can see, a large number of resources has already been defined for you. These are the ones that are used by the Application in parts that you cannot quite alter (e.g. label texts inside complex/pre-created components, system messages etc.). You cannot delete them, however you can add their Translations, based on the Languages you chose in the Localization panel of the Configuration.

Tip

Try to use carefully your Global and Local Resources; put in the Global Resources only those translations you will really need globally.

Any resource (translation) you are using in just one Model, add it as a Local.

This will help you minimize the transmitted data between the back-end (that holds the Resources) and your front-end (that uses/shows them)

Settings

This section holds the configuration settings of your application. It has two groups: User Defined, where you add your own settings with Add..., read in code as Application.Settings.AppSetting, and System Defined, which lists the settings of the platform, such as GoogleMapsAPIKey and the e-mail and IMAP settings (EmailHostAddress, EmailPassword, EmailUsername, EmailFromAccount, EmailPort, IMAPhost, IMAPport and more). Each has a Name and a Default Value; the values per environment are set in the deployment environments.

Anything you add here will be saved in the web.config in a key-value format, available to you from any part of your Application via the AppLib.Application reference regardless of its location, database data etc.

Attention

The Name of a setting must be unique.

The Settings section, with the User Defined and System Defined settings

Tip

These settings can be very helpful if you wish to change the location of your Application and seperate the settings.

Example: you may have one set of values for your E-Mail connection at your local location and a different for your remote; a "555-0147" Administrator Phone Number for your Application running in California and a "555-0155" for the one running in Alaska.

Events

The Events section, with the events of the platform and the handler of SignIn

This section can be used to define handlers for Application Events. The platform provides these events: SignIn, SignOut, ApplicationStart, ApplicationEnd, ApplicationError, SessionStart, OnInstanceSave, FileDownload, ExternalUserCreating and UserAuthenticating. You may add as many of your own as you wish. The page also shows how to raise one, for example Events.SignIn.Raise();.

To add an event, use the + button and New Event, and set the following properties:

Property Description
Event Name A Name for the event
Parameters The parameters required by the event
Handler A Mamba function that is invoked every time the event is raised
Execute in parallel context If true, all event handlers will run simultaneously instead of sequentially
Default Events

SignIn

SignIn event is raised when a user successfully signs in to the application.

/* Handler Example */

static function void onSignIn(
    string UserName,
    DateTime Time
)
{
    var u = Domain.ApplicationUser.GetByKey(UserName);
    DebugLib.Logger.WriteInfoLine("User " + u.Name + " signed in on " + Time);

}

SignOut

SignOut event is raised when a user signs out from the application.

/* Handler Example */

static function void onSignOut(
    string UserName,
    DateTime Time
)
{
    var u = Domain.ApplicationUser.GetByKey(UserName);
    DebugLib.Logger.WriteInfoLine("User " + u.Name + " signed out on " + Time);

}

ApplicationStart

ApplicationStart event is raised when the application starts running.

/* Handler Example */

static function void onApplicationStart()
{
    Domain.AppHelper.Initialize(); // AppHelper is an example class!
    DebugLib.Logger.WriteInfoLine("App started on " + DateTime.Now());
}

ApplicationEnd

ApplicationEnd event is raised when the application stops running.

/* Handler Example */

static function void onApplicationEnd()
{
    Domain.AppHelper.Destroy(); // AppHelper is an example class!
    DebugLib.Logger.WriteInfoLine("App ended on " + DateTime.Now());
}

SessionStart

SessionStart event is raised when a user session starts.

/* Handler Example */

static function void onApplicationEnd()
{
    Domain.Statistics.NewSessionStarted(); // Statistics is an example class!
    DebugLib.Logger.WriteInfoLine("New Session started on " + DateTime.Now());
}

onOnInstanceSave

onOnInstanceSave event is raised when a Domain Class instance is successfully saved to the DataBase.

/* Handler Example */

if (Instance.GetType().Name == "ApplicationUser") {
    var user = Instance as Domain.ApplicationUser;
    DebugLib.Logger.WriteInfoLine("Saved user: " + user.UserName);
}
elseif (Instance.GetType().Name == "ApplicationOperation") {
    var op = Instance as Domain.ApplicationOperation;
    DebugLib.Logger.WriteInfoLine("Saved operation: " + op.Name);
}

Tip

You can programmatically raise an event using Mamba

Events.OnFormLoaded.Raise("MyForm");

Tip

Forms may define their own event handlers in the 'Event Listeners' tab. See Event Listeners.

Indexes

Search indexes are customizable tools that allow users to efficiently search specific fields within business objects, offering features like real-time updates, partial matches, and integration into the application menu. Developers can create, manage, and rebuild these indexes, enabling tailored search experiences across different data sets within an application.

The section says How it works and offers Add..., which creates an index with a name and a list of classes.

A new search index in the Indexes section

Click here to learn more about search indexes and a step-by-step guide on how to create and use them.

Software License

The Software License section describes who owns the application and under which license you distribute it: the Owner Company, a License chosen from a list, and a Description.

The Software License section

Caching

The Caching section, with the Cache Expiration Mode

This section is used to set default settings for the caching mechanism that can be applied to API adapters and services.

Cache Expiration Mode

The Cache Expiration Mode list starts at Never. zAppDev supports three cache expiration modes:

Never

Cache memory will never be erased as long as the application is running.

Sliding

Cached items will be kept in cache for the Timespan defined. Every time the item is requested from cache the expiration time will be reset.

Absolute

Cached items will be kept in cache for the Timespan defined no matter if they are requested or not.

Expiration Time Span

Sets a timespan in Days, Hours, Minutes, Secods and Milliseconds that is used to calculate the cache expiration as mentioned above.

Tip

Each API operation may override the Default Cache Settings and / or cache items for each User separately