Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ria/util/License

You can use this module to load the license information from a URL that you define or directly from the text contents.

If you do not call any of these methods, LuciadRIA will look for the license at its default location: license/luciadria_development.txt or license/luciadria_deployment.txt

Note: You need to call this method before you load any other code of LuciadRIA.

For production releases you have two alternative approaches for accessing license data:

  • You can bundle the license information into the distribution.
  • You don't include a license information into the distribution package. The license information is resolved in run-time from provided URL location, or a choice of URL locations.

The example below shows the main application module that delegates the license load task to licenseLoader. Note that the licenseLoader is imported for a side-effect action. Please consult License class API to see examples on how the licenseLoader can be implemented.

// your main.js

import "./licenseLoader";
import {Map} from "luciad/view/Map";

const map = new Map("map");
// the rest of your application here.

Overview

Functions

loadLicenseFromUrl

  • Tells LuciadRIA to load the license information from the given url.

    Parameters

    • url: string

      The url from where to load the license data. The url is loaded as is, and the response is handled as UTF-8 encoded text data.

    Returns Promise<string>

    The promise for the license data. You do not need to wait for this Promise yourself, LuciadRIA will wait for the url to be loaded before performing the license check.

    The example shows how to load the license information from a URL. Here the URL points to a location relative to the application root.

    // LicenseLoader.js
    import {loadLicenseFromUrl} from "@luciad/ria/util/License";
    loadLicenseFromUrl("luciadria_deployment.txt");

loadLicenseFromUrls

  • (urls: string[]): Promise<string>
  • Tells LuciadRIA to load the license information from the choice of urls. This function can be used to load a development license or a deployment license, depending which one is provided, or to load a license served from various locations.

    Parameters

    • urls: string[]

      The array of urls to load the license data from. License data is loaded from the first url location which yields data.

    Returns Promise<string>

    The promise for the license data. You do not need to wait for this Promise yourself, LuciadRIA will wait for the url to be loaded before performing the license check.

    The example shows how to load the license information either from the "luciadria_development.txt" URL or "luciadria_deployment.txt" URL, depending which one gets resolved first. Here both URLs point to locations relative to the application root.

    // LicenseLoader.js
    import {loadLicenseFromUrls} from "@luciad/ria/util/License";
    loadLicenseFromUrls(["luciadria_development.txt", "luciadria_deployment.txt"]);

setLicenseText

  • (licenseText: string): void
  • Sets the license data to the given text.

    Parameters

    • licenseText: string

      The text contents of the license file you were given by Luciad's customer services department.

      The example shows how to load the contents of the license file as a string. Here the license information is bundled in your application distribution package with the aid of webpack's loader (raw-loader).

      // LicenseLoader.js
      import {setLicenseText} from "@luciad/ria/util/License";
      import license from "raw-loader!./luciadria_development.txt";
      setLicenseText(license);

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method