Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "geocortex/essentials/utilities/SiteInitializationUtils"

Index

Functions

detectAndConfigureCors

  • detectAndConfigureCors(siteUrl: string): Deferred
  • Detects if CORS is both necessary (Essentials is on a different origin than the host page) and enabled. If so, the corsEnabledServers are updated to include the Essentials server host.

    Parameters

    • siteUrl: string

    Returns Deferred

    A deferred that is resolved when the detection is complete. The deferred is never rejected.

downloadSite

  • downloadSite(siteUrl: string, successCallback: function, errorCallback: function, deepInitialize?: boolean): void
  • Downloads the Site from the server.

    Parameters

    • siteUrl: string

      URL of the Essentials REST endpoint for this site

    • successCallback: function

      Called with the results on success

        • (results: any): void
        • Parameters

          • results: any

          Returns void

    • errorCallback: function

      Called with the error on failure

        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    • Optional deepInitialize: boolean

      Gets the full site object. Always true in our viewer.

    Returns void

updateDefaultToken

  • updateDefaultToken(token: string, url: string): void
  • Update the site token from a scraped url fragment

    Parameters

    • token: string

      The token as supplied in the fragment

    • url: string

      The url of the site endpoint

    Returns void