◆ JavaScriptBuilderElement()
FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.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.
- Parameters
-
- logger - The logger.
- elementDataFactory - The element data factory.
- endpoint - Set the endpoint which will be queried on the host. e.g /api/v4/json
- objectName - The default name of the object instantiated by the client JavaScript.
- enableCookies - Set whether the client JavaScript stored results of client side processing in cookies.
- minify - If true, the resulting JavaScript will be minified
- host - The host that the client JavaScript should query for updates. If null or blank then the host from the request will be used
- protocol - The protocol (HTTP or HTTPS) that the client JavaScript will use when querying for updates. If null or blank then the protocol from the request will be used
Member Function Documentation
◆ BuildJavaScript() [1/2]
void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.BuildJavaScript ( IFlowData data, string jsonObject, string sessionId, int sequence, bool supportsPromises, bool supportsFetch, string url, string parameters ) protectedBuild the JavaScript content and add it to the supplied IFlowData instance.
- Parameters
-
- data - The IFlowData instance to populate with the resulting JavaScriptBuilderElementData
- 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.
◆ BuildJavaScript() [2/2]
void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.BuildJavaScript ( IFlowData data, string jsonObject, string sessionId, int sequence, bool supportsPromises, bool supportsFetch, Uri url, string parameters ) protectedBuild the JavaScript content and add it to the supplied IFlowData instance.
- Parameters
-
- data - The IFlowData instance to populate with the resulting JavaScriptBuilderElementData
- 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.
◆ GetParameters()
virtual Dictionary<string, string> FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.GetParameters ( IFlowData data ) protected virtualGenerate 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
-
- data -
- Returns
◆ GetSequence()
virtual int FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.GetSequence ( IFlowData data ) protected virtualGet the sequence evidence if it exists.
- Parameters
-
- data -
- Returns
◆ GetSessionId()
virtual string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.GetSessionId ( IFlowData data ) protected virtualGet the session-id evidence if it exists.
- Parameters
-
- data -
- Returns
◆ ManagedResourcesCleanup()
override void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.ManagedResourcesCleanup ( ) protected virtualCleanup any managed resources.
◆ ProcessInternal()
override void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.ProcessInternal ( IFlowData data ) protectedDefault process method.
- Parameters
-
- data -
- Exceptions
-
- ArgumentNullException - Thrown if the supplied flow data is null.
◆ UnmanagedResourcesCleanup()
override void FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.UnmanagedResourcesCleanup ( ) protected virtualCleanup any unmanaged resources.
Member Data Documentation
◆ DEFAULT_ELEMENT_DATA_KEY
const string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.DEFAULT_ELEMENT_DATA_KEY = "javascriptbuilderelement" The default element data key that will be used for this element.
◆ ElementDataKey
override string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.ElementDataKey => DEFAULT_ELEMENT_DATA_KEY Key to identify engine.
◆ EvidenceKeyFilter
override IEvidenceKeyFilter FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.EvidenceKeyFilter Initial value:=>_evidenceKeyFilterPublicly accessible EvidenceKeyFilter
◆ Properties
override IList<IElementPropertyMetaData> FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.Properties Initial value:=>_propertiesPublicly accessible Property list.
Property Documentation
◆ EnableCookies
bool FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.EnableCookies get protectedIf set to false, the JavaScript will automatically delete any cookies prefixed with 51D_
◆ Endpoint
string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.Endpoint get protectedThe end point (i.e.
the relative URL) to use when creating a callback URL.
◆ ExcludedParameters
HashSet<string> FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.ExcludedParameters get protectedInitial value:= new HashSet<string>(){Engines.FiftyOne.Constants.EVIDENCE_SEQUENCE,Engines.FiftyOne.Constants.EVIDENCE_SESSIONID,}These parameters are excluded from the parameters object used to configure the JavaScript as they are added explicitly.
◆ Host
string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.Host get protectedThe host name to use when creating a callback URL.
◆ ObjName
string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.ObjName get protectedThe name of the JavaScript object that will be created.
◆ Protocol
string FiftyOne.Pipeline.JavaScriptBuilder.FlowElement.JavaScriptBuilderElement.Protocol get protectedThe protocol to use when creating a callback URL.