Save as Word Document | Find | English | Portugues(Brasil)

Reasons for the XMLNuke
The class Context

The class Context - Their use and importance to the XMLNuke

Table of contents
1. Introductory Concepts
2. The Context class
3. The FilenameProcessor Class
4. The LanguageCollection Class
5. AnyDataSet and Data Access
6. The "Util" NameSpace
7. Structure of Directories

On this page
The Context Class
Examples of use


The Context Class

The Context class is the most used class in all applications based on the XMLNuke framework. Its purpose is to COMPLETELY abstract the environment external to XMLNuke.

This class implements the Design Pattern Façade and offers a series of functions so that the programmer does not need to use classes and/or functions from programming language. With this, an isolation layer is created for XMLNuke applications, which also means that this same application can run on ANY operating system. It also enables XMLNuke programmers who program in PHP to program in XMLNuke/CSharp without much effort, since the programmer already knows that the Context that provides what he needs is implemented in every version of XMLNuke.

Functions of the Context class:

  • Handle GET and Posts requests
  • Handle Cookies
  • Handle Sessions
  • Obtain an authenticated user
  • Login/logout of the system
  • Define the standard parameters SITE, XML, XSL, etc.
  • Obtain the paths on which XMLNuke is installed and the paths to the standard site
  • Various other functions
It is common for the Context class to be sent to the functions, since they contain various basic elements for the functioning of XMLNuke.

Examples of use

In the user modules, the Context class is defined as a property of the module. The most basic function of the Context class is to obtain a parameter that was sent through the GET or POST method.

For example, for the request http://localhost/xmlnuke.php?param=9, to obtain the value of ?param? that was sent, the following commands must be used:

CSharp
string result = this._context.ContextValue("param");
PHP
$result = $this->_context->ContextValue("param");

Previous
Introductory Concepts
Next
The FilenameProcessor Class