Class: ResourceStorage

ResourceStorage(xmlEditor)

The base class of objects used to load --possibly prompting user to do so-- and store document resources.

Constructor

new ResourceStorage(xmlEditor)

Constructs a document resource storage object.
Parameters:
Name Type Description
xmlEditor XMLEditor the XML editor using this storage object.
Source:

Classes

ResourceStorage

Members

xmlEditor

Returns the XML editor using this storage object.
Source:

Methods

loadResource(uri) → {Promise}

Load resource having specified URI.

Default implementation returns a Promise rejected with a "not implemented" error.

Parameters:
Name Type Description
uri string absolute URI of the resource to be loaded.
Source:
Returns:
A Promise containing a Resource or null if specified URI is unknown to this storage object or an Error.
Type
Promise

openResource(options) → {Promise}

Prompt user to choose an existing resource.

Default implementation returns a Promise rejected with a "not implemented" error.

Parameters:
Name Type Description
options Object options for use by the resource chooser dialog box. See description in XMLEditor#openResource.
Source:
Returns:
A Promise containing a ready-to-use Resource or null if user canceled this operation or an Error.
Type
Promise

storeResource(data, uri) → {Promise}

Create (or overwrite if it already exists) resource having specified URI.

Any parent directory of specified URI which does not already exist is automatically created.

Default implementation returns a Promise rejected with a "not implemented" error.

Parameters:
Name Type Description
data Blob the data to be stored.
uri string absolute URI of the resource to be created (or overwritten if it already exists).
Source:
Returns:
A Promise containing a Resource or null if specified URI is unknown to this storage object or an Error.
Type
Promise