Locker
  • 05 Apr 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Locker

  • Dark
    Light
  • PDF

Article Summary

Every app has its own locker for storing external resources such as files, images, machine learning models, plot visualizations, and more.

Resources are uploaded into the locker via App Builder. Each resource is assigned to a supported folder. Some folders have a specific purpose, such as storing machine learning (ML) models.

Locker Folders

Supported locker folders include:

NameDescription
ResourcesFolder for storing generic resources
ModelsFolder for storing machine learning (ML) models
PlotsFolder for storing plot visualizations

Certain app runtime features may require resources to be uploaded into a specific folder. Additional feature-purpose folders may be added in the future to support additional runtime features.

Access Your App's Locker

Accessing your app's locker is straightforward. Click the 'Locker' link at the bottom of your app's object list.

image.png

Next, you're presented with your app's locker interface. Here you can manage the resources in your app's locker.

You can upload new resources, download and manage existing ones, and look up a resource's locker token, which can be used by your scripts to access a resource while your app is running.

image.png

Locker Syntax

When accessing locker resources from your app's scripts, you need to reference them using locker syntax, as demonstrated below.

Example:

// reference a locker resource with token 'AAA'
var token = 'locker://AAA';

// initiate download of text resource from app's locker using its token
network.download(token, 'config');

Using locker syntax to download a locker resource

Models Folder

The special models folder is used to store machine learning (ML) models that have been created using other software products.

Models must be stored in this folder in order to be used by the runtime while your app is running.

Plots Folder

The special plots folder is used to store plot visualizations that can be bound to real time data via scripts and displayed within your app at runtime.