SUPStorage.js

Access the storage functions, which allow you to specify a cache that stores results from online requests.

These functions give you the ability to:
  • Name the cached result sets
  • Enumerate the cached result sets
  • Read, delete, and modify cached contents individually for each cached result set

Cached result sets must be stored as strings (before deserialization to an xmlWorkflowMessage structure).

Calls to these methods do not trigger events.

Example 1

- constructor
// The following script creates a 2 local storage instances with their own domain
var store1 = new SUPStorage("mydomain");
var store2 = new SUPStorage("myotherdomain");

Example 2

- length
// The following script displays the current number of elements in the storage
var store = new SUPStorage();
alert(store.length());

Example 3

- key(index)
// The following script displays the value at the provided index in the storage
var store = new SUPStorage();
alert(store.key(2));

Example 4

- getItem(key)

// The following script displays the value for the provided key
var store = new SUPStorage();
alert(store.getItem("mykey"));

Example 5

- setItem(key, value)
// The following script sets a key/value pair
var store = new SUPStorage();
store.setItem("mykey", "myvalue");

Example 6

- removeItem(key)
// The following script removes a key/value pair
var store = new SUPStorage();
store.removeItem("mykey");

Example 7

- clear
// The following clears the storage
var store = new SUPStorage();
store.clear();
Related reference
AttachmentViewer and Image Limitations