Webanizr Logo
Open / sluit menu
module dataModelAPI

Last change: July 6, 2020

Current version: 1.5.0

The dataModelAPI module makes it easier to store data using the dataModel headless API.

syntax

webanizr.send('dataModelAPI', data, params, callback);
webanizr.collect('dataModelAPI', params, callback);

parameters send

The dataModelAPI module accepts the following parameters:

id__type (required)

The type af data. Should correspond to an available type in the datamodel.

type__action (optional)

The type of action to be performed by the module. Valid options are:

  • storeitem: store an single item using the dataModel headless API

  • queueitem: queue an item to list of items to be stored by the dataModel Headless API

When no action type is defined, the storeitem action will be performed.

store__data (optional)

If set to true, the queue will be send to the server when the last item is added to the queue. For storeitem this is implied, so there is no need to set it to true for this action.

mode__debug (optional)

If set to true, debug information is displayed in the browser console.

level__log (optional)

The log level for the headless dataModel API. If this parameter is not set, but mode__debug is set to true, the value will be 300.

token__security (required)

The security token that allows the module to perform the given tasks on the server.

context__request (optional)

Context for this request to identify the correct items to create / update

url__taskserver (optional)

The url to send the request to. If not given, the request will go to the task service url of the current domain.

callback send

The callback to call after the action is performed. This can be after adding to the queue, or after recieving the feedback from the server.

parameters collect

The dataModelAPI module accepts the following parameters:

typeid__item (required)

The type af data. Should correspond to an available type in the datamodel.

token__security (required)

The security token that allows the module to perform the given tasks on the server.

context__request (optional)

An additional query string providing some context on exactly which data you are requesting.

mode__debug (optional)

If set to true, debug information is displayed in the browser console.

level__log (optional)

The log level for the headless dataModel API. If this parameter is not set, but mode__debug is set to true, the value will be 300.

url__taskserver (optional)

The url to send the request to. If not given, the request will go to the task service url of the current domain.

callback collect

The callback to call after the data is retreived. The retrieved data is send to the callback function.

Changelog

  • July 6, 2020: 1.5.0 - Upgraded dependency to taskModelAPI to 1.2.0
  • January 30, 2020 - Upgraded dependency to taskModelAPI to 1.1.2
  • December 4, 2019: 1.2.1 - The send function now also accepts context__request
  • November 26, 2019: 1.2.0 - Added the collect function
  • November 18, 2019: 1.0.0 - Initial version