Click or drag to resize

IAppContext Properties

The IAppContext type exposes the following members.

Properties
  NameDescription
Public propertyApplicationRoot
Returns the root virtual folder for the application.
Public propertyAppVersion
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).
Public propertyBestTextCulture
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.
Public propertyBrowser
Returns the BrowserInfo information object about the current request's browser.
Public propertyComponents
Returns the collection of ComponentInfo objects.
Public propertyCSRFToken
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.

Public propertyCulture
The general CultureInfo (.Net culture object) to use for the application.
Public propertyCurrentPage
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.
Public propertyDatabases
The collection of IDatabase objects associated with this application.
Public propertyDataCache
Gets the operational data CacheManager object for this application.
Public propertyDataDB
Get the primary data source IDatabase for the application. Note that the data source IDatabase is also contained in the Databases collection. The DataDB is identified with the IsDefault attribute on its data source. See also MasterDB and RepositoryDB.
Public propertyDisposableObjects
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.
Public propertyDocumentLang
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.
Public propertyEventInfos
Returns the EventInfo objects collection.
Public propertyExtensions
Gets the collection of IExtension objects configured for this application.
Public propertyFavorites
Returns the favorites (bookmarks) collection for this user.
Public propertyFeatures
Returns the current set of Feature objects for the application
Public propertyFilters
The collection of SavedFilter objects for the application.
Public propertyID
Sets/Gets the application ID.
Public propertyIsDeveloper
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.
Public propertyIsProduction
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.
Public propertyIsStrictMode
Determines whether or not the application is being run in "strict" mode. In strict mode platform security is more restrictive. In particular:
  • Mapper fields that are not visible are treated as "sensitive" by default (excepting fields marked as PK, UniqueKey, or SubformKey). Sensitive fields are not rendered into the HTML in any form when not visible to the current user. Since this will prevent their use in javascript, a field can be marked with FieldSecurityAttrs.DOMAccessed to specify that it should be rendered into HTML even when not visible to the current user.
  • Values posted back for mapper fields that were (or should have been) locked, hidden, or omitted when the page was rendered will be ignored. Since this will prevent values being saved that were set on such fields in javascript, a field can be marked with FieldSecurityAttrs.DOMModified to specify that posted back value changes should be accepted even when locked, hidden, or omitted.
Public propertyIsTest
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>
Note that IsProduction, IsTest, and IsDeveloper are independent of one another and various combinations are valid.
Public propertyIsValid
Indicates whether the context is valid or not.
Public propertyMasterDB
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.
Public propertyMetadataCache
Gets/Sets the value of the application property "MetadataCache">
Public propertyMetaTableInfos
Returns the MetaTableInfo objects collection.
Public propertyModuleInfos
The collection of ModuleInfo objects for the application.
Public propertyNamedFilters
Returns the NamedFilter objects collection.
Public propertyNavigators
The collection of Navigator objects for the application.
Public propertyPageInfos
The collection of PageInfo objects for the application.
Public propertyPerfmonObjects
The collection of PerfmonObjects objects for the application.
Public propertyPicklists
Returns the collection of Picklist items.
Public propertyProperties
The Properties collection of Property objects for this object.
(Inherited from IEAPBase.)
Public propertyReports
Returns the collection of Report objects.
Public propertyRepositoryDB
Get the primary repository IDatabase for the application. Note that the repository IDatabase is also contained in the Databases collection . See also MasterDB and DataDB.
Public propertyServices
Returns the collection of IServiceInfo objects.
Public propertySession
Gets/sets the Session object.
Public propertySettings
The set of application settings loaded from the xot_app_setting.
Public propertyTemplates
Returns the collection of Template objects.
Public propertyTextItems
The TextItems collection of TextItem localized text objects for this object.
(Inherited from IEAPBase.)
Public propertyTimeZones
Returns the TimeZone object collection.
Public propertyTLSCache
Provides access to this thread's Thread-Local Storage (TLS) cache.
Public propertyUserContext
Returns the UserContext object.
Public propertyVersion
Gets/sets the version of this object's assembly.
(Inherited from IEAPBase.)
Public propertyVersions
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: In these cases the inclusion of specific items can configured to be version-specific by setting a particular item's Version and Min Version and/or Max Version. Where the Version is name of the EAPVersion item in this collection and the Min Version and Max Version are the minimum and maximum version numbers, respectively, for that version for which the versioned-item should be included (note that you may specify a minimum without a maximum, or vice versa). By using an appropriate combination of min/max values you can define identical objects that phase in and out for specific versions.

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.

Public propertyVocab
Tenant-specific vocabulary overrides.
Top
See Also