\r\n

51Degrees Pipeline Node.js  4.4

51Degrees Pipeline for Node.js

JavaScriptBuilderElement Class Reference

Detailed Description

The JavaScriptBuilder aggregates JavaScript properties from FlowElements in the pipeline.

This JavaScript also (when needed) generates a fetch request to retrieve additional properties populated with data from the client side It depends on the JSON Bundler element (both are automatically added to a pipeline unless specifically removed) for its list of properties. The results of the JSON Bundler should also be used in a user-specified endpoint which retrieves the JSON from the client side. The JavaScriptBuilder is constructed with a url for this endpoint.

Inheritance diagram for JavaScriptBuilderElement:

[legend]

Collaboration diagram for JavaScriptBuilderElement:

[legend]

Public Member Functions

 constructor ({ objName='fod', protocol='', host='', endPoint='', enableCookies=true, minify=false }={})
Constructor for JavaScriptBuilder. More...
 processInternal (flowData)
Internal process function of the JavaScript builder Gets JSON from the JSONBundler and constructs JavaScript to place on the client side. More...

Public Member Functions inherited from FlowElement

 constructor ({ processInternal, dataKey, properties={}, evidenceKeyFilter }={})
Constructor for flowElement class. More...
 onRegistration (pipeline, flowElement)
Internal function to be called when a FlowElement is added to pipeline, runs through any registrationCallbacks on the FlowElement. More...
 ready ()
Function called to check if a FlowElement is ready Used when there are asynchronous initialisation steps. More...
 processInternal (flowData)
Internal process function for a particular flowElement called (via the flowElement.process() method) when flowData generated by a pipleline is processsed. More...
 process (flowData)
To allow actions to take place before and after a FlowElement's processInternal function runs, a process wrapper is run first. More...
 updateProperties ()
Call this function to update the properties meta database in all the pipelines this flowElement has been added to. More...
 getProperties ()
Get a flowElement's properties. More...
 _log (type, message)
Internal log. More...

Member Function Documentation

◆ constructor()

JavaScriptBuilderElement::constructor (   { objName='fod', protocol='', host='', endPoint='', enableCookies=true, minify=false } = {} )
inline

Constructor for JavaScriptBuilder.

Parameters
{object} - options options object
{string} - options.objName the name of the client side object with the JavaScript properties in it
{string} - options.protocol The protocol ("http" or "https") used by the client side callback url. This can be overriden with header.protocol evidence
{string} - options.host The host of the client side callback url. This can be overriden with header.host evidence.
{string} - options.endPoint The endpoint of the client side callback url
{boolean} - options.enableCookies Whether the client JavaScript stored results of client side processing in cookies. This can also be set per request, using the "query.fod-js-enable-cookies" evidence key. For more details on personal data policy, see http://51degrees.com/terms/client-services-privacy-policy/
{boolean} - options.minify Whether to minify the JavaScript

◆ processInternal()

JavaScriptBuilderElement::processInternal (   flowData )
inline

Internal process function of the JavaScript builder Gets JSON from the JSONBundler and constructs JavaScript to place on the client side.

Parameters
{FlowData} - flowData to process
Returns
{undefined}