Internet Technologies:cxp

Configuration management Foundation

Various aspects of the CXP infrastructure can be configured using configuration files which are loaded automatically prior to processing a page request. Options configured in the global configuration file are used for every CXP page. However, these defaults can be overriden on per-page basis through the usage of page-specific configuration files.

Configuration files must contain valid XML syntax and begin with the line

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> 

Each XML node in a configuration file corresponds to a certain feature or function group, and each XML attribute represents an option or setting which is configured. The paragraph below shows an exemplary configuration file.

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> 
<cachepolicy 
provider="CxpCacheTimeoutByRequests" 
Requests ="3"/> 

Global settings

Various aspects of the CXP infrastructure can be configured in a global configuration file named global.config. This file is optional. If it is used, it must be placed in the web server's document root directory and it must contain valid XML syntax. The global.config file is loaded automatically when the CXP system is initialized prior to processing a page request. Each XML node in the file corresponds to a certain feature or function group, and each XML attribute represents an option or setting which is configured. Sections or attributes not specified in global.config are initialized to their default values. The following sections list the various CXP features which are configurable through the global.config file.

Section httpmanager

The HttpManager configures settings on the HTTP protocol-level of the CXP infrastructure. The following exemplary XML fragment configures CXP so that uploaded files are written to the folder c:\upload.

<httpmanager 
UseUploadFolder="yes" 
UploadFolder="c:\upload"/> 

Section StorageManager

The StorageManager configures the storage provider and the storage location for session, application and page related data which is persistet automatically by the CXP Infrastructure. At runtime this storage is accessible via CxpAbstractPage:Data or CxpApplication:Data.

<storagemanager 
provider="AppStorageManager" 
store="./cxp-data/shared-storage"/> 

Section sessionmanager

The SessionManager configures session-specific settings. The XML fragment below configures CXP to maintain session persistence via cookies stored in the client browser.

<sessionmanager 
provider="CxpCookieSessionManager" 
timeout="45"/> 

Application settings

Application specific settings are maintained in the application.config file. It is responsible for all CXP pages in the current directory and its subdirectories. However, if there is a page-specific config file, the page specific configuration overwrittes the application.config setting.

User-defined sections

In addition to the sections which configure certain system attributes, user-defined sections can be defined in the application.config file. Usually, a separate XML node is defined per feature or function group. The attributes of the XML node correspond to the configurable attributes. The following paragraph contains an example for a user-defined section which defines the mail server properties to be used in CXP pages.

<smtp server   = "mail.yoursite.com" 
sender   = "sample@yoursite.com" 
user     = "sample" 
pwd      = "password" 
Recipient= "sample.recipient@yoursite.com" 
Admin    = "webmaster@yoursite.com" 
test     = "yes" /> 

The various properties can be accessed via the :Config instance variable of the application object. The following line of code reads the user name configured in the application.config file:

cUser := ::Application:Config:Smtp:User 

Page-specific settings

Various aspects of the CXP infrastructure can be configured individually on a per-page basis. This is done in a configuration file which must be named after the page, such as mypage.config. This file is optional. If it is used, it must be placed in the same folder as the corresponding page and it must contain valid XML syntax. The page config file is loaded automatically prior to to processing a page request. Each XML node in the file corresponds to a certain feature or function group, and each XML attribute represents an option or setting which is configured. Sections or attributes not specified in the page config file are initialized to the values configured in the global.config file. If no global config file exists, default values are used instead. The following sections list the various CXP features which are configurable through the page config file.

Section cachepolicy

The CachePolicy configures the policy based on which the CXP infrastructure caches page execution. The following exemplary XML fragment causes the page to be rerendered every three requests.

<cachepolicy 
provider="CxpCacheTimeoutByRequests" 
Requests ="3"/> 

User-defined sections

In addition to the sections which configure certain pageattributes, user-defined sections can be defined in the configuration file. Usually, a separate XML node is defined per feature or function group. The attributes of the XML node correspond to the configurable attributes. The following paragraph contains an example for a user-defined section which configures the name of the folder for storing the database files used in the CXP page.

<databases 
folder = "./databases"/> 

The configured properties can be accessed via the :Config instance variable of the page object. The following line of code reads the name of the database folder:

cFolder := ::Config:databases:folder 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.