AppContext Properties |
The AppContext type exposes the following members.
Name | Description | |
---|---|---|
ApplicationRoot |
Returns the root virtual folder for the application.
| |
AppVersion |
Gets the application build version number (not the platform version number). Currently this is determined from the file version of the first
application extension (if any).
| |
BestTextCulture |
Gets the best text locale available to the application (according to the available resource files) to satisfy the
desired locale specified via the application's CultureInfo property.
Note that this is the "best" text locale available, but not all text items are necessarily available from the "best"
resource. When no matching text is found in the "best" resource, other resources will be searched.
At this time the platform provides a standard "en" (theoretically non-specific English, but in practice U.S. English) resource file only.
An application can include custom resource files by placing appropriately named resource files in the folder specified in
the CustomResourcePath application property.
| |
Browser |
Returns the BrowserInfo information object about the current request's browser.
| |
Components |
Returns the collection of ComponentInfo objects.
| |
CSRFToken |
Gets the current Cross-Site Request Forgery (CSRF) token.
Normally the CSRF token is automatically injected into a form when the page is rendered and validated when the page
is posted back. You can use ValidateCSRFToken(String, CSRFValidationOptions) if explicit validation is required.
CSRF token use can be disabled by setting NoCSRFToken on the application.
A good CSRF overview can be found at
Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet
which describes CSRF thusly:
Cross-Site Request Forgery (CSRF) is a type of attack that occurs when a malicious web site, email, blog, instant message, or program causes a user’s web browser to perform an unwanted action on a trusted site for which the user is currently authenticated. The impact of a successful CSRF attack is limited to the capabilities exposed by the vulnerable application. For example, this attack could result in a transfer of funds, changing a password, or purchasing an item in the user's context. In effect, CSRF attacks are used by an attacker to make a target system perform a function via the target's browser without knowledge of the target user, at least until the unauthorized transaction has been committed. | |
Culture |
The general CultureInfo (.Net culture object) to use for the application.
| |
CurrentPage |
Gets/sets the current .Net Page being rendered. In general, this value is set as soon as the application context
is attached to the page. Note that in cases where a page is not being rendered, e.g. AJAX calls, scheduled services,
etc., this value will be null.
| |
Databases |
The collection of IDatabase objects associated with this application.
| |
DataCache |
Gets the operational data CacheManager object for this application.
| |
DataDB | ||
DisposableObjects |
Returns a list of objects tracked by the application. These objects include all IDataReader objects opened
via OpenDataReader(String, IDbConnection, DataFuncOptions, String, String) and
all IMapper objects.
| |
DocumentLang |
Gets the language id to use for the page's HTML tag as specified in https://www.w3.org/International/questions/qa-html-language-declarations.
Note that the language is based on the BestTextCulture value.
| |
EventInfos |
Returns the EventInfo objects collection.
| |
Extensions |
Gets the collection of IExtension objects configured for this application.
| |
Favorites |
Returns the favorites for this application's user
| |
Features |
Returns the current set of Feature objects for the application
| |
Filters |
The collection of SavedFilter objects for the application.
| |
ID |
Sets/Gets the application ID.
| |
IsDeveloper |
Determines whether or not the current user is a developer or the current code is a DEBUG build.
Note that IsProduction, IsTest, and IsDeveloper are independent of one
another and various combinations are valid.
| |
IsProduction |
Gets/Sets the value of the application property "IsProduction". The IsProduction flag is intended to suppress
possibly-sensitive developer information on a site that is on the open internet. Control of information that is
less sensitive and should be available in test systems, even when on the open internet, is based on the
IsTest property.
Note that IsProduction, IsTest, and IsDeveloper are independent of one
another and various combinations are valid.
| |
IsStrictMode |
Determines whether or not the application is being run in "strict" mode. In strict mode
platform security is more restrictive. In particular:
| |
IsTest |
Gets/Sets a flag is intended to suppress non-sensitive tester/developer information that should be available in
a test environment even when that system is on the open internet. More sensitive information that should always
be suppressed on the open internet, even in a test system, is controlled by the IsProduction
flags.
The IsTest property is controlled by the application's web.config
file's appSettings section test_environment key and defaults to false:
<appSettings> <add key="test_environment" value="true"/> </appSettings> | |
IsValid | Used to determine if the object is valid or not. | |
MasterDB |
Get the master data source IDatabase for the application. The master data source is consistent across all
tenants even when per-tenant data source mappings are used. When no such mappings are used this will be the same
as the DataDB.
The MasterDB is identified with the IsMaster attribute on its data source.
See also RepositoryDB.
| |
MetadataCache |
Gets/Sets the value of the application property "MetadataCache">
| |
MetaTableInfos |
Returns the MetaTableInfo objects collection.
| |
ModuleInfos |
The collection of ModuleInfo objects for the application.
| |
NamedFilters |
Returns the NamedFilter objects collection.
| |
Navigators |
The collection of Navigator objects for the application.
| |
PageInfos |
The collection of PageInfo objects for the application.
| |
PerfmonObjects |
The collection of PerfmonObjects objects for the application.
| |
Picklists |
Returns the collection of Picklist items.
| |
Properties |
The Properties collection of Property objects for this object.
| |
Reports |
Returns the collection of Report objects.
| |
RepositoryDB | ||
Services |
Returns the collection of IServiceInfo objects.
| |
Session |
Gets/sets the Session object.
| |
Settings |
The set of application settings loaded from the xot_app_setting.
| |
Templates |
Returns the collection of Template objects.
| |
TextItems | ||
TimeZones |
Returns the TimeZone object collection.
| |
TLSCache |
Provides access to this thread's Thread-Local Storage (TLS) cache.
| |
UserContext |
Returns the UserContext object.
| |
Version |
Gets/sets the version of this object's assembly.
| |
Versions |
The collection of EAPVersion objects for this application. The versions defined in this collection
can be used programmatically to control application behaviour in your code. It can also be used declaratively to
switch on/off certain meta-data thoughout the application:
Initially Versions are loaded into the collection from the xmt_versions table which is managed in the NetQuarry Studio. Versions can also be added (or removed or modified) programmatically. | |
Vocab |
Tenant-specific vocabulary overrides.
|