alp.application configuration
file contains settings defining how to process content found in the current directory and
its subdirectories. Global (default) alp.application file is found in the directory
containing iewebsrv.dll. ALP engine seeks alp.application file in the current directory
(pointed by the URL) and up to the root of the current Virtual ALP site.
The first found alp.application
file is the only file that takes place in the resulting application configuration. It is
mixed with the global alp.application file and the resulting configuration is used by the
engine. You can create and edit these settings using the ALP
Settings shell extensions - there is no need to edit them
manually. This file also defines the scope of the Application and Session global objects
supported by a particular content generator component (for example ASP).
Sample configuration file shown below contains only common values meaningful for the
ALP engine. Values specific to a particular content generator module can be found in
its documentation.
; ALP Application configuration
{ APPLICATION:
{ ExecutionMap:
; ExecutionMap section contains subsections for every file extension handled by some content generator
; component. Every section must have registered content generator component (in brackets).
{ ext: (CG.SomeCompany.SomeContentGenerator)
; The four values here are recognized by the ALP 1.0 engine itself. They are accessible to the
; component registered with the section too. The component is "unpersisted"/created over the settings
; found in that section and looks in it for the specific values required for its operation. It has ability
; to generate an error if some of the specific or common values are not appropriate. Common
; records can be omitted and then default values apply - see descriptions below the sample
(int)Timeout=60
(int)RequireAsynch=2
(int)CheckThatFileExists=2
(int)IsScriptEngine=1
; Values specific to the component registered with the section (in brackets after the section name)
; ...
} ext;
} ExecutionMap;
{ InternalExecutionMap:
; InternalExecutionMap section as like the ExecutionMap section contains subsections defining the
; request handling for specific resources. But the sections contained here are not related to the
; file extensions. Instead here specific exceptions are defined. In the ALP 1.0 they are Directory and File
{ Directory: (CG.newObjects.DirList)
; Defines the component handling the directory browse feature. It is expected that module to show
; a directory listing of the directory pointed by the URL.
(int)Timeout=60
(int)RequireAsynch=2
(int)CheckThatFileExists=0
(int)IsScriptEngine=0
; Values specific to the component registered with the section (in brackets after the section name)
; ...
} Directory;
{ File: (CG.newObjects.RawSpool)
; File section defines component used to "spool" raw resources - files not registered in the
; ExecutionMap section above. It usually contains table of extension - content type pairs
; defining the content type of the widely known file extensions.
} File;
} InternalExecutionMap;
{ Options:
; In the ALP 1.0 3 records are recognized. They define the lifetime limits for the global objects supported
; by the executed content generators. ALP engine manages these objects globally and releases a
; particular object if it expires. Time for all the records is in minutes.
(int)SiteObjectsExpireTime=10000
(int)ApplicationExpireTime=10000
(int)SessionExpireTime=20
(int)OutputBufferMaxSize=100000000
(int)ThreadLimit=2
(int)ThreadPriority=0
} Options;
} APPLICATION;
All subsettings for the ALP application are enclosed in the global section APPLICATION
it contains the following subsections:
- ExecutionMap - Maps file extensions to the
content generator components used to process/execute the resource. Name of the subsection
is the file extension without "." in the beginning. Every subsection can specify
only one file extension.
- File extension subsections -
Name of the section is the file extension handled by the registered with the section
component (in the brackets). For the component names look their documentation. Section
contains common - recognized by the ALP engine records and records and subsections
specific to the registered with the section component. Common records can be omitted and
then default values apply. Common records are:
- (int)RequireAsynch - Accepts values of
0,1,2. Defines how to create the execute the component for request processing:
0 - means synchronous execution that occurs in the main thread. Not
recommended but can speed the work. Can be used without risk only with the trusted
components that do a short processing that can not cause fatal errors such as
CG.newObjects.RawSpool and CG.newObjects.DirList. Not recommended for the content
generators that use COM such as ScriptGen.
1 - Asynchronous execution in a separate thread. Component
processes the request in a thread created by the ALP engine. This allows the browser to
continue to respond to the user actions until the processing goes on and isolates the
component form the ALP engine. Can be used with all components but is not recommended for
the content generators that can cause endless loops without ability to check this
internally.
2 - The same as 1 but with execution monitoring. Created thread is
registered in the spy thread supported by the ALP engine. The spy thread takes care to
cancel the request execution if it continues more than the time specified in the (int)Timeout
value. Not all content generators are able to clean up completely during the cancellation
thus this behavior must be avoided if possible in order to prevent memory leaks. For
example CG.newObjects.GateCGI is able to terminate the external process running the CGI
application and to clean up all internal data but CG.newObjects.ScriptGen component
depends on the Active Script engine capabilities to terminate the script without leaking.
- (int)Timeout - Time in seconds allowed for the
request processing. Takes place only if the RequireAsynch is 2 or if the specified content
generator supports this value itself and the RequireAsynch is 1.
- (int)CheckThatFileExists - instructs
the ALP engine to check if the resource pointed by the URL exists at the pointed location.
Can be 0 - do not check or 1 - check. If 1 is specified engine generates "resource
not found" error without invoking the generator if the file does not exist. In case
of 0 value it passes the request to the generator and the generator itself can take care
about this or can use the file name as a parameter.
- (int)IsScriptEngine - This record has only
administrative meaning. It defines the kind of the section - direct execution (0) or
definition of the scripts executed by a script engine (1). Its value depends on your
choice and it corresponds to the Execute and Scripts records in the alp.directory
that can be used to deny/allow execution of a certain file types in some subdirectories.
- Additional records and subsections depend on the registered content generator component.
- InternalExecutionMap section
contains in ALP 1.0 two sections describing the special exceptions. They follow the same
syntax as the File extension subsections in the ExecutionMap section.
- Directory subsection defines the content
generator used to show directory lists when the URL does not point a file and default file
(see also Documents section in alp.directory) is
not found.
- File subsection defines the content generator used
for "unknown" file types - with extensions not found in the ExecutionMap section.
- Options section contains in the ALP 1.0 records
that define the maximum lifetime for the global cross request objects supported by the
particular content generators. It contains 3 records: (int)SiteObjectsExpireTime,
(int)ApplicationExpireTime, (int)SessionExpireTime. Time is in minutes.
Default values are specified in the global/default alp.application. Warning do not delete
the default values from the global alp.application - ALP engine will assume 0 life time
for the objects and this can cause unexpected results.
- The OutputBufferMaxSize may need a change if your application
may generate huge content in a single request.
- The thread limit should not be changed. In some cases it may
allow you adapt an application for old and slow systems.
- The thread priority can be set to low if you want the ALP
applications to have lower priority than the other applications
on the machine. This can be useful if you want to make sure that
the machine will be able to respond to an event that occurs
during intensive ALP activity.
|