JavaScript Builder Element generates a JavaScript include to be run on the client device.
See the Specification
|
| | JavaScriptBuilderElement (ILogger< JavaScriptBuilderElement > logger, Func< IPipeline, FlowElementBase< IJavaScriptBuilderElementData, IElementPropertyMetaData >, IJavaScriptBuilderElementData > elementDataFactory, string endpoint, string objectName, bool enableCookies, bool minify, string host=null, string protocol=null) |
| | Default constructor.
|
| IJavaScriptBuilderElementData | GetFallbackResponse (IFlowData data, IJsonBuilderElementData jsonData) |
| | Default process method.
|
| | FlowElementBase (ILogger< FlowElementBase< T, TMeta > > logger) |
| | Constructor.
|
| | FlowElementBase (ILogger< FlowElementBase< T, TMeta > > logger, Func< IPipeline, FlowElementBase< T, TMeta >, T > elementDataFactory) |
| | Constructor.
|
| virtual void | Process (IFlowData data) |
| | Process the given IFlowData with this FlowElement.
|
| virtual void | AddPipeline (IPipeline pipeline) |
| | Called when this element is added to a pipeline.
|
|
void | Dispose () |
| | Dispose.
|
|
|
override void | ManagedResourcesCleanup () |
| | Cleanup any managed resources.
|
| override void | ProcessInternal (IFlowData data) |
| | Default process method.
|
| virtual Dictionary< string, string > | GetParameters (IFlowData data) |
| | Generate any required parameters for the JSON request.
|
| virtual int | GetSequence (IFlowData data) |
| | Get the sequence evidence if it exists.
|
| virtual string | GetSessionId (IFlowData data) |
| | Get the session-id evidence if it exists.
|
| void | BuildJavaScript (IFlowData data, Func< IJavaScriptBuilderElementData > javascriptBuilderElementDataProvider, string jsonObject, string sessionId, int sequence, bool supportsPromises, bool supportsFetch, string url, string parameters) |
| | Build the JavaScript content and add it to the supplied IFlowData instance.
|
| Func< IJavaScriptBuilderElementData > | GetOrAddToData (IFlowData data) |
| | Delegates to IFlowData.GetOrAdd<T>(string, Func<IPipeline, T>).
|
| void | BuildJavaScript (IFlowData data, Func< IJavaScriptBuilderElementData > javascriptBuilderElementDataProvider, string jsonObject, string sessionId, int sequence, bool supportsPromises, bool supportsFetch, Uri url, string parameters) |
| | Build the JavaScript content and add it to the supplied IFlowData instance.
|
| void | BuildJavaScript (IFlowData data, string jsonObject, string sessionId, int sequence, bool supportsPromises, bool supportsFetch, Uri url, string parameters) |
| | Build the JavaScript content and add it to the supplied IFlowData instance.
|
|
override void | UnmanagedResourcesCleanup () |
| | Cleanup any unmanaged resources.
|
| void | ProcessInternal (IFlowData data) |
| | Abstract method called by Process(IFlowData).
|
| virtual T | CreateElementData (IPipeline pipeline) |
| | Method used to create element data instances that are populated by this flow element.
|
|
void | ManagedResourcesCleanup () |
| | Cleanup any managed resources that the element is using.
|
|
void | UnmanagedResourcesCleanup () |
| | Cleanup any unmanaged resources that the element is using.
|
| virtual void | Dispose (bool disposing) |
| | Dispose of any resources.
|
|
|
string | Host [get] |
| | The host name to use when creating a callback URL.
|
| string | Endpoint [get] |
| | The end point (i.e.
|
|
string | Protocol [get] |
| | The protocol to use when creating a callback URL.
|
|
string | ObjName [get] |
| | The name of the JavaScript object that will be created.
|
|
bool | EnableCookies [get] |
| | If set to false, the JavaScript will automatically delete any cookies prefixed with 51D_.
|
| HashSet< string > | ExcludedParameters [get] |
| | These parameters are excluded from the parameters object used to configure the JavaScript as they are added explicitly.
|
| override string | ElementDataKey [get] |
| | Key to identify engine.
|
| override IEvidenceKeyFilter | EvidenceKeyFilter [get] |
| | Publicly accessible EvidenceKeyFilter.
|
| override IList< IElementPropertyMetaData > | Properties [get] |
| | Publicly accessible Property list.
|
|
ILogger< FlowElementBase< T, TMeta > > | Logger [get] |
| | The logger for this instance.
|
|
IReadOnlyList< IPipeline > | Pipelines [get] |
| | Get a read only list of the pipelines that this element has been added to.
|
| string | ElementDataKey [get] |
| | The string name of the key used to access the data populated by this element in the IFlowData.
|
| IEvidenceKeyFilter | EvidenceKeyFilter [get] |
| | A list of all the evidence keys that this Flow Element can make use of.
|
| IList< TMeta > | Properties [get] |
| | Details of the properties that this engine can populate.
|
| virtual bool | Asynchronous [get] |
| | True if the element can be run totally asynchronously, false otherwise.
|
| virtual bool | IsConcurrent [get] |
| | True if the element starts multiple threads.
|
| bool | IsDisposed [get] |
| | True if the element has been disposed.
|
| ITypedKey< T > | ElementDataKeyTyped [get] |
| | Get the key used to access the data populated by this element in the IFlowData.
|
| void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.BuildJavaScript |
( |
IFlowData | data, |
|
|
Func< IJavaScriptBuilderElementData > | javascriptBuilderElementDataProvider, |
|
|
string | jsonObject, |
|
|
string | sessionId, |
|
|
int | sequence, |
|
|
bool | supportsPromises, |
|
|
bool | supportsFetch, |
|
|
string | url, |
|
|
string | parameters ) |
|
protected |
Build the JavaScript content and add it to the supplied IFlowData instance.
- Parameters
-
| data | The IFlowData instance to populate with the resulting JavaScriptBuilderElementData and additional evidence source |
| javascriptBuilderElementDataProvider | Defines a destination for JavaScriptBuilderElementData to be set into. Allows to store results outside of data (previous parameter). |
| jsonObject | The JSON data object to include in the JavaScript. |
| sessionId | The session Id to use in the JavaScript response. |
| sequence | The sequence value to use in the JavaScript response. |
| supportsPromises | True to build JavaScript that uses promises. False to build JavaScript that does not use promises. |
| supportsFetch | True to build JavaScript that makes use of the fetch API. Otherwise, the template will fall back to using XMLHttpRequest. |
| url | The callback URL for the JavaScript to send a request to when it has new evidence values to supply. |
| parameters | The parameters to append to the URL |
- Exceptions
-
| ArgumentNullException | Thrown if the supplied flow data is null. |
| void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.BuildJavaScript |
( |
IFlowData | data, |
|
|
Func< IJavaScriptBuilderElementData > | javascriptBuilderElementDataProvider, |
|
|
string | jsonObject, |
|
|
string | sessionId, |
|
|
int | sequence, |
|
|
bool | supportsPromises, |
|
|
bool | supportsFetch, |
|
|
Uri | url, |
|
|
string | parameters ) |
|
protected |
Build the JavaScript content and add it to the supplied IFlowData instance.
- Parameters
-
| data | The IFlowData instance to populate with the resulting JavaScriptBuilderElementData and additional evidence source |
| javascriptBuilderElementDataProvider | Defines a destination for JavaScriptBuilderElementData to be set into. Allows to store results outside of data (previous parameter). |
| jsonObject | The JSON data object to include in the JavaScript. |
| sessionId | The session Id to use in the JavaScript response. |
| sequence | The sequence value to use in the JavaScript response. |
| supportsPromises | True to build JavaScript that uses promises. False to build JavaScript that does not use promises. |
| supportsFetch | True to build JavaScript that makes use of the fetch API. Otherwise, the template will fall back to using XMLHttpRequest. |
| url | The callback URL for the JavaScript to send a request to when it has new evidence values to supply. |
| parameters | The parameters to append to the URL |
- Exceptions
-
| ArgumentNullException | Thrown if the supplied flow data is null. |
| void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.BuildJavaScript |
( |
IFlowData | data, |
|
|
string | jsonObject, |
|
|
string | sessionId, |
|
|
int | sequence, |
|
|
bool | supportsPromises, |
|
|
bool | supportsFetch, |
|
|
Uri | url, |
|
|
string | parameters ) |
|
protected |
Build the JavaScript content and add it to the supplied IFlowData instance.
- Parameters
-
| data | The IFlowData instance to populate with the resulting JavaScriptBuilderElementData and additional evidence source |
| jsonObject | The JSON data object to include in the JavaScript. |
| sessionId | The session Id to use in the JavaScript response. |
| sequence | The sequence value to use in the JavaScript response. |
| supportsPromises | True to build JavaScript that uses promises. False to build JavaScript that does not use promises. |
| supportsFetch | True to build JavaScript that makes use of the fetch API. Otherwise, the template will fall back to using XMLHttpRequest. |
| url | The callback URL for the JavaScript to send a request to when it has new evidence values to supply. |
| parameters | The parameters to append to the URL |
- Exceptions
-
| ArgumentNullException | Thrown if the supplied flow data is null. |
Attempts to extract IJsonBuilderElementData from data.
- Parameters
-
| flowData | IFlowData to extract IJsonBuilderElementData from. |
- Exceptions
-
Delegates to IFlowData.GetOrAdd<T>(string, Func<IPipeline, T>).
- Parameters
-
| data | Flow data to operate on. |
- Returns
- IJavaScriptBuilderElementData to set IJavaScriptBuilderElementData.JavaScript into.
| virtual Dictionary< string, string > FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.GetParameters |
( |
IFlowData | data | ) |
|
|
protectedvirtual |
Generate any required parameters for the JSON request.
Any query parameters from this request that were ingested by the Pipeline are added to the request URL by the JavaScript.
- Parameters
-
- Returns
| virtual int FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.GetSequence |
( |
IFlowData | data | ) |
|
|
protectedvirtual |
Get the sequence evidence if it exists.
- Parameters
-
- Returns
| virtual string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.GetSessionId |
( |
IFlowData | data | ) |
|
|
protectedvirtual |
Get the session-id evidence if it exists.
- Parameters
-
- Returns
| override string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.ElementDataKey |
|
get |
| string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.Endpoint |
|
getprotected |
The end point (i.e.
the relative URL) to use when creating a callback URL.
| override IEvidenceKeyFilter FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.EvidenceKeyFilter |
|
get |
Publicly accessible EvidenceKeyFilter.
Implements FiftyOne.Pipeline.Core.FlowElements.IFlowElement.
| HashSet<string> FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.ExcludedParameters |
|
getprotected |
Initial value:= new HashSet<string>()
{
}
Constants used by 51Degrees Aspect Engines.
Definition FiftyOne.Pipeline.Engines.FiftyOne/Constants.cs:37
const string EVIDENCE_SESSIONID
session id evidence constant.
Definition FiftyOne.Pipeline.Engines.FiftyOne/Constants.cs:169
const string EVIDENCE_SEQUENCE
Sequence evidence constant.
Definition FiftyOne.Pipeline.Engines.FiftyOne/Constants.cs:184
Definition FiftyOneDataFileConfiguration.cs:27
Definition DataKeyedCacheBase.cs:30
These parameters are excluded from the parameters object used to configure the JavaScript as they are added explicitly.
| override IList<IElementPropertyMetaData> FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.Properties |
|
get |