Click or drag to resize
Configuration

Wisej applications are standard Web Projects in Visual Studio. All the standard Web.config settings are valid.

In addition to Web.config, Wisej applications use individual configuration files using the JSON format. A single project can define multiple Wisej applications and one configuration file for each application.

Web.config

In addition to the standard Web.config settings that are mostly handled by IIS, Wisej supports:

  • Wisej.LicenseKey

    This is the server license key that you have received required to activate the server. It is located under appSettings.

  • Wisej.DefaultTheme

    This is the name of the default theme (without the extension: i.e. Blue-1) that is used by the Wisej Designer and by all the applications in the project. Each application can override the application's theme in its JSON configuration file - see below. It is located under appSettings.

  • <compilation debug="true" targetFramework="4.5">

    Wisej reads the "debug" value of the <compilation> to determine whether to minify the javascript libraries. When debug is set to false, Wisej automatically bundles and minifies all the javascript libraries that are required by the application, including Wisej's core libraries, all extension libraries, and all custom libraries that may have been added by the application.

Wisej requires the module and the handler settings to be present in Web.config, and we recommend to increase the size of the allowed content to the maximum, as follows:

Web.config
<system.webServer>
    <modules>
      <add name="Wisej" type="Wisej.Core.HttpModule, Wisej.Core"/>
    </modules>
    <handlers>
      <add name="wx" verb="*" path="*.wx" type="Wisej.Core.HttpHandler, Wisej.Core"/>
    </handlers>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="1073741824"/>
      </requestFiltering>
    </security>   
    ...
</system.webServer>

  <system.web>
    <httpRuntime targetFramework="4.5" maxRequestLength="1048576"/>
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
      </assemblies>
    </compilation>
  </system.web>

All the default Wisej settings in Web.config are predefined in the Web.config file added by the Wisej project templates.

Default.json

Each Wisej application in a project defines its own configuration file using the JSON format. The default application uses Default.json.The explanation for each setting is also included in the template configuration file:

  • startup

    Full name of the startup static method. i.e. "MyApp.Program.Main, MyApp". Wisej calls this method when a new session is created. You can define either a simple method without arguments or you can define a method with a single NameValueCollection argument that will receive the arguments typed after the application's URL.

    This setting is optional, you can use the mainWindow setting instead. If you define the startup method, it is your responsibility to create a component to show to the user in the Main method: a main page, or a desktop or a window.

    C#
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
          var form1 = new Form1();
        }
    
        // 
        // You can use the entry method below
        // to receive the parameters from the URL in the args collection.
        // 
        //static void Main(NameValueCollection args)
        //{
        //}
    }
  • mainWindow

    Full name of a window created automatically at startup. i.e. "MyApp.MainForm, MyApp". Wisej will automatically load, create and show the window class. It can be either a Wisej.Web.Form or a Wisej.Web.Page.

    If both startup and mainWindow are specified, Wisej will create the main window and call the startup method.

  • theme

    Name of the theme to load at startup, without the extension. This setting is optional and overrides the theme setting in Web.config at runtime. The Wisej designer doesn't use the theme defined in any of the JSON configuration files.

  • url

    The URL of the page that corresponds to the application. This setting is optional. If omitted, users have to type the page URL: i.e. http://server.com/admin.html, unless the application uses Default.html and has defined the defaultDocument in Web.config.

    When the url setting is specified, users can type the name of the application without the extension and Wisej will load the html page specified: i.e.: http://server.com/admin.

  • debug

    Enables logging on the client browser console. Default: false. If you enable this setting, Wisej will log all sorts of events in the browser's console.

  • culture

    The default culture of the application. Default: "auto" (or omitted) to detect the culture from the browser.

    If you want to force a specific language regardless of the language of the user's browser and OS, you can specify it using this setting.

  • sessionTimeout

    Timeout of the session in seconds. Default: 120.

    This is the time that Wisej will wait (in seconds) when there is no activity from the user before firing the Application.SessionTimeout event. If the event is not handled by the application, Wisej displays the built-in timeout countdown window.

    This is not when the session expires. The session expires and it is removed (an unrecoverable event) either when the built-in timeout window reaches the end of the counter, or after twice the value of sessionTimeout (minimum 60 seconds).

    Caution note Caution

    There are no events fired when the session is disposed (at 2 * sessionTimeout seconds) since that application/session is gone at that point. Handling the Application.SessionTimeout is your last chance to manage session timeouts.

  • responseTimeout

    Timeout of Wisej ajax requests in seconds. Default: 120.

    If your application may process long running tasks in response to regular events (button clicks, for example) increase this value. Otherwise Wisej may timeout while waiting for a response.

    Note Note

    If the session is using WebSocket, this setting only applies to the initial load since the WebSocket connection doesn't timeout.

  • cookieless

    Enables support for cookieless sessions. Default: false. When this setting is set to true, Wisej adds the session id to the URL.

  • forceSecureConnection

    Forces the client to use ssl. Default: false. When this setting is set to true, Wisej changes the request from http: to https:. The underlying WebSocket connection (if available) also uses the wss: secture protocol.

  • showLoader

    Loads the Wisej ajax loader. Default: true. When this setting is set to false, Wisej will not show anything while it loads the startup libraries and shows the HTML content (if any) in the application's HTML page.

  • loaderTimeout

    Timeout before the appearance of the Ajax loader in milliseconds. Default: 2000.

    Tip Tip

    The ajax loader gif is themed using the image named ajax-loader.

  • notAvailableUrl

    URL of a page to display when the server cannot create a new session. Default: "resource.wx/NotAvailable.html,Wisej.Core" (built-in default page).

    Wisej checks the maxSessions value and the concurrent users limit set in the license.

  • notSupportedUrl

    URL of a page to display when the browser is not supported. Default: "resource.wx/NotSupported.html,Wisej.Core" (built-in default page).

    Wisej checks that the browsers supports at least XMLHttpRequest. In addition to this basic requirement, you can add a custom version-check javascript function using the browserCheck expression.

  • browserCheck

    A custom javascript expression that returns true if the browser is supported, or false if it's not supported. The expression must be declared as a string and it can include regular expressions.

    JavaScript
    "browserCheck": "navigator.platform == 'Win32'"
  • enableWebSocket

    Enables WebSocket connections, if supported. Default: true.

  • enableWebSocketCompression

    Enables WebSocket compression. Default: true. Wisej compresses the response stream only after it passes a certain threshold, usually of 2,000 bytes.

  • maxSessions

    Maximum number of active sessions (users) before returning 503 (Service Unavailable). Default: -1 (unlimited).

    Tip Tip

    Setting this value to 0 disables the application and always redirects to NotAvailableUrl.

  • maxModalStack

    Maximum number of nested modal states (dialogs and message boxes). Default: 10.

  • validateClient

    Enables the validation of client requests using the client fingerprint. Default: true. Validating the client fingerprint minimizes the risk of session hijacking since it's extremely rare that a hacker's machine could generate an identical fingerprint number that matches the fingerprint of the client that "lost" the session ID.

  • options

    Map of platform-specific options. i.e. {debug: true, nativeScrollBars: true, ...} These are options that are recognized by the client side javascript platform, and specifically the qooxdoo web framework.

  • settings

    Map of application settings. i.e. {jquery: "http://cdn...", rootPath: "c:\\users\\...", ...} These are custom settings that you can handle in your application using Application.Configuration.Settings.

[Application Name].json

Additional applications in a Wisej project use their own configuration file using the application name and the json extension. The settings are the same described in the previous section.

See Also