Please remember this is a work in progress. Home » Classes

Classes

 

TIWServerControllerBase

 

Every time you create a new IntaWeb Application, the project wizard creates a "DataModule" called IWServerController. All IntaWeb applications require this data module and there is only one ServerController instance in each IntraWeb application (i.e. it is a singleton). It is the first main module created when application starts and the last destroyed when application shuts down. Through ServerController properties you control the behavior of your IntraWeb application such as port, SSL settings, compression and much more.

Unit

IWServerControllerBase

Class hierarchy

TIWDatamodule -> TIWServerControllerBase

Methods

AuthActive [Public]

Declaration: function AuthActive: Boolean;

Description: Returns True if there is any Auther property is set and Auther object is enabled

 


RegisterExceptionCallback [Public]

Declaration: class procedure RegisterExceptionCallback(aCallback: TIWExceptionCallbackProc);

Description: Register a method to be executed when any exception occurs. This allows users to handle specific types of exceptions or perform any required actions (e.g. logging, notification, etc.). The exception callback is executed in the server context and has no access to browser resources.

Parameters:

  • aCallback (TIWExceptionCallbackProc): Callback method which should be executed when an Exception occurs

UnregisterExceptionCallback [Public]

Declaration: class procedure UnregisterExceptionCallback(aCallback: TIWExceptionCallbackProc);

Description: unregisters exception callback methods registered previously with RegisterExceptionCallback

Parameters:

  • aCallback (TIWExceptionCallbackProc): Callback method previously registered by RegisterExceptionCallback

Properties

AppName: string; [Published, Read/Write]

Contains the application name.Used when you install your SA - Stand Alone - Server application as a Service

AutoLoadIniSettings: Boolean; [Published, Read/Write]

When True IntraWeb will try to load all published properties from ServerController from your application .INI file (a standard Windows INI file with same name as your executable and an .INI extension). Settings will be loaded only if file is found and if the property is present in the INI file.

An INI file template can be generated from ServerController Options Wizard (Inside Delphi IDE, right click on ServerController and select ServerController Options Wizard, from the context menu). Then select "Save all settings to INI file" (save current settings) or "Create INI file template" (save a template file with empty properties).

AuthBeforeNewSession: Boolean; [Published, Read/Write]

Informs IntraWeb if the User Authorization will be requested before a user session is created. If you do not uses any custom authorization that depends on any property/method you have delcared on your User Session class, leave this property as False.

Auther: TIWAutherBase; [Published, Read/Write]

Use this property to assign one of the built-in Authorization components from IntraWeb. The Authorization components uses the default browser login/password dialog. See Authorization Components for more information

ContentPath: string; [Published, Read/Write]

Contains the full path for the IntraWeb Content Folder. The default value for the ContentPath is AppPath + 'wwwroot'. The ContentPath is the folder that is exposed to the user by your IntraWeb application, ie, the files that needs to be directly accessible using and URL. You can use this folder to add images, JavaScript files, PDF, HTML files and any file needed by your application.

Locked: Boolean; [Published, Read only]

Returns True when ServerController is locked for updates, i.e. most public/published properties can't be changed. Locked is set to True after OnConfig event.

StartDateTime: TDateTime; [Published, Read only]

Contains time stamp when application started

StartUID: string; [Published, Read only]

Unique identifier of application instance

GUIActive: Boolean; [Published, Read only]

Returns True when SA GUI application is active

ServerVariables: TStringList; [Published, Read only]

ISAPI only. Contains a list of server variables that should be fetched from ISAPI subsytem at each request. Default value is: APP_POOL_ID, SERVER_ADDR, SERVER_NAME, SERVER_PORT, SERVER_SOFTWARE

RewriteURL: string; [Published, Read/Write]

Same as URLBase property

BlockedDocExtensions: TIWMinStringList; [Public, Read/Write]

List of strings containing file extensions (preferably including the DOT separator) which should be blocked. All requests which path matches one of the file extensions on the list will be responded with status code 404 (not found). By default ".php" and ".ini" extensions are included.

BoundIP: string; [Published, Read/Write]

Use this property to specify a IP the SA Server application will be bound to. Specialy useful when you run your SA Server in a computer with several network adapters

CacheDir: string; [Published, Read/Write]

Contains the full path to the folder used as the IntraWeb general cache

ComInitialization: TComInitialization; [Published, Read/Write]

Describes how IntraWeb will handle COM initialization routines.

Compression: TIWCompressionOptions; [Published, Read/Write]

HTTP compression related properties. See TIWCompressionOptions class

Description: string; [Published, Read/Write]

String containing the description of IntraWeb application. Used when you install your SA Server application as a Service.

DebugHTML: Boolean; [Published, Read/Write]

Deprecated. Do not use.

DisplayName: string; [Published, Read/Write]

Contains the Display name for the application. Used when you install your SA Server application as a Service.

Log: TLogOptions; [Published, Read/Write]

Use this property to inform how IntraWeb saves its Log information (used internally by IntraWeb in some parts of the code). When you enable this property, IntraWeb generates the log file in the same folder as your application.

ExceptionDisplayMode: TIWShowMessageType; [Published, Read/Write]

Possible values: smAlert, smNewWindow, smSameWindow, smSameWindowFrame

Use this property to inform IntraWeb how to show an Application Exception to the user.

HTMLHeaders: TStringList; [Published, Read/Write]

Use this property to add custom tags to the headers of your IntraWeb forms. When you add some content to this property, all IntraWeb forms will include it when rendered.

ContentFiles: TStringList; [Published, Read/Write]

Use this property to add custom JavaScript files to your IntraWeb forms. When you add some content to this property, all IntraWeb forms will include it when rendered. Ensure the files you are adding are available under your ContentPath folder.

MasterTemplate: read; [Published, Read/Write]

Use this property to specify a master template for your application. See Working with Templates for more information

PageTransitions: Boolean; [Published, Read/Write]

Use this property to enable page transitions to your application. Works only on Internet Explorer.

Port: Integer; [Published, Read/Write]

User this property to inform in which port your Stand Alone Server application will be listening too. Only valid for Stand Alone Server type applications. See Stand Alone Server deployment for more information. Read more about TCP Ports.

ServerResizeTimeout: Integer; [Published, Read/Write]

Use this property to specify the amount of time (in miliseconds) the browser will wait for Server when the IW Form has any code assigned to the OnResize event.

ShowLoadingAnimation: read; [Published, Read/Write]

Use this property to indicate IntraWeb to show a loading animation when loading/rendering pages.

StyleSheet: TIWFileReference; [Published, Read/Write]

Use this property to indicate a general CSS file for all your IntraWeb forms. The CSS file must be located within the ContentPath folder.

SSLOptions: TIWSSLOptions; [Published, Read/Write]

Use this property to indicate the SSL options for your application. Only for SA Server applications. For ISAPI, use the IIS SSL features.

TemplateDir: string; [Published, Read/Write]

Use this property to indicate the folder your application's templates are located. The default value "\Templates", which means the Templates Folder must be under the application folder.

URLBase: string; [Published, Read/Write]

URLBase is the common prefix found while navigating inside a given website is known as the base URL. The URLBase is concatenated with the server's root URL to form the application URL. Example: server URL is www.yourserver.com and application URLBase is /myapp/, the application root url will be http(s)://www.yourserver.com/mypp/

Version: string; [Published, Read/Write]

Read only string containing the IntraWeb version

DocType: string; [Published, Read/Write]

Use this property to indicate IntraWeb a DocType to be used when rendering your pages.

IECompatibilityMode: string; [Published, Read/Write]

When set, the string will be used in every HTML page generated by IntraWeb, forcing Internet Explorer versions to render using compatibility mode. Read more about Internet Explorer compatibility mode here.

ShowStartParams: boolean; [Published, Read/Write]

Use this property to indicate IntraWeb to keep your URL parameters on the URL after being processed by the application.

ExceptionLogger: TIWExceptionLogger; [Published, Read/Write]

Use this property to control the behavior of the TIWExceptionLogger class instance.

CookieOptions: TIWSessionCookieOptions; [Published, Read/Write]

Use this property to control how IntraWeb will handle HTTP cookies. Please check TIWSessionCookieOptions class

SearchEngineOptions: TIWSearchEngineOptions; [Published, Read/Write]

Use this property to control how IntraWeb will behave regarding search engines and bots requests. Please check TIWSearchEngineOptions class

JavaScriptOptions: TIWJavaScriptOptions; [Published, Read/Write]

Use this property to control how IntraWeb generates JavaScript. Please check TIWJavaScriptOptions class

HttpKeepAlive: Boolean; [Published, Read/Write]

Applies to SA Server (Indy) applications only. Indicates if a client connection should remain open for subsequent use in an HTTP session.

SecurityOptions: TIWSecurityOptions; [Published, Read/Write]

Use this property to control how IntraWeb handles various security aspects of the application. Please check TIWSecurityOptions  class.

BackButtonOptions: TIWBackButtonOptions; [Published, Read/Write]

Controls how IntraWeb will handle back button events. Please check TIWBackButtonOptions  class.

MobileOptions: TIWMobileOptions; [Published, Read/Write]

Controls specific rendering options regarding mobile browsers. Please check TIWMobileOptions class

ProxyPortRedirection: TIWProxyPortRedirection; [Published, Read/Write]

Used to control how IntraWeb handles redirection addresses when application is behind a proxy server or firewall which might use different ports

LogSessionEvents: Boolean; [Published, Read/Write]

When True will enable the Session Events Logger object which basically logs all requests received in a session context. Please read more about Session Events Logger here.

UseAjaxNotify: Boolean; [Published, Read/Write]

When True (default), WebApplication.ShowMessage will use the new JavaScript based dialogs instead of alert() when using WebApplication.ShowMessage(). Set it to false to restore the old behavior.

PostRedirectGet: TIWPostRedirectGetOption; [Published, Read/Write]

When True, IntraWeb will implement a Post/Redirect/Get (PGR) pattern in post requests. Post/Redirect/Get prevents double form submissions in most scenarios in a very efficient and transparent way. Read more about Post/Redirect/Get here

CustomLockerAnimationFile: string; [Published, Read/Write]

Name of your Custom GIF or SVG file used as a page locker. All modern browsers can handle SVG files (smaller and better quality than GIF). The custom GIF file should be saved into wwwroot folder.

Only the file name should be specified here.

HTMLLanguage: string; [Published, Read/Write]

ISO Language Code used for pages rendered by the IntraWeb application. The code is used as the HTML lang attribute in all HTML pages

HttpSysOptions: TIWHttpSysOptions; [Published, Read/Write]

Controls specific options regarding Http.sys applications. Please check Http.sys applications here

LoaderHTML: TStrings; [Published, Read/Write]

Specific for IntraWeb 17 support

SessionOptions: TIWSessionOptions; [Published, Read/Write]

Groups all session control specific properties. Please check TIWSessionOptions class

Deprecated/Discontinued properties:

AllowMultipleSessionsPerUser: Boolean; [Public, Read/Write]

Deprecated. It was superseeded by TIWSessionOptions properties

SessionTimeout: Cardinal; [Public, Read/Write]

Deprecated. It was superseeded by TIWSessionOptions properties

LockSessionTimeout: Cardinal; [Public, Read/Write]

Deprecated. It was superseeded by TIWSessionOptions properties

RestartExpiredSession: Boolean; [Public, Read/Write]

Deprecated. It was superseeded by TIWSessionOptions properties

CharSet: string; [Published, Write only]

Deprecated. Do not use.

CacheExpiry: Integer; [Published, Write only]

Deprecated. Do not use.

FilesDir: string; [Published, Write only]

Deprected. Do not use.

HistoryEnabled: Boolean; [Published, Write only]

Deprected. Do not use.

InternalFilesDir: string; [Published, Write only]

Deprecated. Do not use.

InternalFilesURL: string; [Published, Write only]

Deprecated. Do not use.

JavascriptDebug: Boolean; [Published, Write only]

Deprecated. Use JavaScriptOptions instead.

RedirectMsgDelay: Integer; [Published, Write only]

Deprecated. Do not use.

UseInternalFiles: Boolean; [Published, Write only]

Deprecated. Do not use.

EnableImageToolbar: Boolean; [Published, Write only]

Deprecated. Do not use.

Events

OnAfterDispatch: TOnDispatch; [Public, Read/Write]

Use this event to make any pos-processment after the your application dispatches a client request. You need to include the units IW.Http.Request (THttpRequest) and IW.Http.Reply (THttpReply) in your uses clause, if not already included.

procedure TIWServerController.IWServerControllerBaseAfterDispatch(
  Request: THttpRequest; aReply: THttpReply);
begin
  if (aReply.Code <> 404) then begin
    Log('User agent: ' + Request.UserAgent);
    Log('Content Type: ' + aReply.ContentType);
  end;
end;

OnBeforeDispatch: TOnDispatch; [Public, Read/Write]

Use this event to modify the IntraWeb reply before it is sent to the client or any other processment needed by your application. You need to include the units IW.Http.Request (THttpRequest) and IW.Http.Reply (THttpReply) in your uses clause, if not already included.

procedure TIWServerController.IWServerControllerBaseBeforeDispatch(
  Request: THttpRequest; aReply: THttpReply);
begin
  if Pos('192.168', Request.RemoteAddr) = 0 then begin
    aReply.SendRedirect('http://www.atozed.com');
  end;
end;

OnCloseSession: TOnCloseSessionEvent; [Public, Read/Write]

This event is triggered when a User Session is destroyed.

OnConfig: TNotifyEvent; [Public, Read/Write]

It is triggered right after the ServerController instance is created. You must use this event to set any properties that you want to change at runtime.

OnException: TOnExceptionEvent; [Public, Read/Write]

procedure TIWServerController.IWServerControllerBaseException(AApplication: TIWApplication; AException: Exception; var Handled: Boolean);

This event is truggered when an Exception occurs in your application.

Please notice that IWApplication parameter might be NIL, so you need to test it before trying to access any IWApplication method or property.

OnGetSessionID: TOnGetSessionID; [Public, Read/Write]

This event is triggered after a user session is created and just before IntraWeb creates a session ID for the user session. Use this method if you need to create a custom session ID for each user session.

OnNewSession: TOnNewSessionEvent; [Public, Read/Write]

This event is triggered just after a new user session is created

OnGetMainForm: TOnGetMainFormEvent; [Public, Read/Write]

Triggered before IntraWeb creates the main form for each session, when the session starts. Use this event to set a different main form.

OnBackButton: TOnBackButtonEvent; [Public, Read/Write]

This event is triggered when the track ID of the application is out of sync. For more information see TIWBackButtonOptions class.

OnBeforeRender: read; [Public, Read/Write]

This eventis triggered before IntraWeb renders the next form to be shown to the user. You can use this event to show another form to the user, instead of the form to be shown.

procedure TIWServerController.IWServerControllerBaseBeforeRender(
  ASession: TIWApplication; AForm: TIWBaseForm; var VNewForm: TIWBaseForm);
begin
  if not UserSession.CheckFormSecurity(AForm.ClassName) then begin
    VNewForm := TLoginForm.Create(WebApplication);
    TLoginForm(VNewForm).FormToRequestAuth := AForm.ClassName;
    AForm.Release;
    AForm := Nil;
  end;
end;

OnAfterRender: read; [Public, Read/Write]

This event is triggered after a form is rendered.

OnUserTag: TOnUserTag; [Public, Read/Write]

This event is triggered when the IWP parser finds a user tag in a HTML page served by your application.

OnSessionTag: TOnSessionTag; [Public, Read/Write]

This event is triggered when the IWP parser finds a sessiohn tag in a HTML page served by your application.

OnBrowserCheck: TOnBrowserCheckEvent; [Public, Read/Write]

This event is triggered when a new user is connecting ro your application. Use this event to determine the application behavior in accordance to the browser the user is using.

IntraWeb 15.1 made this event partially obsolete. In case the specific browser is not correctly identified, IntraWeb will treat it as a Chrome browser (which currently has around 60% of market share). You can still use the event if you want it to be handled differently.

OnParseParameter: TOnParseParameterEvent; [Public, Read/Write]

Triggered when IntraWeb is parsing a parameter received as part of the URL when session starts. Users can can change or drop any received parameter.

OnExecuteRequest: TOnExecuteRequest; [Public, Read/Write]

General event which complements OnBeforeDispatch/OnAfterDispatch events

OnLogException: TOnLogExceptionEvent; [Public, Read/Write]

Triggered when ServerController logs any exception

OnAuthFailed: TOnAuthFailed; [Public, Read/Write]

Occurs only Auther component is set and authentication fails (generally when a session starts)

OnRewriteURL: TOnRewriteURLEvent; [Public, Read/Write]

Allows user to dynamially set a URLBase (or RewriteURL) on a per-request basis

OnBeforeNewSession: TOnBeforeNewSessionEvent; [Public, Read/Write]

Occurs before IntraWeb create a new session. Users can inspect the request and abort the session creation.

OnValidateCacheFileAccess: TOnValidateCacheFileAccess; [Public, Read/Write]

Triggered when a file cache is about to be served. Users can use this event to validate each request

 

 

 

Terms of Use | Privacy Statement © 2002 - 2024 Atozed Software