Creates a new instance of Application.
Either a string URI, or a configuration object. If a string is passed, it will be treated as a URI and the application will attempt to fetch it. If an object is passed, it will be used as configuration.
An optional container element of the application. The application will constrain its initial region discovery to within this element. This allows multiple framework applications to live on the same page without interfering with each other.
An optional application ID. This will be used to prefix storage keys, allowing for multiple distinct applications to live and store compartmentalized data on the same domain.
An optional set of tokens that can be referenced in configuration.
Occurs when all libraries for this application have been processed. Invoked even if one or more libraries failed to download. To check if a specific library has successfully downloaded, use the hasLibrary function or check the libraries array on the app.
A {@link geocortex.framework.application.Application}.
A collection of resource dictionaries, keyed by locale
Aborts initialization of the application. This is useful for preventing unnecessary processing of configuration or library code in the case that an OAuth style authentication redirect is needed, or an erroneous condition will prevent the app and initialization should be completely aborted.
Indicates whether or not all libraries have been loaded.
Whether or not configuration can be loaded from other domains. If this is set to true
, the application proxy will be used.
An instance of {@link behaviors.BehaviorRegistry} used to manage behaviours. See {@link behaviors.Behavior}.
An instance of {@link commands.CommandRegistry} used to manage and invoke named commands. See {@link commands.Command}.
The object used to provide the application with configuration, if specified.
An optional configuration preprocessor - a function to process the configuration in place before parsing and loading. After initialization, this is nulled out.
Named configuration tokens for injection into JSON configuration. In configuration, tokens are wrapped by brackets like so:
{{TokenKey}}
When the application processes configuration, it will populate these token values according to the name/value pairs in configTokens
.
Note that configuration tokens can only be used as JSON values and not keys.
"siteUri": "sites/{{SiteName}}"
The URI of a JSON configuration block that was used to intialize the application, if it was specified.
Application-wide configuration available to all components. This is defined in the application
section of configuration.
Whether or not the app is in "debug mode", enabling arbitrary debug functionality. Setting debugMode
to true in basic Framework applications
will cause the data-binding engine to leave data-binding statements in the DOM (for inspection purposes).
Additional granuality can be provided by providing a text value along with the URL parameter.
Current supported modes are 'gvh','event','command' and 'view'.
These can be concatenated in a string, or use 'debugMode=all' to turn everything on.
Whether or not the application is in development/debug mode. When an application is in development mode, certain runtime behaviour may differ from when not in development mode. This is a somewhat abritrary flag in place as single, unified application flag.
An instance of {@link events.EventRegistry} used to manage and dispatch named events. See {@link events.Event}.
The path of the hosted address of this application, not including the file portion, e.g. "http://localhost/my/app"
The ID of the application. This is used for keying application-wide resources, for example when using the {@link storage.Store} to store data. It should be a simple string key with no spaces or special characters.
Invoked when the initial state for all modules has been applied.
Invoked when the application has downloaded all libraries and finished initializing.
Whether or not the application was served via HTTPS.
Indicates whether or not the application is functioning in some sort of enhanced native container, e.g. within some native application container or framework.
Indicates whether or not the application is functioning in an offline mode. Setting this Observable changes the online/offline state of the application (for applications with offline capabilities).
Is the application in the middle of the shutdown process?
Indicates the address of the native layer, if the web app has been loaded within a GMAF instance
The namespace for accessing data for a particular app.
An access token which needs to be provided in order to access any of the local server endpoints.
The application's locale identifier. The application will attempt to pull a locale identifier from the navigator
object
if present. The locale can, by default, be overriden in the URL like so: index.html?locale=en-CA
.
An application-wide instance of a {@link ui.RegionAdapterBase} that creates and manages a modal popup.
An instance of ModuleManager used to manage application modules.
An optional proxy URI to use.
Name of the current shell
A {@link geocortex.framework.storage.Store} to manage and facilitate storage of local data, particularly for offline use,.
The instance of a {@link geocortex.framework.utils.Trace} facility used by this application instance.
An object containing the URL parameters passed into the application.
The version of the app. Defaults to the primary version of Framework.js.
The {@link geocortex.framework.ui.ViewManager} instance used to manage hierarchies of regions and views.
Returns a promise that will be resolved when a module providing a particular view is loaded. If the module is loaded already the promise resolves immediately.
Wait for the specified collection of modules to load. Resolves immediately if the modules are loaded or do not exist.
Returns a promise that will be resolved when all deferred modules providing command fragments for a command are loaded. If all the modules are loaded already the promise resolves immediately.
Helper method to determine if a certain debug mode is currently active.
String representing the mode to check
Fetches a configuration resource, provided it comes from the same domain or a whitelisted domain.
Arguments containing a URL to fetch. These will be passed directly into an XmlHttpRequest via dojo.xhrGet
.
System-wide method to get a FrameworkObject by ID.
The ID of the object to fetch.
System-wide method to get a FrameworkObject by ID asynchronously whenever it's registered with this application
The ID of the object to fetch.
Gets the container element of the application.
Subclasses can override this method to supply the initial state that will be applied to a module.
Returns the order that a library has been configured in.
The ID of the library.
Gets a language resource from the Application's resource dictionary, given a library ID, key, and optional locale. Returns null if the resource does not exist.
The ID of the library the resource is for.
The resource key.
The locale of the resource to fetch. Defaults to the current application locale.
Return an array of stashed log. This is meant to be called one, since after it is called, it will stop stashing logs. This should be used by the log module.
Returns a URI, using the proxy if configured. Warns when mixed HTTP/HTTPS content is requested.
A relative or absolute URI to format.
Returns the url parameter, ignoring case.
The parameter to run a case insensitive search for and retrieve
The url parameter if found, or null
Given the name of a module that is not present, returns true if this is a module that could be loaded.
Does a library with this id exist?
Includes and runs a script file. Called from '_loadTraditionalLibraries'
The callback to fire if the script was successfully served via JSONP.
The callback to fire if any error occurred trying to download the script.
Begins the application initialization process.
Adds the specified library resources for the specified library and locale to the application.
The ID of the library to inject resources for.
The dictionary of resources.
The locale of the resources.
Instantiates a new FrameworkObject, passing in the application instance.
The fully-qualified name of the type to instantiate.
The ID of the library that this object belongs to.
Determines whether or not a URI is HTTPS by looking at the scheme.
The URI to test.
Loads all deferred modules that have views in the specified region that are configured visible. These views will auto-populate the region so there is no need to wait for them.
Given a relative URI, returns an absolute URI based on the application's URI.
The relative URI to make absolute.
Optional. Allows you to make the URI absolute using a different URI base.
Called by the framework to notify the application that a library has been downloaded.
The ID of the library that has been downloaded.
Called immediately after the configuration object has been loaded from JSON, before any libraries have been downloaded.
Return the names of all modules that provide command fragments for this command, and which have not yet been loaded.
Takes a string with 0 or more tokens in it, and returns a string with the replacement tokens replaced.
The string with the replacement tokens in it.
Registers a Framework.js object. Framework objects are registered against an Application for clean-up later.
The object to register. This object must have a unique ID.
Tests whether a not a library should have its styles omitted.
The ID of the library in question.
Shuts down the application, releasing all modules, views, bindings, view models, regions, commands, and events.
Custom state object, indicating a shutdown reason or exception.
Translates configuration, substituting library-specific culture specific strings for the appropriate locale.
The ID of the library that the module configuration belongs to.
The configuration to translate.
Returns a promise that is fulfilled when all the libraries are loaded.
Returns a promise that is fulfilled when the 'shell' is stabilized. Note that the shell might not exist, but we still need to resolve this at a time, so we'll do it when the libraries load.
Represents a Framework.js application instance. Application provides library and module loading services and offers application-level lifecycle support and infrastructure. An instance of Application will utilize framework services to provide and manage an application lifecycle for a collection of modules to participate in.