Options
All
  • Public
  • Public/Protected
  • All
Menu

The framework application. Build on top the GVH framework.

Hierarchy

Index

Constructors

constructor

  • new Application(configObject: any, hostElement?: HTMLElement, id?: string, configTokens?: object): Application
  • Parameters

    • configObject: any
    • Optional hostElement: HTMLElement
    • Optional id: string
    • Optional configTokens: object
      • [token: string]: string

    Returns Application

Events

onLibrariesDownloaded

  • 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.

    Parameters

    • app: Application

      A {@link geocortex.framework.application.Application}.

    Returns void

Properties

_resourceDictionaries

_resourceDictionaries: object

Type declaration

  • [key: string]: any

abortInitialization

abortInitialization: boolean

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.

allLibrariesLoaded

allLibrariesLoaded: boolean

Indicates whether or not all libraries have been loaded.

allowCrossDomainConfig

allowCrossDomainConfig: boolean

Whether or not configuration can be loaded from other domains. If this is set to true, the application proxy will be used.

behavior

behavior: BehaviorBase

behaviorRegistry

behaviorRegistry: BehaviorRegistry

An instance of {@link behaviors.BehaviorRegistry} used to manage behaviours. See {@link behaviors.Behavior}.

bridgeInitialized

bridgeInitialized: boolean

Is the bridge initialized.

command

commandRegistry

commandRegistry: CommandRegistry

An instance of {@link commands.CommandRegistry} used to manage and invoke named commands. See {@link commands.Command}.

configModel

configModel: ConfigurationModel

The object used to provide the application with configuration, if specified.

configPreprocessor

configPreprocessor: function

An optional configuration preprocessor - a function to process the configuration in place before parsing and loading. After initialization, this is nulled out.

Type declaration

    • (configObject: any): void
    • Parameters

      • configObject: any

      Returns void

configTokens

configTokens: object

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}}"

Type declaration

  • [key: string]: string

configUri

configUri: string

The URI of a JSON configuration block that was used to intialize the application, if it was specified.

configuration

configuration: ApplicationJson

Application-wide configuration available to all components. This is defined in the application section of configuration.

debugMode

debugMode: boolean

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).

developmentMode

developmentMode: boolean

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.

event

eventRegistry

eventRegistry: EventRegistry

An instance of {@link events.EventRegistry} used to manage and dispatch named events. See {@link events.Event}.

host

host: string

The path of the hosted address of this application, not including the file portion, e.g. "http://localhost/my/app"

id

id: string

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.

initialStateAppliedCallback

initialStateAppliedCallback: function

Invoked when the initial state for all modules has been applied.

Type declaration

initializationCompleteCallback

initializationCompleteCallback: function

Invoked when the application has downloaded all libraries and finished initializing.

Type declaration

isArcGisWebApp

isArcGisWebApp: boolean

Are we running in a WebAppBuilder app.

isHttpsMode

isHttpsMode: boolean

Whether or not the application was served via HTTPS.

isNative

isNative: Observable<boolean>

Indicates whether or not the application is functioning in some sort of enhanced native container, e.g. within some native application container or framework.

isOffline

isOffline: Observable<boolean>

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).

isUsingBridge

isUsingBridge: boolean

Are we going through the bridge.

localServerAddress

localServerAddress: string

Indicates the address of the native layer, if the web app has been loaded within a GMAF instance

localServerNamespace

localServerNamespace: string

The namespace for accessing data for a particular app.

localServerToken

localServerToken: string

An access token which needs to be provided in order to access any of the local server endpoints.

locale

locale: string

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.

map

map: Map

The Esri map.

modalRegionSingleton

modalRegionSingleton: PopupModalRegionAdapter

An application-wide instance of a {@link ui.RegionAdapterBase} that creates and manages a modal popup.

moduleManager

moduleManager: ModuleManager

An instance of ModuleManager used to manage application modules.

proxyUri

proxyUri: string

An optional proxy URI to use.

shellName

shellName: "Desktop" | "Tablet" | "Handheld"

Name of the current shell

store

store: Store

A {@link geocortex.framework.storage.Store} to manage and facilitate storage of local data, particularly for offline use,.

trace

trace: Trace

The instance of a {@link geocortex.framework.utils.Trace} facility used by this application instance.

urlParameters

urlParameters: object

An object containing the URL parameters passed into the application.

Type declaration

  • [key: string]: string

version

version: string

The version of the app. Defaults to the primary version of Framework.js.

viewManager

viewManager: ViewManager

The {@link geocortex.framework.ui.ViewManager} instance used to manage hierarchies of regions and views.

Methods

addNativeReadyFunction

  • addNativeReadyFunction(callback: function): void

fetchConfigResource

  • fetchConfigResource(args: object): any
  • Fetches a configuration resource. It will honor CORS. NOTE: This method overrides the base class function since it has an issue with CORS. GVH-15743

    Parameters

    • args: object

      Arguments containing a URL to fetch. These will be passed directly into an XmlHttpRequest via dojo.xhrGet.

      • Optional error?: function
          • (error: any): void
          • Parameters

            • error: any

            Returns void

      • Optional load?: function
          • (load: any): void
          • Parameters

            • load: any

            Returns void

      • url: string

    Returns any

freeAllFrameworkObjects

  • freeAllFrameworkObjects(): void

getFrameworkObjectById

getFrameworkObjectByIdAsync

  • getFrameworkObjectByIdAsync(id: any, callback: function, errBack?: function): void
  • System-wide method to get a FrameworkObject by ID asynchronously whenever it's registered with this application

    Parameters

    • id: any

      The ID of the object to fetch.

    • callback: function
    • Optional errBack: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

getHostElement

  • getHostElement(): HTMLElement
  • Gets the container element of the application.

    Returns HTMLElement

Protected getInitialState

  • getInitialState(moduleName: string, libraryId: string): Thenable<Object>
  • Subclasses can override this method to supply the initial state that will be applied to a module.

    Parameters

    • moduleName: string
    • libraryId: string

    Returns Thenable<Object>

getLibraryOrder

  • getLibraryOrder(libraryId: string): number
  • Returns the order that a library has been configured in.

    Parameters

    • libraryId: string

      The ID of the library.

    Returns number

getResource

  • getResource(libraryId: string, key: string, locale?: string): string
  • 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.

    Parameters

    • libraryId: string

      The ID of the library the resource is for.

    • key: string

      The resource key.

    • Optional locale: string

      The locale of the resource to fetch. Defaults to the current application locale.

    Returns string

getSavedState

  • getSavedState(): any
  • Get the current savedState from all the registered handlers. Note: All the states are sitting next to each on the resutling object.

    Returns any

getStashedLogs

  • getStashedLogs(): any[]
  • 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 any[]

getUri

  • getUri(uriPiece: string): string
  • Returns a URI, using the proxy if configured. Warns when mixed HTTP/HTTPS content is requested.

    todo

    Review if this is used anymore. May be time to deprecate it.

    Parameters

    • uriPiece: string

      A relative or absolute URI to format.

    Returns string

getUrlParameter

  • getUrlParameter(paramName: string): string
  • Returns the url parameter, ignoring case.

    Parameters

    • paramName: string

      The parameter to run a case insensitive search for and retrieve

    Returns string

    The url parameter if found, or null

hasLibrary

  • hasLibrary(libraryId: string): boolean
  • Parameters

    • libraryId: string

    Returns boolean

includeScript

  • includeScript(uri: string, successCallback: function, errorCallback: function): void
  • Includes and runs a script file.

    Parameters

    • uri: string
    • successCallback: function

      The callback to fire if the script was successfully served via JSONP.

        • (script: string): void
        • Parameters

          • script: string

          Returns void

    • errorCallback: function

      The callback to fire if any error occurred trying to download the script.

        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns void

initialize

  • initialize(): void

injectLibraryResources

  • injectLibraryResources(libraryId: string, dictionary: object, locale: string): void
  • Adds the specified library resources for the specified library and locale to the application.

    Parameters

    • libraryId: string

      The ID of the library to inject resources for.

    • dictionary: object

      The dictionary of resources.

      • [key: string]: any
    • locale: string

      The locale of the resources.

    Returns void

instantiateFrameworkObject

  • instantiateFrameworkObject(typeName: string, libraryId: string): any
  • Instantiates a new FrameworkObject, passing in the application instance.

    Parameters

    • typeName: string

      The fully-qualified name of the type to instantiate.

    • libraryId: string

      The ID of the library that this object belongs to.

    Returns any

isHttpsUri

  • isHttpsUri(uri: string): boolean
  • Determines whether or not a URI is HTTPS by looking at the scheme.

    Parameters

    • uri: string

      The URI to test.

    Returns boolean

makeAbsolute

  • makeAbsolute(uri: string, appPathOverride?: any): string
  • Given a relative URI, returns an absolute URI based on the application's URI.

    Parameters

    • uri: string

      The relative URI to make absolute.

    • Optional appPathOverride: any

      Optional. Allows you to make the URI absolute using a different URI base.

    Returns string

notifyLibraryDownload

  • notifyLibraryDownload(libraryId: string): void
  • Called by the framework to notify the application that a library has been downloaded.

    Parameters

    • libraryId: string

      The ID of the library that has been downloaded.

    Returns void

onConfigurationLoaded

  • onConfigurationLoaded(configObject: any): void
  • Called immediately after the configuration object has been loaded from JSON, before any libraries have been downloaded.

    Parameters

    • configObject: any

    Returns void

performTokenReplacement

  • performTokenReplacement(value: string): string
  • Takes a string with 0 or more tokens in it, and returns a string with the replacement tokens replaced.

    Parameters

    • value: string

      The string with the replacement tokens in it.

    Returns string

registerFrameworkObject

registerSavedStateProvider

  • registerSavedStateProvider(key: string, handler: function): void
  • Allow any module/views/viewmodel to register a handler that will be called when the app is being unloaded. The handler will need to return a json object to save.

    Parameters

    • key: string
    • handler: function
        • (): any
        • Returns any

    Returns void

shouldOmitStylesForLibrary

  • shouldOmitStylesForLibrary(libraryId: string): boolean
  • Tests whether a not a library should have its styles omitted.

    Parameters

    • libraryId: string

      The ID of the library in question.

    Returns boolean

shutdown

  • shutdown(state: any): void
  • Shuts down the application, releasing all modules, views, bindings, view models, regions, commands, and events.

    Parameters

    • state: any

      Custom state object, indicating a shutdown reason or exception.

    Returns void

Private translateConfiguration

  • translateConfiguration(libraryId: string, configuration: any): any
  • Translates configuration, substituting library-specific culture specific strings for the appropriate locale.

    Parameters

    • libraryId: string

      The ID of the library that the module configuration belongs to.

    • configuration: any

      The configuration to translate.

    Returns any

waitUntilApplicationInitialized

  • waitUntilApplicationInitialized(): Promise<any>
  • Returns a promise that is fulfilled when the application is initialized.

    Returns Promise<any>

waitUntilBridgeInitialized

  • waitUntilBridgeInitialized(): Promise<any>
  • Returns a promise that is fulfilled when the bridge is initialized.

    Returns Promise<any>