Configuration

Wisej.Core.Configuration

Namespace: Wisej.Core

Assembly: Wisej.Framework (4.0.0.0)

Configuration settings.

public class Configuration

Constructors

Configuration(json)

Creates a new instance from the specified json string.

Name
Type
Description

json

The json string that defines the configuration values.

Properties

AllowedRoutes

String[]arrow-up-right: List of allowed Url routes separated by a semicolon. i.e.: "api;product;log/performance".

AutoReload

Booleanarrow-up-right: When true, the application is automatically reloaded when the session expires or Exit is called.

The application can always override this feature by changing the Wisej.onExit method using a script.

BrowserCheck

Stringarrow-up-right: The custom function used to validate the browser. If it returns false the browser is not supported and Wisej redirects to NotSupportedUrl.

Culture

Stringarrow-up-right: Returns the culture set at the application's level. It can be any of the supported cultures or the keyword "auto", in which case we will detect the culture from the browser.

Debug

Booleanarrow-up-right: Enables/disables debug mode.

DisableClientObjectModel

Booleanarrow-up-right: When true, the client will not be able to access the application's controls using the object model registered with javascript under the "App" namespace.

DisableMinification

Booleanarrow-up-right: When true, dynamic minification is turned off also in release mode.

DropDuplicateClicks

Booleanarrow-up-right: When true, the client drops all "execute" events triggered while there is a pending request.

EmbeddedResourcesCacheControl

Stringarrow-up-right: Cache-Control for embedded resources. The default is "browser" to cache the embedded resources on the browser for 1 month. Other allowed values are: - "server" to cache the resources on the server using the ETag header - "private, max-age=..." to use set the standard Cache-Control header - any value Cache-Control string value.

EnablePWA

Booleanarrow-up-right: Enables the PWA installation of the application.

EnableWebSocket

Booleanarrow-up-right: Enables/disables the WebSocket protocol.

EnableWebSocketCompression

Booleanarrow-up-right: Enables/disables gzip compression when using the WebSocket protocol.

FilePath

Stringarrow-up-right: The full path of the configuration file.

Impersonate

Booleanarrow-up-right: Enables impersonation mode.

When set to true and windows authentication is configured in web.config, every request thread and application tasks started using Application.StartTask will impersonate the current user.

InvalidSessionHttpCode

Int32arrow-up-right: Determines the HTTP code that Wisej.NET returns to the browser when a request cannot be authenticated with a valid session. The default is 200 (OK). Set it to 401 (Not Authorized) in case a deployment requires it.

KeepAliveInterval

Int32arrow-up-right: The keep-alive interval in seconds.

Loader

Stringarrow-up-right: Name of the page loader resource to show at startup.

LoaderTimeout

Int32arrow-up-right: The ajax loader timeout in milliseconds.

MainWindow

Stringarrow-up-right: Full name of the first window created automatically at startup.

MaxModalStack

Int32arrow-up-right: Returns the maximum number of nested modal loops.

MaxSessions

Int32arrow-up-right: Returns the maximum number of active sessions before redirecting to NotAvailableUrl.

MaxSessionsPerClient

Int32arrow-up-right: Limits the number of sessions that can be associated with a client. The default is 50. Set it to 0 for unlimited. Use this configuration option to protect again potential DoS attacks. It's supported only on professional server editions or higher.

NetworkCheckInterval

Int32arrow-up-right: Network check interval in milliseconds. The default is 1000 (1 second). Wisej.NET will send a /healthcheck.wx request at the specified interval when the application goes offline.

NotAvailableUrl

Stringarrow-up-right: The URL of the page to load when the server cannot respond to the request.

NotSupportedUrl

Stringarrow-up-right: The URL of the page to load when the client browser is not supported.

OfflineUrl

Stringarrow-up-right: The URL of the page to load when the connection is lost.

Options

Objectarrow-up-right: Native client-side platform options.

PollingInterval

Int32arrow-up-right: Polling interval in milliseconds. The default is zero (disabled). If this value is set, the polling starts when the application is loaded.

The polling interval determines the frequency of the automatic poll requests coming from the client when a WebSocket connection is not available. When the client is connected using a WebSocket channel, this value is ignored. An application that wants to enable automatic client updates in absence of a WebSocket connection can set this value, or it can call StartPolling and EndPolling to start and terminate the automatic polling from the client. Both methods are ignored when the client is using a WebSocket connection.

ResponseTimeout

Int32arrow-up-right: The timeout for the server to respond to a Wisej request in seconds.

RightToLeft

Stringarrow-up-right: Returns the rightToLeft mode. It can be "true", "false", or "auto". When set to "auto" the RightToLeft layout is enabled automatically using the current language. The default is "auto".

Secure

Booleanarrow-up-right: Forces the client to switch to a secure connection (HTTPS and WSS).

SessionStorage

Stringarrow-up-right: Where to save the session id on the client. The default is "session" to indicate the browser's sessionStorage. It can be changed to "local" to indicate the browser's localStorage.

SessionTimeout

Int32arrow-up-right: The session timeout in seconds. The timeout is enforced on the client side.

Settings

Objectarrow-up-right: Application settings.

ShowLoader

Booleanarrow-up-right: Shows the loader animated gif while initializing the application.

StartUp

Stringarrow-up-right: The startup Main method.

ThemeName

Stringarrow-up-right: Theme name.

ThreadPool

Objectarrow-up-right: ThreadPool min/max configuration, null by default.

Url

Stringarrow-up-right: Url redirection.

ValidateClient

Booleanarrow-up-right: Verifies the client's unique id when retrieving a session. It prevents session hijacking over unsecured connections.

ValidateResources

Booleanarrow-up-right: Verifies that resource requests are received from the user's authorizes browser. Prevents reusing a resource URL from an unauthorized browser.

WebSocketCompressionThreshold

Int32arrow-up-right: Sets the response size that triggers the compression of the response over the WebSocket channel.

Methods

GetInstance(filePath, uri)

Loads or retrieves the configuration file.

Parameter
Type
Description

filePath

The full path to the .json file to load.

uri

The current Uriarrow-up-right representing the site being loaded.

Returns: Configuration.

Events

LoadConfiguration

LoadConfigurationEventHandler Fired when the system needs to load a Wisej configuration file.

An application can install a custom configuration handler and return a custom Configuration object. In alternative, the handler can change the value of FilePath and let Wisej.NET load the alternative json file. This is a static event and should be attached to before the application starts. One way to do that is to register an HttpModuleStartup method with IIS when using .NET 4.8. When running on .NET Core, attach to the event in the Startup method.

Last updated

Was this helpful?