Class CxpAbstractPage() Foundation

This class implements the core features for any <CXP/> page created by the CxcBuilder.

Description

All <CXP/> pages are by default derived from this class. Whenever a <CXP/> page needs to be rebuild, the CxcBuilder first creates an intermediate PRG file for the page. This file contains the implementation of a class which by default is derived from CxpAbstractPage. You can override this default behaviour by using the inherits directive.

Unless specified otherwise, the code and HTML markup contained in a CXP file is emitted into the :Render() method of the page class. This means that for a simple <CXP/> page, the framework just executes :Render() to display the page at runtime. In this case, the HTML markup together with any output generated with the ?/?? commands will be used to create the response send back to the browser after a page request.

For more complex scenarios, <CXP/> applications can use the code-locality directive to control the location where code is emitted in the intermediate PRG file created by the CxcBuilder. This way, application code can be made to execute not only during :Render(), but also when a page is loaded, for example. In addition, by using the HttpResponse Object and its dedicated output methods, the :Render() method of a <CXP/> page can return other content than just plain HTML.

Configuration

NOTE: The following sample config file shows the usage of the configuration options outlined previously.

<!-- Session management is done using cookies, --> 
<!-- the session times out after 45 minutes.   --> 
<!-- The session timeout counter is reset with --> 
<!-- each incoming request                     --> 
<sessionmanager 
 provider="CxpCookieSessionManager" 
 timeout="45"/> 

<!-- Because this page needs to share session  --> 
<!-- state with another application/page, the  --> 
<!-- storage manager is set up accordingly.    --> 
<storagemanager 
 provider="AppStorageManager" 
 store="/user-account-mgmt/cxp-data/hierarchical-storage"/> 

<!-- This pages makes use of the authentication--> 
<!-- controller in the user-account-mgmt       --> 
<!-- application                               --> 
<using> 
<solution location="/user-account-mgmt"> 
  <requires controller="Authentification"/> 
</solution> 
</using> 

<!--- This page has a caching policy of 5      --> 
<!--- requests, meaning it is served from the  --> 
<!--- cache and executed only every 5 requests --> 
<cachepolicy 
 provider="CxpCacheTimeoutByRequests" 
 Requests ="5" 
/> 

:CachePolicy
Determines the cache policy of the page.
:ConfigFile
Fully-qualified filename of the config file of the page.
:Config
Represents the root node of the configuration data for the page.
Properties
:Application
References the CxpApplication object the page belongs to.
:Session
References the session object handling session state for the page.
:Host
References an object for accessing functionality of the host machine or WWW server the <CXP/> application is running on.
:Data
References a container object which handles the data associated with the page.
:Params
Contains a container object for the parameters passed to the page.
:File
Contains the fully-qualified URL of the <CXP/> file, such as localhost/samples/index.cxp.
:Path
Contains the path to the page, such as localhost/samples/.
:PhysicalPath
Contains the path of the physical file location of the page, eg. c:\inetpub\samples\.
:HttpRequest
References a HttpRequest object representing the incoming request to the page.
:HttpResponse
References a HttpResponse object representing the response created by the page.
:Trace
Enables or disables tracing output.
Layout Management
:HasLayout()
Determine if the page has a layout associated.
:HasSection()
Determine if a specific Section has been defined
:RenderSection()
Renders the content of the given section by name
:SelectSection()
Selects a section by name.
Deferred Methods
:Render()
Renders the page content which is returned to the client browser.
:Load()
Gets executed when the page is loaded into memory.
:Unload()
Gets executed when the page is unloaded from memory. Page unloading occurs when a <CXP/> worker process is recylced or when the www server shuts down.
Error-handling and tracing-support
:Trace()
Output trace information to the Windows Debug interface.
:ErrorHandler()
The default handler for runtime errors occuring during page execution.
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.