AttachBlackboardListener Method



 
The AttachBlackboardListener method creates an event listener for a specific SiteRemote blackboard key.


Syntax

    SiteKiosk.Plugins("SiteRemote").AttachBlackboardListener(key, handler)
    
Parameters
    key String that specifies the blackboard key for the listener.
    handler Reference to the method that handles the event that fires once the listener detects a change to the key.
Return Value
    None.
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.

    <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);
    
    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);
    	}
    }
    </SCRIPT>
    

Applies to
    SiteKiosk v8.7 (and later versions).

Back to top