DetachBlackboardListener Method
The DetachBlackboardListener method removes an event listener for a specific SiteRemote blackboard key.
Syntax
SiteKiosk.Plugins("SiteRemote").DetachBlackboardListener(key)
|
Parameters
key |
String that specifies the blackboard key for the listener. |
Return Value
Remarks
The SiteRemote blackboard contains information that is assigned to a machine on a SiteRemote server. This includes for example the team name the client is assigned to, the location of the machine in the treeview and address information.
The listener fires in case of changes to the content of a key on the SiteRemote server, for example moving a machine to another folder.
Possible keys are:
StC.MachineInfo.Id: Contains the ID of the machine in the SiteRemote server database.
StC.MachineInfo.LocationInTreeview: Contains the folder path and virtual folder assignment of the machine in the SiteRemote treeview.
StC.MachineInfo.Name: The name of the machine in a SiteRemote team.
StC.MachineInfo.SupportInfo: Location, maintenance and owner address information assigned to the machine on SiteRemote.
StC.TeamInfo.Name: Name of the team the machine is assigned to.
Note that you need to enable the option Transfer machine information to clients on the Settings->General page in a SiteRemote team to make the blackboard information available on the client side.
Examples
The following example adds two listeners and writes detected key changes to the SiteKiosk logfile. The listeners are removed after 1 hour.
<SCRIPT TYPE="text/javascript">
window.external.InitScriptInterface();
var BlackboardKey1 = "StC.MachineInfo.LocationInTreeview";
var BlackboardKey2 = "StC.MachineInfo.SupportInfo";
var SiteRemotePlugin = SiteKiosk.Plugins("SiteRemote");
SiteRemotePlugin.AttachBlackboardListener(BlackboardKey1,
OnBlackBoardChanged);
SiteRemotePlugin.AttachBlackboardListener(BlackboardKey2,
OnBlackBoardChanged);
SiteKiosk.Scheduler.AddDelayedEvent(3600000, DelayedFunction);
function OnBlackBoardChanged(key)
{
try
{
SiteKiosk.Logfile.Notification("Blackboard key "
+ key + "changed.
New value= " + SiteRemotePlugin.ReadBlackboardAsString(key));
}
catch (e)
{
SiteKiosk.Logfile.Notification("Blackboard
exception: " + e.message);
}
}
function DelayedFunction(eventID)
{
SiteRemotePlugin.DetachBlackboardListener(BlackboardKey1);
SiteRemotePlugin.DetachBlackboardListener(BlackboardKey2);
}
</SCRIPT>
|
Applies to
SiteKiosk v8.7 (and later versions).
Back to top