Adding Links to the SiteKiosk Online Server Sidebar Menu

As of June 2021 the new SiteKiosk Online product family is available for custom projects. Please contact PROVISIO for more information on how to use SiteKiosk Online for your own project.

Customers running their own SiteKiosk Online server can add custom links to the menu on the left hand side of the team view. This enables you to integrate other web applications.

To add links, open the file ..\PROVISIO\SiteKiosk Online Server\Web\Web.sitemap with an editor. Look for

<!-- Menu C -->

and add this code for your own link right above it

<!-- Your Link -->
<siteMapNode url="http://www.your-comp.com/" title="Your Link" icon="link.svg" singlelink="true" />

The siteMapNode uses url for the path to the linked content, title for the caption visible in the menu, icon for the icon image file name and singlelink set to true to identify this specific type of link. Note that the icon image file needs to be in the ..\PROVISIO\SiteKiosk Online Server\Web\pub\img\sidebar folder. Additionally note that you may need to create the folder if it does not exist.

You can add more than one custom link.

How to Trigger a Customizable Navigation Command in SiteKiosk Windows Chrome Browser from Another Application

We will create a little C# example to show how to trigger a navigation in the Chrome Browser of SiteKiosk Windows from an external application.

It makes use of the SendCustomCommand method from the ISiteKiosk9 object, that is part of the SiteKioskRuntime type library (..\SiteKiosk\Typelib\SiteKioskRuntime.tlb). Add the library to your C# project and access the ISiteKiosk9 object similar to what you find in this description (https://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?codesamples_accessobject.htm).

The main part of the code for a small application with a button to call https://www.provisio.com/ looks like this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using SiteKioskRuntimeLib;

namespace NavigateInSKWchrome
{
    public partial class Form1 : Form
    {
        [DllImport("ole32.dll", CallingConvention = CallingConvention.StdCall)]
        public static extern int CoGetClassObject(ref Guid rclsid, uint dwClsContext, IntPtr pServerInfo, ref Guid riid, out IntPtr ppv);

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // initialize GUID's for classes and interfaces
            Guid lr_FactoryGuid = typeof(ISiteKioskFactory).GUID;
            Guid lr_FactoryClass = Guid.Parse("1CA0D073-4ABB-4D06-B318-BFFDE38E4903");
            Guid lr_SiteKioskGuid = typeof(ISiteKiosk9).GUID;

            ISiteKiosk9 mk_pSiteKiosk;

            // try to get the ISiteKioskFactory interface of the instance
            // of SiteKioskFactoryClass
            IntPtr lk_FactoryPtr = new IntPtr();
            CoGetClassObject(ref lr_FactoryClass, 4, new IntPtr(), ref lr_FactoryGuid, out lk_FactoryPtr);
            
            // convert the received IntPtr to the requested ISiteKioskFactory
            // interface
            ISiteKioskFactory lk_Factory = (ISiteKioskFactory)Marshal.GetObjectForIUnknown(lk_FactoryPtr);

            // call CreateSiteKiosk to get the ISiteKiosk interface of the
            // current instance of SiteKiosk
            IntPtr lk_SiteKioskPtr = new IntPtr();
            lk_Factory.CreateSiteKiosk(ref lr_SiteKioskGuid, out lk_SiteKioskPtr);

            // convert the received IntPtr to the requested
            // ISiteKioskFactory interface
            mk_pSiteKiosk = (ISiteKiosk9)Marshal.GetObjectForIUnknown(lk_SiteKioskPtr);

            mk_pSiteKiosk.SendCustomCommand("openBrowser", "https://www.provisio.com/");
        }
    }
}

When building the project, make sure to build it as an x86 project, so that it can communicate with SiteKiosk. Also make sure that you run the application within the same user context as SiteKiosk, otherwise the application will not be able to access SiteKiosk.

SendCustomCommand can also be used from an external script by simply calling this line in an external Javascript file:

SiteKiosk.SendCustomCommand("openBrowser", "https://www.provisio.com/");

Note that the SendCustomCommand method is handled in the file ..\SiteKioskNG\assets\rootApp\modules\browser.js. By default the onCustomCommand method, that is fired when a custom command is received, only includes the openBrowser command. It uses the navigateinMainBrowser method to open the requested page in a new tab, when the first parameter is false, or in the acitve tab, when the parameter is true. Feel free to add your own code to the browser.js file to enable your own custom commands to be used with the Chrome Browser of SiteKiosk Windows.