Storage API

The Storage API is used to represent input and output resource objects, such as files and documents, that are used by SPE API processing methods (envelope, transform, etc.).

Each storage type requires a storage provider (Java class) to handle the resource object. Standards Processing Engine includes default storage provider classes but allows custom storage providers if needed. See the Javadoc files for examples.

How to implement

Before calling anyStandards Processing Engine API processing methods, the storage providers for each type of input or output resource object must be registered. Whatever storage providers are registered are used throughout the system when necessary to perform the required processing.

The following storage provider types are typically registered:
IResource.FILE
Used for files that reside on the file system.
IResource.DOCUMENT
Used for process documents (represents data in the document table).
IResource.DOC_DATA
Used for the document data stored separately from the document objects.

To register a storage provider, invoke one of the following SPE API methods.

Use the following methods to register a single provider (once for each provider type):
SPE.registerStorageProvider(int iResourceType, String className)
Example:
SPE.registerStorageSPEProvider(IResource.FILE, SPEConstants.SPEStorageFS);
To register the default storage providers, use the following method:
SPE.registerDefaultStorageProvider();
This method registers the following default storage providers:
IResource.FILE
Uses the SPEStorageFS class.
IResource.DOCUMENT
Uses the SPEStorageDOC class.
IResource.DOC_DATA
Uses the SPEStorageFS class to store document data on the file system.
If you want to store your document data in the database instead of in the file system, SPE provides the default class SPEStorageDB for document data.