Global data items can be accessed in a number of ways within WinGate:
Items can be created, modified, and deleted by using the Global Data tab on the Data panel, located at Control Panel > Data in the WinGate Management console.
The Global Data tab lists all of the global data items that have been created and displays their current values.
When using a WinGate scripting system (such as the Lua or Javascript event processors) global data items can be created, read, modified, and deleted as required.
In the script environment, the Data system publishes a global WinGate object called Data. This is the same object that is also visible in the Symbol browser dialog when viewing symbols associated with an event. The methods (functions) exposed by the Data object allow the creation, destruction and modification of data items. See the WinGate objects section below for the methods provided by the Data object.
The Data system also registers several custom policy items, the Data list lookup and the Data Boolean check, with the Policy system. These policy items allows for a convenient way to have a policy check whether the value of a piece of event data is on a specified global data list, or check the current state of a global boolean value.
All global data is published in the WinGate Schema. Components can perform the same tasks available from script using the Schema interface - a C language API.
When using a WinGate script system (such as the Lua or Javascript event processors) or a configuration that has access to a Symbol browser, you can access these global data items using methods provided by the Data object. The Data object methods allow you to access, manipulate, and even delete the named global data item.
Member |
Description |
---|---|
GetBool(Text BoolName) |
Will retrieve the value of the named boolean. |
GetCounter(Text CounterName)
|
Gets a global counter object by name, creating it if necessary. A script could contain: Data.GetCounter("testcount").Inc This would increase the value of a global counter called testcount by 1 every time the condition occurred (e.g. if an HTTP request is made to a certain site, increment the global counter called testcount by 1). |
GetList(Text ListName)
|
Gets a global data list object by name, creating it if necessary A script could contain: Data.GetList("Banned search names").Contains("gambling") In this example a global data list called Banned search names will be checked to see if the list contains the value gambling. It will return true if it is on the list. |
GetString(Text StringName)
|
Get the named global data string (textual) value. |
Data.ListExists(Text ListName) |
Returns true if the specified List already exists. |
Data.ResetCounters(Text MatchName) |
Will reset all counters that match a certain string. |
After they are created global data items are identified throughout WinGate by their type (e.g. a string, a boolean, a list etc), and the name you give them. Global data items of the same type must each have a unique name. If you create a new global data item with the same name as an existing item of the same type, then the new item will replace the old one.
Every global data item created requires a name. This is the unique identifier for the value, and is used when referring to the global data item from either script or via the Symbol Browser.
©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.