Blob store implementation for storing content inside models public
folders.
Key conceptions:
- relative path created in format modelName|relativePathFromModelDir to hide real file place from client
- OS user temp folder used for store temporary content
Used in:
- ubm_form for store form def & js inside /public/forms
- ubm_diagrams for store diagram inside /public/erdiagrams
- ubs_report for store report template inside /public/reports
- e.t.c.
# new MdbBlobStore (storeConfig: object, appInstance: ServerApp, sessionInstance: UBSession)
Methods
# fillResponse (requestParams: BlobStoreRequest, blobItem: BlobStoreItem, req: THTTPRequest, resp: THTTPResponse, preventChangeRespOnErroropt: boolean) → boolean instance
Fill HTTP response for getDocument request
Arguments:
requestParams
: BlobStoreRequestblobItem
: BlobStoreItemreq
: THTTPRequestresp
: THTTPResponsepreventChangeRespOnError
= false: booleanIf
true
- prevents sets resp status code - just returns false on error
# getContent (request: BlobStoreRequest, blobInfo: BlobStoreItem, optionsopt: object) → string | ArrayBuffer instance
Retrieve BLOB content from blob store.
Arguments:
request
: BlobStoreRequestblobInfo
: BlobStoreItemJSON retrieved from a DB.
options
: object
# persist (attribute: UBEntityAttribute, ID: number, dirtyItem: BlobStoreItem, newRevision: number) → BlobStoreItem instance
Move content defined by dirtyItem
from temporary to permanent store.
In case oldItem
is present store implementation & parameters should be taken from oldItem.store.
Return a new attribute content which describe a place of BLOB in permanent store
Arguments:
attribute
: UBEntityAttributeID
: numberdirtyItem
: BlobStoreItemnewRevision
: number