Content storage manager
: request
: content
: storage-manager
: /modules/core/content/services/content-storage-manager.js
ContentStorageManager()
The ContentStorageManager is responsible for the content retrieval.
Kind: global function
contentStorageManager.promiseToGet(id, [callback])
Promises to get one or several content items.
Kind: instance method of ContentStorageManager
| Param | Type | Description |
|---|---|---|
| id | Array.<string> |
the id or ids of the items to fetch. |
| [callback] | function |
A function with signature (err, item) that will get called once per item once the item has been loaded. |
contentStorageManager.getAvailableItem(id) ⇒ object
Gets an item from the collection of items that the content manager has already fetched. If not found, null, is returned.
Kind: instance method of ContentStorageManager
Returns: object - The content item, or null if not found.
| Param | Type | Description |
|---|---|---|
| id | string |
The id of the item to fetch. |
contentStorageManager.fetchContent(context, [callback])
Triggers the asynchronous fetching of the items whose ids can be found in the content manager's itemsToFetch array, and their transfer into the items array. This method emits the decent.core.load-items event.
Kind: instance method of ContentStorageManager
| Param | Type | Description |
|---|---|---|
| context | object |
the context. |
| [context.request] | object |
the current request |
| [callback] | function |
a callback that gets called when all items have been fetched, or when an error occurs. |