WinGate uses a simple document object model (DOM) to let you access and reference registered WinGate objects. Whenever you access these objects, there are several syntax rules to follow.
When you are selecting an object property or method from the Symbol Browser, WinGate will insert the object symbols (the object data or methods you have chosen) into the configuration or dialog that you accessed the Symbol Browser from. This could be placing it into a dialog field, or into the appropriate place in the body of a script or email. From there, the latest data will be supplied whenever the configuration is called upon during processing.
When using the Symbol Browser, the object symbol will be supplied in the correct format automatically. All that is required is for you to add the appropriate parameter according to the type required (See the Method Parameters section below).
You can always choose to write objects and their methods directly into the configuration that has access to component data, without using the Symbol Browser. This will always follow the object.property or object.functionname(parameters if required) format.
In the WinGate DOM, each piece of object data (property) or method can be referenced by specifying the registered object, followed by a period (full stop) and then the object property or function (with parameters when required).
e.g. If you wanted to insert and access the ClientIp property made available from a Session object, you would refer to it as: Session.ClientIp
It is important to note that if you choose to write the object symbol directly (instead of selecting it from the Symbol Browser) the actual syntax of each object symbol you want to use will depend on the configuration where you are writing it.
When creating text responses, configuring email content, or notification reports etc., you can often insert symbols directly into the text content. Similarly, some WinGate configurations allow you to write WinGate object symbols in an evaluation field if required (most commonly found in decision type policy items).
Write the required object.property or object.functionname(parameters if required) surrounded by double curly braces {{object.functionname(parameters)}}.
This is the same format that is automatically applied if you were to select the object symbol from the Symbol Browser.
When formatting text, remember to leave appropriate spacing so that the value of the selected data will be legible (amongst the text) when it is parsed.
e.g. a text configuration could contain :
It appears that {{Session.ClientIp}} made the request.
When the configuration containing the text is processed during the operation of WinGate, the current data value at the time will be displayed in place of the object symbol and its curly brackets. As such the example given above will now be displayed as:
It appears that 192.168.6.145 made the request.
An exception to this syntax rule is when using the Expression evaluator policy item. This policy item formats object symbols just like a WinGate script system (see below) where object symbols do not require to be surrounded by double curly braces.
When using a WinGate script system (such as the Run Lua script or Javascript event processors) you do not have to enclose the selected object symbol in curly brackets when it is referenced inside the script body. It can be referenced directly in the usual object.property or object.functionname(parameters if required) format.
In the example below the Run Javascript script event processor has been configured to use several object symbols, Session.ClientIp and Request.Port, and the Session.Cache.Lookup. These three symbols have been inserted directly into the script body and so will not be encased by double curly braces {{}}.
Whether inserting a symbol from the Symbol Browser, or referencing it directly, method parameters can often require you to enter suitable text or number values in the method parentheses.
All text passed as a parameter must be enclosed with quotation marks.
e.g. If you selected the Data.GetCounter(Text Countername) method you would have to add the Countername parameter in text form (i.e. in between quotation marks Data.GetCounter("TestCounter"))
All number and boolean values passed as a function parameter should be written directly (i.e. without quotation marks).
The correct syntax for the selected object method parameter will be displayed is shown in the description panel below the main object window when it is selected in the Symbol Browser.
All registered objects have a classified type which will dictate what sort of value (if any) the object method or property can return. This is important to note when selecting objects to use in scripts and configurations.
Similarly, object symbols have an access status set on the object (as displayed in the Access column in the Symbol Browser example below) which will determine what how you can actually use the property or method.
©2012 Qbik New Zealand Limited
no comments yet...
You can use basic Full-Text Searches against the page title and body to find matching articles. Use the following search modifiers to refine your query:
You can create a new account or reset your password at forum.wingate.com.