Global

Members

(constant) dataAttrAstericsModelBinding :string

HTML5 data attribute to define binding to AsTeRICS model
Type:
  • string
Source:

Methods

applySettingsInXMLModelAndStart(modelFilePathOnWebserver, successCallbackopt, errorCallbackopt)

Download the model file (modelFilePathOnWebserver) hosted on a web server, apply all settings to the XML model, which have a defined binding (data-asterics-model-binding-1,...) to a model property and finally start the model.
Parameters:
Name Type Attributes Default Description
modelFilePathOnWebserver string The path of the file relative to http://location.origin/subpath/.
successCallback function <optional>
defaultSuccessCallback The callback function to be called with the file contents.
errorCallback function <optional>
defaultErrorCallback Callback function in case of an error.
Source:

deployModelFromWebserver(relFilePath, successCallbackopt, errorCallbackopt)

Deploys a model file hosted on the same webserver as this file to a running ARE instance e.g. on localhost.
Parameters:
Name Type Attributes Default Description
relFilePath string The path to the file relative to http://location.origin/subpath/.
successCallback function <optional>
defaultSuccessCallback The callback function to be called with the file contents.
errorCallback function <optional>
defaultErrorCallback Callback function in case of an error.
Source:

deployModelFromWebserverApplySettingsAndStartModel(relFilePath, propertyMap, successCallbackopt, errorCallbackopt)

Deploys a model file hosted on the same webserver as this file to a running ARE instance e.g. on localhost. Additionally applies the property settings in the given propertyMap and if successful starts the model.
Parameters:
Name Type Attributes Default Description
relFilePath string The path to the file relative to http://location.origin/subpath/.
propertyMap string A JSON string of property keys and values (see function setRuntimeComponentProperties) in the format: { "Component_id_1":{ "key_1_1":"val_1_1", "key_1_2":"val_1_2" }, "Component_id_2":{ "key_2_1":"val_2_1", "key_2_2":"val_2_2" } }
successCallback function <optional>
defaultSuccessCallback The callback function to be called with the file contents.
errorCallback function <optional>
defaultErrorCallback Callback function in case of an error.
Source:

generateWidgetIdToPropertyKeyMap() → {Array}

Generates an array describing the bindings between all widgetIds (id of HTML5 input tag) and their respective model properties.
Source:
Returns:
- Array with Javascript object elements.
Type
Array

getErrorCallback(errorCallbackopt) → {function}

Returns a valid callback function - either errorCallback if != undefined or {defaultErrorCallback}.
Parameters:
Name Type Attributes Default Description
errorCallback function <optional>
defaultErrorCallback The callback function to be used.
Source:
Returns:
- Either errorCallback or defaultErrorCallback.
Type
function

getPropertyValueFromXMLModel(componentKey, propertyKey, xmlDoc) → {string}

Gets the property value of property componentKey.propertyKey.
Parameters:
Name Type Description
componentKey string The component instance id.
propertyKey string The property key of the component.
xmlDoc string The XML model as string to be updated.
Source:
Returns:
The property value.
Type
string

getSuccessCallback(successCallbackopt) → {function}

Returns a valid callback function - either successCallback if != undefined or {defaultSuccessCallback}.
Parameters:
Name Type Attributes Default Description
successCallback function <optional>
defaultSuccessCallback The callback function to be used.
Source:
Returns:
- Either successCallback or defaultSuccessCallback.
Type
function

loadFileFromWebServer(relFilePath, successCallbackopt, errorCallbackopt)

Loads a file hosted on the same webserver as this file and returns the contents as plain text.
Parameters:
Name Type Attributes Default Description
relFilePath string The path to the file relative to http:///subpath/.
successCallback function <optional>
defaultSuccessCallback The callback function to be called with the file contents.
errorCallback function <optional>
defaultErrorCallback Callback function in case of an error.
Source:

saveSettingsAsAutostartModel(modelFilePathOnWebserver, successCallbackopt, errorCallbackopt)

Applies the settings to the model modelFilePathOnWebserver and saves it as autostart model on the ARE.
Parameters:
Name Type Attributes Default Description
modelFilePathOnWebserver string The path of the file relative to http://location.origin/subpath/.
successCallback function <optional>
defaultSuccessCallback The callback function to be called with the file contents.
errorCallback function <optional>
defaultErrorCallback Callback function in case of an error.
Source:

setPropertyValueInXMLModel(componentKey, propertyKey, propertyValue, xmlDoc)

Sets the property componentKey.propertyKey to the given propertyValue.
Parameters:
Name Type Description
componentKey string The component instance id.
propertyKey string The property key of the component.
propertyValue string The new value.
xmlDoc string The XML model as string to be updated.
Source:

storeFileFromWebserverOnARE(relFilePath, relFilePathARE, successCallbackopt, errorCallbackopt)

Stores the file hosted on the same webserver as this file at a running ARE instance e.g. on localhost and the given relFilePathARE.
Parameters:
Name Type Attributes Default Description
relFilePath string The path of the file relative to http://location.origin/subpath/.
relFilePathARE string The store path of the file on the ARE relative to ARE/data.
successCallback function <optional>
defaultSuccessCallback The callback function to be called with the file contents.
errorCallback function <optional>
defaultErrorCallback Callback function in case of an error.
Source:

updateModelPropertiesFromWidgets(modelInXML) → {string}

Updates the property values of the given modelInXML string with the currently set widget values.
Parameters:
Name Type Description
modelInXML string The AsTeRICS model as XML string.
Source:
Returns:
The modified XML model as string.
Type
string

updateWidgetsFromDeployedModel(modelFilePathOnWebserver, successCallbackopt, errorCallbackopt)

Download the currently deployed model from the ARE and update all widgets with the property values in the XML model, which have a defined binding (data-asterics-model-binding-1,...) to a model property.
Parameters:
Name Type Attributes Default Description
modelFilePathOnWebserver string The path of the file relative to http://location.origin/subpath/.
successCallback function <optional>
defaultSuccessCallback The callback function to be called with the file contents.
errorCallback function <optional>
defaultErrorCallback Callback function in case of an error.
Source:

updateWidgetsFromModelProperties(modelInXML)

Updates the widgets (HTML input elements) with the property values of the given modelInXML string.
Parameters:
Name Type Description
modelInXML string The AsTeRICS model as XML string.
Source:

xmlToString(xmlData) → {string}

Converts the given XML document object to an XML string.
Parameters:
Name Type Description
xmlData Document The XML document object.
Source:
Returns:
The XML document as string.
Type
string

Type Definitions

defaultErrorCallback()

This is the default error callback. By default an error dialog (alert) is opened.
Parameters:
Type Description
HTTPstatus HTTP status code if applicable.
errorMessage The error message to be shown.
Source:

defaultSuccessCallback()

This is the default success callback. By default nothing is done.
Parameters:
Type Description
data response text or message.
HTTPstatus HTTP status code if applicable.
Source: