Storage

Availability table

Controller availability

Module

Available

module.scripts

Supported feature

module.keycloak

Supported feature

storage controller

This controller allow to read and write document to the storage module.

Warning

Be aware that this kind of process is heavy. In consequence avoid usage of high frequency request.

storage.createBinaryFile(storageId: string, name: string, type: string, content: number[])

Allow to add a new document.

Arguments:
  • storageId – The unique identifier of the store to use.

  • name – The name of the file.

  • type – The content type of the file.

  • content – The bytes array representing the file

Returns:

Return an ExecutionResult with a StorageMetaData() content.

storage.createTextFile(storageId: string, name: string, type: string, content: string, charset: string)

Allow to add a new document.

Arguments:
  • storageId – The unique identifier of the store to use.

  • name – The name of the file.

  • type – The content type of the file.

  • content – The string representing the file

  • charset –

    The charset to use to decode the data. Use UTF-8 as default.

    The following charset are allowed:

    • US_ASCII

    • ISO_8859_1

    • UTF_8 (default)

    • UTF_16BE

    • UTF_16LE

    • UTF_16

    • UTF_32BE

    • UTF_32LE

    • UTF_32

Returns:

Return an ExecutionResult with a StorageMetaData() content.

storage.getBinaryData(storageId: string, documentId: string)

Allow to get the binary data for a specific document.

The result will be a success if the document was found or not.

If the document was not found, the message will be ‘Document not found’ and the content will be empty (undefined/null). Otherwise, the content will contain an array of bytes.

Arguments:
  • storageId – The unique identifier of the store to use.

  • documentId – The unique identifier of the document.

Returns:

Return an ExecutionResult with a byte array inside content.value

storage.getMetadata(storageId: string, documentId: string)

Allow to get the metadata for a specific document.

The result will be a success if the document was found or not.

If the document was not found, the message will be ‘Document not found’ and the content will be empty (undefined/null). Otherwise, the content will contain StorageMetaData().

Arguments:
  • storageId – The unique identifier of the store to use.

  • documentId – The unique identifier of the document.

Returns:

Return an ExecutionResult with a StorageMetaData() content.

storage.getTextData(storageId: string, documentId: string, charset: string)

Allow to get the text data for a specific document.

The result will be a success if the document was found or not.

If the document was not found, the message will be ‘Document not found’ and the content will be empty (undefined/null). Otherwise, the content will contain a string.

Arguments:
  • storageId – The unique identifier of the store to use.

  • documentId – The unique identifier of the document.

  • charset –

    The charset to use to decode the data. Use UTF-8 as default.

    The following charset are allowed:

    • US_ASCII

    • ISO_8859_1

    • UTF_8 (default)

    • UTF_16BE

    • UTF_16LE

    • UTF_16

    • UTF_32BE

    • UTF_32LE

    • UTF_32

Returns:

Return an ExecutionResult with a string inside content.value

storage.listContent(storageId: string)

List the current content of the specified storage.

Only the metadata will be provided, to access the data use getBinaryData or getStringData.

Arguments:
  • storageId – The unique identifier of the store to use.

Returns:

Return an ExecutionResult with a list of StorageMetaData() inside content.value

storage.remove(storageId: string, documentId: string)

Allow to remove a specific document.

Arguments:
  • storageId – The unique identifier of the store to use.

  • documentId – The unique identifier of the document.

Returns:

Return an ExecutionResult without a content.

StorageMetaData

class storage.StorageMetaData()

The metadata of an document stored.

StorageMetaData.identifier

The unique identifier of a document.

The type of the field is string.

StorageMetaData.name

The name of a document.

The type of the field is string.

StorageMetaData.size

The size of a document in byte.

The type of the field is number.

StorageMetaData.creationTime

The creation timestamp.Timestamp() of a document.

The type of the field is Timestamp.

StorageMetaData.type

The type of a document.

The type of the field is string.