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
  • delete operation is forbidden since models must be under version control

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 FileSystemBlobStore (storeConfigObject, appInstanceServerApp, sessionInstanceUBSession)



# fullStorePath instance

Normalized path to the store root

# LUCount instance

Logical Unit Count for store. If > 0 then files are stored inside Logical Unit sub-folders /LU01, /LU02 etc Write operations works with last LU folder


# doDeletion (attributeUBEntityAttribute, IDNumber, blobInfoBlobStoreItem) instance


# fillResponse (requestParamsBlobStoreRequest, blobInfoBlobStoreItem, reqTHTTPRequest, respTHTTPResponse, preventChangeRespOnErroroptboolean) → Boolean instance

Fill HTTP response for getDocument request


# genNewPlacement (attributeUBEntityAttribute, dirtyItemBlobStoreItem, IDNumber) → Object instance

Calculate a relative path & file name for a new BLOB item. If new folder dose not exists - create it


# getContent (requestBlobStoreRequest, blobInfoBlobStoreItem, optionsoptObject) → String | UBMail.TubSendMailAttachKind.Buffer | ArrayBuffer | null instance

Retrieve BLOB content from blob store.


# getContentFilePath (requestBlobStoreRequest, blobInfoBlobStoreItem) → String instance

Returns full path to the file with BLOB content


# getPermanentFileName (blobItemBlobStoreItem, requestoptBlobStoreRequest) → String instance

For file based store:

  • store.path + relativePath + fileName


In case of item not exists - return empty string ''


# persist (attributeUBEntityAttribute, IDNumber, dirtyItemBlobStoreItem, newRevisionnumber) → BlobStoreItem | null instance

Move content defined by dirtyItem from temporary to permanent store. TIPS: in v0 (UB<5) if file updated then implementation takes a store from old item. This raise a problem - old store may be in archive state (readonly) So in UB5 we change implementation to use a store defined in the attribute for new items

Return a new attribute content which describe a place of the BLOB in permanent store


# saveContentToTempStore (requestBlobStoreRequest, attributeUBEntityAttribute, contentArrayBuffer) → BlobStoreItem instance