Intel Unite® Plugin Software Development Kit (SDK)...writeFile Function .....86 Figure 109. Body...
Transcript of Intel Unite® Plugin Software Development Kit (SDK)...writeFile Function .....86 Figure 109. Body...
Revision 1.0
Intel Unite® Plugin Software
Development Kit (SDK)
APPLICATION PROGRAMMING INTERFACE
(API) GUIDE
September 2018
Revision 1.0
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
2 Revision 1.0
Legal Disclaimers and Copyrights
All information provided here is subject to change without notice. Contact your Intel representative to obtain the latest Intel product specifications
and roadmaps.
Intel technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation.
Performance varies depending on system configuration. No computer system can be absolutely secure. Check with your system manufacturer or
retailer or learn more at intel.com.
You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products
described herein. You agree to grant Intel a non-exclusive, royalty free license to any patent claim thereafter drafted which includes subject matter
disclosed herein.
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.
The products described may contain design defects or errors known as errata which may cause the product to deviate from published specifications.
Current characterized errata are available on request.
Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular
purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.
Intel, the Intel logo, Intel® Core™ vPro™ processor family are trademarks of Intel Corporation in the United States and/or other countries.
*Other names and brands may be claimed as the property of others
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 3
Contents 1 Introduction ....................................................................................................................................................................... 8
1.1 Audience ........................................................................................................................................................................................... 8 1.2 Terminology .................................................................................................................................................................................... 8
2 Intel Unite® Software Overview ..................................................................................................................................... 9 3 Intel Unite® Software Requirements ........................................................................................................................... 10
3.1 Intel Unite® Software Module Requirements ................................................................................................................ 10 3.2 Intel Unite® Solution Terminology and Definitions .................................................................................................... 10 3.3 Module Implementation Steps ............................................................................................................................................ 10 3.4 Module Runtime Context........................................................................................................................................................ 11 3.5 Module Events ............................................................................................................................................................................. 11 3.6 Intel Unite® UI Areas ................................................................................................................................................................. 11
3.6.1 Application Layer .................................................................................................................................................... 12 3.6.2 PIN Layer ..................................................................................................................................................................... 13 3.6.3 Presentation Layer.................................................................................................................................................. 15 3.6.4 Toast Message View ............................................................................................................................................... 17 3.6.5 Partial Background View ...................................................................................................................................... 18
3.7 HTML Plugins ............................................................................................................................................................................... 19 3.7.1 HTML Events ............................................................................................................................................................. 19 3.7.2 HTML Functions ....................................................................................................................................................... 20
4 Code Examples ................................................................................................................................................................ 21 4.1 Hello World Plugin Example ................................................................................................................................................. 21
4.1.1 Common Structure ................................................................................................................................................. 21 4.1.2 User Controls ............................................................................................................................................................ 29 4.1.3 HelloWorldHandlerModule ................................................................................................................................ 37
4.2 Hello World HTML Plugin Example ................................................................................................................................... 60 4.2.1 Common Structure ................................................................................................................................................. 61 4.2.2 Commands ................................................................................................................................................................. 67 4.2.3 HTML Content........................................................................................................................................................... 71 4.2.4 IntelUnite.js. ............................................................................................................................................................... 71 4.2.5 Hello World HTML Module ................................................................................................................................. 86
5 Package Creation and Deployment ............................................................................................................................. 93 5.1 Creating and Uploading the Plugin Package ................................................................................................................. 93
6 Developer Notes ............................................................................................................................................................. 96 6.1 Logs .................................................................................................................................................................................................. 96 6.2 Commands .................................................................................................................................................................................... 98
7 Support .......................................................................................................................................................................... 100
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
4 Revision 1.0
Figures
Figure 1. Quick Access Icon View with One Access Icon ............................................................................................................. 12 Figure 2. Quick Access View, with User Controls Inside .............................................................................................................. 13 Figure 3. PIN Layer ........................................................................................................................................................................................ 14 Figure 4. Status View.................................................................................................................................................................................... 14 Figure 5. Authorization View .................................................................................................................................................................... 15 Figure 6. PIN Code......................................................................................................................................................................................... 15 Figure 7. Presentation Layer .................................................................................................................................................................... 16 Figure 8. Presentation View and Ribbon View Sample ................................................................................................................ 17 Figure 9. Toast Message View.................................................................................................................................................................. 18 Figure 10. Partial Background View ......................................................................................................................................................... 19 Figure 11. Create a New Project ................................................................................................................................................................ 22 Figure 12. Create the HelloWorldHubModule .................................................................................................................................... 23 Figure 13. Add Core Libraries Dependencies ...................................................................................................................................... 24 Figure 14. Intel.Unite.Common.dll ........................................................................................................................................................... 25 Figure 15. Default Libraries plus the WPF Microsoft Libraries .................................................................................................... 26 Figure 16. Add References to the HelloWorldHandlerModule ................................................................................................... 26 Figure 17. Create the HelloWorldEventArgs Class ........................................................................................................................... 26 Figure 18. Create an IParametersUserControl Interface ................................................................................................................ 27 Figure 19. Sample Images ............................................................................................................................................................................ 27 Figure 20. Sample Image Files ................................................................................................................................................................... 28 Figure 21. Properties Window .................................................................................................................................................................... 29 Figure 22. UI Folder ......................................................................................................................................................................................... 29 Figure 23. Add WPF Controls to the UI Folder ................................................................................................................................... 30 Figure 24. Solution Explorer Image with Sample User Controls ................................................................................................ 31 Figure 25. HelloWorldPresentationViewControl.xaml Content ................................................................................................. 31 Figure 26. HelloWorldPresetationViewControl.xaml Code .......................................................................................................... 32 Figure 27. HelloWorldPresentationViewControl ............................................................................................................................... 33 Figure 28. HelloWorldQuickAccessIcon.xaml ..................................................................................................................................... 34 Figure 29. Load Views and Hide Buttons .............................................................................................................................................. 34 Figure 30. HelloWorldPartialBackGroundViewControl200.xaml ............................................................................................... 35 Figure 31. Partial Background Controls Allocated on the PartialBackGround View ......................................................... 36 Figure 32. Change Label Color ................................................................................................................................................................... 36 Figure 33. HelloWorldRibbonControl.xaml .......................................................................................................................................... 37 Figure 34. HelloWorldHandlerModule ................................................................................................................................................... 37 Figure 35. HelloWorldHandlerModule Regions ................................................................................................................................. 38 Figure 36. Private Variable’s Region with Dictionaries and Global Variables ....................................................................... 39 Figure 37. Multiple Allocations Sample ................................................................................................................................................. 40 Figure 38. Constructor Region ................................................................................................................................................................... 41 Figure 39. SetupManifest Method ............................................................................................................................................................ 42 Figure 40. SetupModuleInfo Method ...................................................................................................................................................... 43 Figure 41. IConfigurationManager Event Handlers .......................................................................................................................... 43 Figure 42. CommonPropertiesUpdated ................................................................................................................................................ 43 Figure 43. ConfigurationManager_CommonPropertiesUpdated ............................................................................................... 43 Figure 44. DisplayManager Event Handlers ......................................................................................................................................... 44 Figure 45. ShowQuickAccessControlIcon Implementation .......................................................................................................... 45 Figure 46. Cycle over All Available Displays Property .................................................................................................................... 45 Figure 47. CurrentUiDispacher for Control Creation ....................................................................................................................... 46
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 5
Figure 48. OnOpenQuickAccess Event in Quick Access View ..................................................................................................... 46 Figure 49. OnAllocateChildControls Event .......................................................................................................................................... 47 Figure 50. OnDeAllocateViewQuickAccess Event ............................................................................................................................. 47 Figure 51. DeAllocateUserControl Method Implementation ....................................................................................................... 47 Figure 52. OnHideQuickAccess Event Implementation ................................................................................................................. 48 Figure 53. HubAllocationInfo Objects .................................................................................................................................................... 48 Figure 54. AllocatedControl Usage Sample ......................................................................................................................................... 49 Figure 55. AllocatedControl Method Implementation .................................................................................................................... 49 Figure 56. Allocated Callback for QuickAccess and QuickAccessIcon .................................................................................... 49 Figure 57. AllocateUserControl Implementation .............................................................................................................................. 50 Figure 58. ShowChildControl Method .................................................................................................................................................... 50 Figure 59. ShowOtherViewsControl User Controls Initialization ............................................................................................... 51 Figure 60. Checkmark Button Displays a Toast Message on the Hub Screen...................................................................... 52 Figure 61. OnToastMessage View Implementation ......................................................................................................................... 52 Figure 62. SelectElement Method Implementation ......................................................................................................................... 53 Figure 63. UpdateAuthorizationView Method .................................................................................................................................... 53 Figure 64. Sample of Image Change for Authorization View ....................................................................................................... 53 Figure 65. Multiple HubAllocationInfo Objects .................................................................................................................................. 54 Figure 66. Allocation Methods for Views .............................................................................................................................................. 55 Figure 67. AllocatedControlAndSaveState Method ......................................................................................................................... 55 Figure 68. ShowPartialBackGroundControl Implementation for Multiple User Controls .............................................. 56 Figure 69. Deallocation Methods for Views ......................................................................................................................................... 57 Figure 70. DeAllocateAll Method .............................................................................................................................................................. 58 Figure 71. DeAllocateUserControl Implementation ........................................................................................................................ 59 Figure 72. Interface Methods ...................................................................................................................................................................... 60 Figure 73. Communication Flow between Hub and Client ........................................................................................................... 61 Figure 74. Create a New Project ................................................................................................................................................................ 62 Figure 75. Create the HelloWorldHubHtmlModule .......................................................................................................................... 63 Figure 76. Add Core Libraries ..................................................................................................................................................................... 64 Figure 77. Intel.Unite.Common.dll ........................................................................................................................................................... 65 Figure 78. Command Folder ....................................................................................................................................................................... 66 Figure 79. UI Folder ......................................................................................................................................................................................... 66 Figure 80. Add References to the HelloWorldHtmlModule ......................................................................................................... 67 Figure 81. CommandBase ............................................................................................................................................................................ 68 Figure 82. ToMessage Implementation ................................................................................................................................................. 68 Figure 83. Message Constants for Broadcast ...................................................................................................................................... 69 Figure 84. HelloWorldRequest Class ...................................................................................................................................................... 69 Figure 85. HelloWorldResponse Class ................................................................................................................................................... 70 Figure 86. HtmlContent.html Location................................................................................................................................................... 71 Figure 87. HtmlContent.html Properties ............................................................................................................................................... 71 Figure 88. onLockSession ............................................................................................................................................................................ 81 Figure 89. onMessage .................................................................................................................................................................................... 81 Figure 90. onModerationModeulUpdated ............................................................................................................................................ 81
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
6 Revision 1.0
Figure 91. onUnLockSession ...................................................................................................................................................................... 81 Figure 92. onUserConnected ...................................................................................................................................................................... 81 Figure 93. onUserDisConnected ............................................................................................................................................................... 82 Figure 94. onUserInfoChanged .................................................................................................................................................................. 82 Figure 95. showScreenSharingCallback ................................................................................................................................................ 82 Figure 96. getAppointmentList Function .............................................................................................................................................. 83 Figure 97. getContext Function ................................................................................................................................................................. 83 Figure 98. getCurrentAppointments Function ................................................................................................................................... 83 Figure 99. getMaxMessageSize Function .............................................................................................................................................. 83 Figure 100. getTheme Function ................................................................................................................................................................... 84 Figure 101. isCalendarAvailable Function ............................................................................................................................................... 84 Figure 102. logMessage Function ............................................................................................................................................................... 84 Figure 103. logTelemetryEvent Function ................................................................................................................................................ 85 Figure 104. sendMessage Function ............................................................................................................................................................ 85 Figure 105. setNumberNotification Function ........................................................................................................................................ 85 Figure 106. showScreenSharing Function .............................................................................................................................................. 85 Figure 107. updateToolMenu Function .................................................................................................................................................... 85 Figure 108. writeFile Function ...................................................................................................................................................................... 86 Figure 109. Body HTML .................................................................................................................................................................................... 86 Figure 110. Private Variables for the HelloWorldHtmlModule ...................................................................................................... 87 Figure 111. HelloWorldHtmlModule Constructor and Initialize Method .................................................................................. 88 Figure 112. SetupManifest Implementation ........................................................................................................................................... 89 Figure 113. SetupModuleInfo Implementation .................................................................................................................................... 90 Figure 114. FillHtml Method Implementation ....................................................................................................................................... 90 Figure 115. Abstract Class Methods .......................................................................................................................................................... 91 Figure 116. Incoming Message Implementation .................................................................................................................................. 92 Figure 117. Command for Manifest Generator on Windows Console ....................................................................................... 93 Figure 118. Cab File ........................................................................................................................................................................................... 93 Figure 119. Admin Portal Upload Package Process ........................................................................................................................... 94 Figure 120. Module Features ......................................................................................................................................................................... 95 Figure 121. Feature List of Hub Configuration Section on the Admin Portal ......................................................................... 95 Figure 122. IModuleLoggingManager Methods .................................................................................................................................... 96 Figure 123. LogLevel enum Options .......................................................................................................................................................... 97 Figure 124. Unite Logs Path ........................................................................................................................................................................... 97 Figure 125. Logging Table .............................................................................................................................................................................. 97 Figure 126. Communication Flow from HTML Module to Hub ...................................................................................................... 98 Figure 127. Class Diagram .............................................................................................................................................................................. 99
Table
Table 1. Terminology .................................................................................................................................................................................... 8
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 7
Revision History
Revision Description Date
1.0 Initial release September 2018
Introduction
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 8
1 Introduction
Welcome to the Intel Unite® Plugin Software Development Kit (SDK) Application Programming
Interface (API) Guide. The Intel Unite software offers a plugin API that provides the ability to
incorporate additional business needs and functionality into enterprise deployments. This
document describes how to work with the Intel Unite plugin SDK.
1.1 Audience
This SDK is intended for use by IT professionals, software developers, and anyone looking to
develop additional functionality for the Intel Unite application. For companies deploying Intel
Unite®, additional deployment information is available in the Intel Unite® Deployment Guide.
1.2 Terminology
Table 1. Terminology
Term Description (CellHeadingCenter)
TLS Transport Layer Security
UI User Interface
WPF Windows* Presentation Foundation
Intel Unite® Software Overview
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
9 Revision 1.0
2 Intel Unite® Software Overview
Intel Unite® software is designed to allow fast, wireless screen sharing and collaboration in three
steps (after initial application installation), as follows:
1. Launch the client application.
2. Enter a PIN to connect to a specific session.
3. Click Display to share content.
Leveraging existing network infrastructures, the Intel Unite software works with the following:
• Client—Microsoft* Windows* 7, 8.1, and 10 operating systems, Apple* Mac*, OS X*, IOS
(iPhone/iPad) and Android, Chrome, Linux
• Hub—Microsoft Windows 7sp1 and Win10
• Server—Microsoft Windows 2012 and newer
The software has built-in security features, using Transport Layer Security (TLS), and sharing
capabilities to create an easy and flexible solution for sharing information visually.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 10
3 Intel Unite® Software Requirements
This chapter defines the overall requirements for extending the Intel Unite solution. Additional
detailed requirements may be included in the sections for individual groups.
The Intel Unite solution is developed using the Microsoft* .NET* framework and is built as a
combination of distinct components that can be invoked individually. Plugins can be used to
extend the Intel Unite software for audio, visual, security, and service operations, as well as
many other functions and purposes.
3.1 Intel Unite® Software Module Requirements
The following requirements must be met for Intel Unite software modules:
• Modules must install, execute, and operate on Intel Unite® software hub.
• Modules must be packaged as a .cab file signed with a public certificate. This file is
uploaded and installed in the Intel Unite solutions Admin Portal.
3.2 Intel Unite® Solution Terminology and Definitions
The Intel Unite solution includes several distinct components, which are discussed in this
document. The components are:
• Hub—Intel® Core™ vPro™ processor family-based PC connected to a display in a conference
room running the Intel Unite application
• Client—Device (Windows*, Android*, Chrome*, Linux*, or Mac*) used to connect to the hub
• Display—Screen or projector connected to the Intel Unite hub
• Hub Module—Module built to run at hub level
• HTML Module—Module built to run at hub level that exposes the HTML user interface (UI)
for clients connected to the hub
3.3 Module Implementation Steps
To implement a module, complete the following steps:
1. Include a reference to Intel.Unite.Common.dll. The DLL is located at:
%C:\ProgramData\Intel\Intel Unite\Hub 4.X”
or
%C:\ProgramData\Intel\Intel Unite\Client 4.X”
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
11 Revision 1.0
2. Create and implement a class that inherits from the abstract class
Intel.Unite.Common.Module.Feature.Hub.HubFeatureModuleBase.
3. Use the RuntimeContext property to access the managers that can be used.
3.4 Module Runtime Context
The Runtime context is the entry point class that exposes the managers the plugin can use. The
managers are:
• CalendarManager—Exposes information about the calendar
• CommandManager—Enables the plugin to interact with the command’s functionality (the
command refers to a message that is process by the hub)
• ConfigurationManager—Enables the plugin to obtain configuration properties
• LafManager (Look and Feel Manager)—Exposes common UX properties, such as primary
color, primary font, and so forth
• LogManager—Enables the plugin to log messages
• MessageSender—Enables the plugin to send messages, using TLS, from Client to Hub
• NotificationManager—Enables the functionality for using native notifications
• TelemetryManager—Enables the plugin to log telemetry events
3.5 Module Events
Several events notify plugins. The events are fired when a user performs a specific action, as
indicated:
• UserConnected—User connects
• UserInfoChanged—User information changes
• UserDisconnected—User disconnects
• HubConnected—Hub connects
• HubInfoChanged—Hub information changes
• HubDisconnected—Hub disconnects
• IncomingMessage—New message available for the module
• SessionKeyChanged—Session key changes, such as LockStatus, ModerationMode, and
so forth
3.6 Intel Unite® UI Areas
Intel Unite includes areas to display the UI feature modules. These areas are known as views. A
view is a Windows Presentation Foundation* (WPF) user control.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 12
3.6.1 Application Layer
The Application Layer is used to display the Quick Access Icon View.
3.6.1.1 Quick Access Icon View
The Quick Access Icon View contains the icon(s) used to access the various plugins installed and
designed for user interaction. For this view, click the double arrow. The example shown in
Figure 1 shows one access icon.
Figure 1. Quick Access Icon View with One Access Icon
3.6.1.2 Quick Access View.
The Quick Access View, shown in Figure 2, is used to allocate user control for the requested
plugin. This view contains the controls provided by the plugin, for example, Audio: Volume
Up/Down/Mute.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
13 Revision 1.0
Figure 2. Quick Access View, with User Controls Inside
3.6.2 PIN Layer
By default, the PIN layer is located in the upper-right corner of the hub screen. This region of
the screen is divided into three views—Status, Authorization, and PIN Code. The PIN layer is
defined by the grey background, as shown in Figure 3.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 14
Figure 3. PIN Layer
3.6.2.1 Status View
The Status view, shown in this layer, represents states such as Bluetooth® enabled, current
wireless statues, and so forth. Figure 4 shows the Status view region on the PIN layer. This
region is used to allocate images.
Figure 4. Status View
3.6.2.2 Authorization View
The Authorization view, shown in Figure 5, is a region immediately to the left of the PIN Code.
This region can be used to allocate images. Similar to the Status view, this layer is used to
represent states on the module.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
15 Revision 1.0
Figure 5. Authorization View
3.6.2.3 PIN Code View
The PIN Code is the code used to connect to the unit session. The PIN Code view, shown in
Figure 6, cannot be interacted with directly. Many times, a plugin may need to know the PIN
Code for inclusion in the plugin. The PIN Code can be read using the Configuration Manager
interface. An example is provided later in this document.
Figure 6. PIN Code
3.6.3 Presentation Layer
The Presentation layer, shown in Figure 7, contains two distinct regions—Presentation view and
Ribbon view. The views are described next.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 16
Figure 7. Presentation Layer
3.6.3.1 Presentation View
The Presentation view is used to show the main content of the plugin module. It is located in
the top region of the screen. This view can be split into a maximum of four windows and
contains the allocation for the plugin module. It can be shared with other plugin modules.
The Presentation view can be allocated as standalone. It is not mandatory to display a Ribbon
view. However, the Ribbon view requires a Presentation view. Otherwise, the Ribbon view won’t
show up.
3.6.3.2 Ribbon View
The Ribbon view is used to allocate a single user control. This control can have multiple buttons
inside, depending on requirements. The Ribbon view has a close dependency with the
Presentation view, since the Ribbon is use to interact with the Presentation layer. A Ribbon view
must be allocated with a Presentation view. Figure 8 shows both views when allocated.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
17 Revision 1.0
Figure 8. Presentation View and Ribbon View Sample
3.6.4 Toast Message View
The Toast Message view, shown in Figure 9, displays toast messages. On the hub, these
messages are removed after a specified time interval (in seconds). This view is independent of
other views and comes to the foreground as necessary.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 18
Figure 9. Toast Message View
3.6.5 Partial Background View
The Partial Background view, shown in Figure 10, is used to allocate multiple user controls,
without any limitation. This layer is used for modules that want to display controls at the same
level as the background. This layer can be used to show a calendar, weather report, agenda,
meeting room schedule, and so forth.
The Partial Background view is one level below the Presentation layer. To use this view,
deallocate the Presentation view. To access this layer, allocate the view or call the allocation
from the Quick Access view.
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
19 Revision 1.0
Figure 10. Partial Background View
3.7 HTML Plugins
The HTML plugin is a hub plugin that exposes an HTML interface in client UIs. This plugin is
multiplatform. The same client implementation can be used by any platform that supports
HTML. The HTML plugin runs on a web browser emulator, which means the browser
functionality is not fully supported due to security reasons. For example, browser developer
tools are not allowed. In Windows, the web browser component supports versions IE7 through
IE 11.
This interface allows interaction to occur between a client and hub. Several events and
functions are exposed to the plugin (refer to the code examples, later in this document). The
events and functions are described in the next sections.
3.7.1 HTML Events
HTML events should be defined by developers in the HTML Content property, as explained in
the Hello World HTML Plugin Example later in this document. Events fire according to specific
actions, as follows:
• onUserConnected—User connects
• onUserInfoChanged—User information changes
Intel Unite® Software Requirements
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 20
• onUserDisconnected—User disconnects
• onMessage—New message is available for the plugin
• onModerationModeUpdated—Moderation mode changes
• onLockSession—Session is locked
• onUnlockSession—Session is unlocked
• sessionKeyChanged—Session key changes (for example, LockStatus, ModerationMode,
and so forth)
• showScreenSharingCallback—Result of showScreenSharing function indicating a call is
ready
3.7.2 HTML Functions
Functions are defined in the IntelUnite.Js library. This library is injected by the hub in the
HTML Content property, as explained in the Hello World HTML Plugin Example later in this
document. Some function examples include the following:
• getContext—Exposes context information to the plugin (for example, a list of users/hubs
connected with properties like name, email, ID, lock status, and so forth)
• getTheme—Exposes common UX properties, like primary color, primary font, and so forth
• logMessage—Enables plugins to log messages
• logTelemetryEvent— Enables plugins to log telemetry events
• sendMessage— Enables plugins to send messages
• setNumberNotification— Enables plugins to update the notification number shown in the
menu button
• showScreenSharing— Enables plugins to show the common screen sharing dialog
• updateToolMenu— Enables plugins to update information of the tool menu button
associated with the plugin
File manager functions are used to handle file creation, save a screen shot, save files, and so
forth. File manager functions include the following:
• closeFile—Closes the stream and saves the file
• createFile—Initializes the stream for file creation
• deleteFile—Deletes the file that was created with the identifier generated by createFile
• getFileTransferConfiguration—Gets the file transfer configuration from the client
• openFolder—Opens the file’s folder location o
• writeToFile—Adds bytes to the stream in the client (the stream is initialize when
createFile is executed)
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
21 Revision 1.0
4 Code Examples
This section provides two examples—Hello World Plugin and Hello World HTML Plugin.
4.1 Hello World Plugin Example
The Hello World Plugin example shows how to use methods exposed to plugins and how to
allocate views using the display manager. Developers can use the example to learn how to
allocate any type of WPF user control to the Intel Unite views.
The Hello World example’s objectives are to:
• Allocate sections from Intel Unite SDK
• Demonstrate the SDK managers
• Manifest configuration
The project created is:
• HelloWorld.Module
4.1.1 Common Structure
This section presents the steps to create a project common structure.
1. Create a new C# Class Library Visual Studio project in Visual Studio by selecting New >
Project, as shown in Figure 11.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 22
Figure 11. Create a New Project
2. Create a Class Library project in C# by selecting Class Library on the Visual C# tab. Name it
HelloWorldHubModule, as shown in Figure 12.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
23 Revision 1.0
Figure 12. Create the HelloWorldHubModule
3. Add core libraries dependencies to the module, as shown in Figure 13.
Intel.Unite.Common.dll is the SDK library installed with the Intel Unite solution, as
shown in Figure 14. The DLL is located at:
%C:\ProgramData\Intel\Intel Unite\Hub 4.X”
or
%C:\ProgramData\Intel\Intel Unite\Client 4.X
Add the reference. Use the library that belongs to the same version of the hub; otherwise,
incompatibility issues may occur.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 24
Figure 13. Add Core Libraries Dependencies
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
25 Revision 1.0
Figure 14. Intel.Unite.Common.dll
4. Click the Assemblies tab in Reference Manager, and then click Framework. Add the
following Microsoft WPF libraries, as shown in Figure 15:
− PresentationCore.
− PresentationFramework
− System.AddIn
− System.AddIn.Contract
− System.Xml
− WindowsBase
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 26
Figure 15. Default Libraries plus the WPF Microsoft Libraries
5. Create a class HelloWorldHandlerModule and add a reference to Intel.Unite.Common.Module.Common and
Intel.Unite.Common.Module.Feature.Hub, as shown in Figure 16.
Figure 16. Add References to the HelloWorldHandlerModule
6. Create the HelloWorldEventArgs class that inherits from EventArgs, as shown in Figure
17.
Figure 17. Create the HelloWorldEventArgs Class
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
27 Revision 1.0
7. Create an IParametersUserControl interface, as shown in Figure 18. The control
Identifier property is used for allocation and deallocation proposes using the runtime
context.
Figure 18. Create an IParametersUserControl Interface
8. Create a new folder to store three images. The images are shown in Figure 19. The images
are included in the sample solution, as shown in Figure 20.
Figure 19. Sample Images
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 28
Figure 20. Sample Image Files
9. For the bluetooth-icon.png, business-user.png, and menu-icon.png images,
select Embedded Resource as the build action in the Properties window, as shown in Figure
21.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
29 Revision 1.0
Figure 21. Properties Window
10. Create a new UI folder for user controls, as shown in Figure 22.
Figure 22. UI Folder
4.1.2 User Controls
This section describes the user controls. To create WPF controls in the UI folder, select Add,
choose New Item, choose one of following (refer to Figure 23 and Figure 24), and then repeat
the steps until all of the following controls are added:
• HelloWorldPartialBackGroundViewControl200.xaml
• HelloWorldPartialBackGroundViewControl400.xaml
• HelloWorldPartialBackGroundViewControl700.xaml
• HelloWorldPresentationViewControl.xaml
• HelloWorldQuickAccessControl.xaml
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 30
• HelloWorldQuickAccessIcon.xaml
• HelloWorldRibbonControl.xaml
Each control is allocated to a specific Intel Unite area. The name of the control matches its
allocation view. Each control is allocated for every screen presenting. For example, if someone
is presenting two screens, each control is allocated once for each display.
As part of the example, some of the controls have a deallocation button, indicated by an X icon,
as shown in Figure 25. In the code shown in Figure 26, a special event handler is created called
DeallocateView that is invoked in the method DeallocateButton_OnClick. For each
control, a control identifier property is created, which is used in the deallocation process.
Figure 23. Add WPF Controls to the UI Folder
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
31 Revision 1.0
Figure 24. Solution Explorer Image with Sample User Controls
Figure 25. HelloWorldPresentationViewControl.xaml Content
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 32
Figure 26. HelloWorldPresetationViewControl.xaml Code
The Presentation view control includes the following buttons:
• Change Authorization View—Updates the Authorization view image with one of the icons
added previously
• Change Status View—Updates the Status view icon
• Checkmark—Displays a toast notification on the Presentation layer and a simple
notification
• X Mark—Deallocates the different views—Presentation, Ribbon, Authorization, and Status
The buttons are made using the Windings 2 font family.
In the code shown in Figure 27, the following three event handlers are created:
• DeallocateButton_OnClick
• ToastMessage_Click
• ChangeForeColorLabel (consumed by the Ribbon)
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
33 Revision 1.0
Figure 27. HelloWorldPresentationViewControl
HelloWorldQuickAccessIcon.xaml, shown in Figure 28, is used to display an icon over the
hub. This control is used to allocate the Quick Access Control view.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 34
Figure 28. HelloWorldQuickAccessIcon.xaml
Once HelloWorldQuickAccessControl.xaml is displayed, a Load Views button displays as
well as the rest of the controls and the Hide button, which collapses the Quick Access view.
Figure 29 shows the Load Views and Hide buttons.
Figure 29. Load Views and Hide Buttons
All the controls in HelloWorldPartialBackGroundViewControl, including:
• HelloWorldPartialBackGroundViewControl200.xaml
• HelloWorldPartialBackGroundViewControl400.xaml
• HelloWorldPartialBackGroundViewControl700.xaml
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
35 Revision 1.0
are used as an example of allocating multiple controls on the PartialBackGround view. Each
control has a specific width and height, to demonstrate that developers can allocate as many
controls as required, and each control can be a different size.
This view only displays if no Presentation layers are active. Therefore, the Presentation view
should be deallocated. Figure 30 shows the
HelloWorldPartialBackGroundViewControl200.xaml. Figure 31 shows the partial
background controls allocated on the partial background view.
Figure 30. HelloWorldPartialBackGroundViewControl200.xaml
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 36
Figure 31. Partial Background Controls Allocated on the PartialBackGround View
Figure 30 shows the Ribbon control. Figure 33 shows event ChangeForeColorLabel_Click.
This event changes the font color of the label HelloWorld, in the Presentation control. It is
located in the file HelloWorldHandlerModule.cs.
Figure 32. Change Label Color
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
37 Revision 1.0
Figure 33. HelloWorldRibbonControl.xaml
4.1.3 HelloWorldHandlerModule
The HelloWorldHandlerModule class contains the Intel Unite SDK functionality, including
logging, allocation, deallocation, and delegates subscription. The class is inherited from
HubFeatureModuleBase, as shown in Figure 34.
Figure 34. HelloWorldHandlerModule
The HelloWorldHandlerModule groups the code into the following six regions, as shown in
Figure 35:
• Private global variables
• Constructor
• Configuration methods
• Allocation methods
• Deallocation methods
• Interface methods
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 38
Figure 35. HelloWorldHandlerModule Regions
4.1.3.1 Private Global Variables Region
The private global variables region defines the object for the allocated and deallocated views,
as well as other variables important for the module.
The control allocation is done for each display. The developer can make the allocation for one
or multiple displays, depending on requirements. In other words, a developer can allow a
control to be allocated multiple times or restrict it to a single instance, in one or more active
displays.
In this example, the code is written so the control is allocated as many times as the user clicks
Load Views. Therefore, different display view dictionaries are created to support this
functionality, as shown in Figure 36. Figure 37 provides a sample of multiple allocations.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
39 Revision 1.0
Figure 36. Private Variable’s Region with Dictionaries and Global Variables
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 40
Figure 37. Multiple Allocations Sample
4.1.3.2 Constructor Region
The Constructor region contains two constructors from different events. The first one receives
the interface IModuleRuntimeContext. The second one is a parameter-less constructor. This
constructor is used for the Manifest Generator tool. Both constructors must call the parent class
and configure the ModuleInfo and the Manifest objects, as shown in Figure 38.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
41 Revision 1.0
Figure 38. Constructor Region
The constructor that has parameters includes the following event handlers to get events from
Intel Unite:
• ConfigurationManager_CommonPropertiesUpdated—Triggers when a common
property changes. For example, every time the PIN changes, this event fires.
• DisplayManager_ViewAllocated—Triggers once a view is allocated in the runtime
context.
• DisplayManagerOnViewDeallocated—Triggers once a view is deallocated in the
runtime context.
4.1.3.3 Configuration Methods Region
The Configuration methods region specifies the manifest and module information data. The
manifest is used by the hub to load the module, and the module information is use for the
communication client-hub.
• SetupManifest—This method, shown in Figure 39, sets up the manifest configuration. This
configuration is used by the hub to load the modules and resources. This resoruces will be
added to the cap file. The entry-point library is used to specify the core library of the
module. This class must inherit from the HubFeatureModuleBase. If the property isn’t
specified, the module won’t load. When a plugin is required to include resources, such as
localization files, libraries, or images, this resources must be included on the Manifest
Collection. The source path can include directories.
• SetupModuleInfo—The ModuleInfo object contains the common information of the
module, such as name and ID, which are important properties for the hub’s logging and
communication proposes. Figure 40 shows the SetupModuleInfo method.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 42
• Event Subscription for Common Properties—The interface
IConfigurationManager shares four events, as shown in Figure 41.
• CommonPropertiesUpdated—In this sample, this event is used to read the current
application. The delegates must be declared as public, as shown in Figure 42.
• ConfigurationManager_CommonPropertiesUpdated—Delegate calls the
ShowToastNotification, as shown in Figure 43.
Other managers, such as the DisplayManager, share events. To get a notification when a
presentation is allocated or deallocated, subscribe to the event viewAllocated or
viewDeallocated, as shown in Figure 44.
Figure 39. SetupManifest Method
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
43 Revision 1.0
Figure 40. SetupModuleInfo Method
Figure 41. IConfigurationManager Event Handlers
Figure 42. CommonPropertiesUpdated
Figure 43. ConfigurationManager_CommonPropertiesUpdated
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 44
Figure 44. DisplayManager Event Handlers
4.1.3.4 Allocation Methods Region
This section describes the Quick Access View Allocation Methods region. Figure 45 shows the
ShowQuickAccessControlIcon implementation, which allocates the
HelloWorldQuickAccessIcon.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
45 Revision 1.0
Figure 45. ShowQuickAccessControlIcon Implementation
For each control, iterate over the available displays. The RuntimeContext object provides the
display manager interface. This manager includes the property AvailableDisplays, as
shown in Figure 46.
Figure 46. Cycle over All Available Displays Property
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 46
Figure 47 shows the CurrentUIDispatcher, in which the delegate’s subscription and control
initialization are made.
Figure 47. CurrentUiDispacher for Control Creation
The OnOpenQuickAccess event, shown in Figure 48, triggers when the user clicks the Quick
Access icon.
Figure 48. OnOpenQuickAccess Event in Quick Access View
.
Figure 49 shows the OnAllocateChildControls event. This event is triggered when the load
button of the Quick Access Control is clicked. The ShowChild Controls method allocates the
rest of the views. The implementation is checked later.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
47 Revision 1.0
Figure 49. OnAllocateChildControls Event
The OnDeAllocateViewQuickAccess event is triggered when the deallocate button is clicked
on the Quick Access Control, as shown in Figure 50.
Figure 50. OnDeAllocateViewQuickAccess Event
The DeAllocatedUserControl method contains the logic to deallocate any user controls
based on the dictionary and the identifier controller passed from the event in a custom
parameter. Figure 51 shows
RuntimeContext.DisplayManager.DeallocateUiFromHubDisplayAsync.
Figure 51. DeAllocateUserControl Method Implementation
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 48
The OnHideQuickAccess event is triggered when the Deallocate button is clicked on the
Quick Access Control. In this example, the RuntimeContext.DisplayManager.CloseMen is
used, as shown in Figure 52.
Figure 52. OnHideQuickAccess Event Implementation
Figure 53 shows how to instance a HubAllocationInfo object. The ViewType property is
necessary for the hub. It is used to identify where the control is rendered. In this method, two
hub allocations are identified, because one is used for the Quick Access Icon and the other for
the Quick Access View control.
Figure 53. HubAllocationInfo Objects
The Quick Access Icon View and Allocate Quick Access View uses the Allocated Control method,
as shown in Figure 54. This function uses the runtime context to make the allocation.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
49 Revision 1.0
Figure 54. AllocatedControl Usage Sample
Figure 55 shows the Allocated Control method logic. This method receives the user control. The
allocation information and the callback allocation event subscribe to the control.
Figure 55. AllocatedControl Method Implementation
Figure 56 shows the AllocateCallBackQuickAccessIcon and
AllocateCallBackQuickAccess methods used with the AllocateUserControl. This
receives the dictionary of the user controls and the hub allocation result.
Figure 56. Allocated Callback for QuickAccess and QuickAccessIcon
Figure 57 shows the implementation of the AllocateUserControl method. If the hub
allocation result is true, the allocated view is added to the dictionary. The dictionary is used
later in the deallocation process.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 50
Figure 57. AllocateUserControl Implementation
The ShowChildControls method is shown in Figure 58. Each method creates the
configuration and logic for the user control manipulation.
Figure 58. ShowChildControl Method
4.1.3.4.1 Presentation View and Ribbon View Allocation
Figure 59 shows the ShowOtherViewsControl method. This allocates the Presentation,
Ribbon, Status, and Authentication views. As with the ShowQuickAccessControlIcon, it
iterates over the available displays.
The Presentation view has a close dependency with the Ribbon. The Ribbon must be related
with the Presentation view control; otherwise, this control cannot be shown. This relation is
done using the function RuntimeContext.DisplayManager.ShowAllocatedUi(presentationDisplayView,
ribbonDisplayView);
Two allocation information objects are created—one for the Presentation view and another for
the Ribbon view. Each control has a unique Control Identifier. To maintain the control
state, it should be unique; otherwise, it can generate issues when the control is reallocated.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
51 Revision 1.0
In this sample, the user control state is maintained. Since multiple allocation occurs over all
displays, a control dictionary is created. The first time ShowOtherViewControl is called, the
dictionary is empty. Once the control is initialized with the delegates subscription, the control is
added to the dictionary. The next time a new allocation occurs, the dictionary obtains the
control. The key to this dictionary is the display ID. This mechanism is the same for the
Presentation and the Ribbon control.
For _authUserControl and _statusUserControl, generate a UniteImage object to make
the allocation. This control has a limited functionality. All the controls have the same identifier
to be allocated and deallocated by the Presentation control.
Figure 59. ShowOtherViewsControl User Controls Initialization
The OnToastMesssageView event handler refers to the button shown in Figure 60. This event
triggers when the user clicks the checkmark button. The toast message view allocates a toast
message on Intel Unite using the RuntimeContext.Display.Manager.TryShowToastMessage(message,visibilityti
me);.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 52
Figure 60. Checkmark Button Displays a Toast Message on the Hub Screen
The SDK also provides the functionality to display notifications using:
RuntimeContext.Display.Manager.TryShowNotification(toastrequest);.
This method receives a Toast Request object. Some parameters, such as title, body and Icon,
can be configured. If a developer doesn’t specify the icon, it takes the Intel Unite default icon, as
shown in Figure 61.
Figure 61. OnToastMessage View Implementation
The SelectElement method displays the Ribbon view. This event is triggered when the user
clicks the Presentation view layer, which provides the control and Read Property Control
identifiers. This returns a Presentation display view, and if the display view exists on the
dictionary, the Ribbon view displays. Once the Presentation and Ribbon views display, the
following SDK function is called, as shown in Figure 62:
RuntimeContext.DisplayManager.ShowAllocatedUi(presentationDisplayView,
ribbonDisplayView);
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
53 Revision 1.0
Figure 62. SelectElement Method Implementation
Figure 63 shows the UpdateAuthorizationView method. This event is triggered when a user
clicks the Change Authorization View button. This example shows how to update the
Authorization view image. This can be useful when a developer wants to update the image
based on a specific plugin state, like a change in the network speed. In this example, the image
is changed from the Authorization view to Status view, as shown in Figure 64. The same
mechanism is used for the UpdateStatusView.
Figure 63. UpdateAuthorizationView Method
Figure 64. Sample of Image Change for Authorization View
Figure 65 shows HubAllocationInfo objects used for different views. The tag element is
used to save any object that the developer requires. This case stores the control identifier to
make the process allocation and deallocation. Also, to maintain the control state for the Ribbon
and Presentation views, the property ID and ReuseControl are set to true.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 54
Figure 65. Multiple HubAllocationInfo Objects
For Presentation and Ribbon control, the AllocatedControlAndSaveState is used. To
allocate views for the Authorization and Status views, a diferent method is used to make the
allocation, as shown in Figure 66.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
55 Revision 1.0
Figure 66. Allocation Methods for Views
The AllocatedControlAndSaveState method receives the dictionary of contracts, user
control, allocation information object, and the delegates for the callback, as shown in Figure 67.
To maintain the control state, the developer must identify if the control created a contract. This
is done by using dictionarycontracts. If the control doesn’t exit, it is a fresh allocation;
otherwise, the control has been created before, and the contract must be sent as null in the
AllocateUiInHubDisplayAsync.
Figure 67. AllocatedControlAndSaveState Method
4.1.3.4.2 Partial Back Ground View Allocation
The ShowPartialBackGroundControl method is show in Figure 68. It allocates three WPF
controls in the same section. Each control has its own allocation method and deallocation
method, similar to the Presentation control.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 56
Figure 68. ShowPartialBackGroundControl Implementation for Multiple User Controls
4.1.3.5 Deallocation Methods Region
To remove one view of a module, use the deallocation method. In this sample, all the controls
contain the event subscription for the deallocation process, as shown in Figure 69.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
57 Revision 1.0
Figure 69. Deallocation Methods for Views
Figure 70 shows the DeAllocateAll method. It receives the dictionary of views to be
deallocated from the hub and resets the dictionary for future allocations.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 58
Figure 70. DeAllocateAll Method
Figure 71 shows the DeAllocateUserControl method. This method receives the display
dictionary for the controls from the event args. The control identifier to make the deallocation
process using the SDK function is as follows:
RuntimeContext.DisplayManager.DeallocateUiFromHubDisplayAsync(displayVi
ew,allocationResult => { });
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
59 Revision 1.0
Figure 71. DeAllocateUserControl Implementation
4.1.3.6 Interface Methods Region
Figure 72 shows the methods that must be implement by the hub for the
HubFeatureModuleBase abstract class, including:
• HtmlUrlOrContent—Applies to HTML modules.
• OkToSleepDisplay—Indicates if the module has any dependency if the display turns off.
• ModuleManifest—Contains the library information.
• ModuleInfo—Contains the common information of the module, such as the name and the
identifier.
• Dispatcher CurrentUiDispatcher—Serves as a UI handler property.
• Load—Fires when the module loads for the hub. This sample calls
ShowQuickAccessControlIcon().
• Unload—Assists with disposal, in case it is needed when the module is unloaded by the
hub.
• IncomingMessage(Message message)—Assists with client-hub communication.
The remaining events are explained in Section 3.5.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 60
Figure 72. Interface Methods
4.2 Hello World HTML Plugin Example
This example shows how to create a basic HTML plugin rendered by the client. It also shows
how to use different functions enabled for the HTML plugins. Figure 73 shows the hub flows for
loading modules into the client.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
61 Revision 1.0
Figure 73. Communication Flow between Hub and Client
4.2.1 Common Structure
To create a new C# class library Visual Studio project, follow these steps.
1. Create a new project in Visual Studio by selecting New > Project, as shown in Figure 74.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 62
Figure 74. Create a New Project
2. Create a Class Library project in C# by selecting Class Library on the Visual C# tab. Name it
HelloWorldHtmlModule, as shown in Figure 75.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
63 Revision 1.0
Figure 75. Create the HelloWorldHubHtmlModule
3. Add core libraries dependencies to the module, as shown in Figure 76.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 64
Figure 76. Add Core Libraries
4. The Intel.Unite.Common.dll is the SDK library installed with the Intel Unite solution.
As shown in Figure 77. The DLL is located at the following path:
%C:\ProgramData\Intel\Intel Unite\Hub 4.X” or %C:\ProgramData\Intel\Intel
Unite\Client 4.X
Add the reference. Use the library that belongs to the same version of the hub; otherwise,
incompatibility issues may occur.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
65 Revision 1.0
Figure 77. Intel.Unite.Common.dll
5. Click the Assemblies tab in Reference Manager, and then click Framework. Add the
Microsoft WPF libraries, as shown in PresentationCore:
− PresentationFramework
− System.AddIn
− System.AddIn.Contract
− System.Xaml
− WindowsBase
6. Create a new Command folder, as shown in Figure 78.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 66
Figure 78. Command Folder
7. Create a new UI folder, as shown in Figure 79.
Figure 79. UI Folder
8. Create a class HelloWorldHtmlModule, and add references to
Intel.Unite.Common.Module.Common and
Intel.Unite.Common.Module.Feature.Hub, as shown in Figure 80.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
67 Revision 1.0
Figure 80. Add References to the HelloWorldHtmlModule
4.2.2 Commands
Commands are for communications between the client and the hub. All command objects must
inherit from BaseCommand. A command is a message that is sent from the hub to the client and
vice versa.
This example uses two commands
• HelloWorldRequest
• HelloWorldResponse
4.2.2.1 HelloWorldRequest
The HelloWorldRequest command is used as an example of a request that goes from HTML
to the hub. All commands must inherit from CommandBase, as shown in Figure 81.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 68
Figure 81. CommandBase
The constructor of the command must call the base constructor. Inside the
HelloWorldRequest class, the ToMessage method is overridden, as shown in Figure 82.
Figure 82. ToMessage Implementation
This method defines the Message object. The Message object’s properties include:
• Priority—Identifies the message priority of Intel Unite. The enum MessagePriority
contains the following values:
− Low = 0
− Normal = 1
− High = 2
− Core = 3
• Data—Represents the information that is going to be sent to the hub or client.
• Data Type—Displays an integer value defined by the developer. Based on this property, the
developer can handle the command accordantly.
• Source Module ID—Provides a GUID value. This value must match the module ID defined in
the ModuleInfo object.
• Target ID—Configures the destination of the messages. The target ID can be a specific
client, or it can be configured to broadcast to all clients connected, as shown in Figure 83.
• Target Module ID—Configures the destination of messages. Different messages can be
shared between distinct modules.
Figure 84 shows the full reference of the request.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
69 Revision 1.0
Figure 83. Message Constants for Broadcast
Figure 84. HelloWorldRequest Class
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 70
4.2.2.2 HelloWorldResponse
Figure 85 shows the HelloWorldResponse command. It has the same structure as the
request, except the data type is set to 1. The data type is used to identify the command in the
incoming message function in the HelloWorldHtmlModule class.
Figure 85. HelloWorldResponse Class
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
71 Revision 1.0
4.2.3 HTML Content
The HTML Content file is located in the UI folder, as shown in Figure 86. This file is used to set
up a core property for the HTML modules. This property includes all the module functionality
such as UI, hub interaction, and so forth. The communication is done using the
IntelUnite.js library. This file must be declared as an embedded resource, as is shown in
Figure 87.
Figure 86. HtmlContent.html Location
Figure 87. HtmlContent.html Properties
4.2.4 IntelUnite.js.
The IntelUnite.js library enables the functions of Intel Unite through Windows*, Mac*, and
Android*. This library is injected to the HtmlContent property by Intel Unite®, as shown in the
following example.
1. //////////////////////////////////////////////////////////////////////////////////
//////////////////
2. // file: Scripts\IntelUnite.js
3. //
4. // summary: Intel unite class
5. //////////////////////////////////////////////////////////////////////////////////
//////////////////
6.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 72
7. var OSName = 'Unknown';
8. if (window.navigator.userAgent.indexOf('Windows') !== -1) {
9. OSName = 'Windows';
10. } 11. if (window.navigator.userAgent.indexOf('Mac') !== -1) { 12. OSName = 'Mac'; 13. } 14. if (window.navigator.userAgent.indexOf('Linux') !== -1) { 15. OSName = 'Linux'; 16. } 17. 18. // Global variable for storing promises 19. var promises = {}; 20. 21. // Generates a unique identifier 22. function generateUUID() { 23. var d = new Date().getTime(); 24. var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-
xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
25. var r = (d + Math.random() * 16) % 16 | 0; 26. d = Math.floor(d / 16); 27. return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16); 28. }); 29. return uuid; 30. }; 31. 32. // Common function for resolving / rejecting a promise previously stored 33. function resolvePromise(promiseId, data, error) { 34. if (error) { 35. window.promises[promiseId].reject(data); 36. 37. } else { 38. window.promises[promiseId].resolve(data); 39. } 40. // remove referenfe to stored promise 41. delete window.promises[promiseId]; 42. } 43. 44. function IntelUnite() { } 45. 46. if (OSName === 'Mac') { 47. 48. 49. window.IntelUnite.prototype.logMessage = function (message, severity) { 50. webkit.messageHandlers.logMessage.postMessage({ message: message, severity
: severity });
51. } 52. 53. 54. window.IntelUnite.prototype.logTelemetryEvent = function (data) { 55. webkit.messageHandlers.logTelemetryEvent.postMessage({ data: data }); 56. } 57. 58. window.IntelUnite.prototype.sendMessage = function (message) { 59. webkit.messageHandlers.sendMessage.postMessage({ message: message }); 60. 61. } 62. window.IntelUnite.prototype.updateToolMenu = function (label, imageBase64) { 63. webkit.messageHandlers.updateToolMenu.postMessage({ label: label, imageBas
e64: imageBase64 });
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
73 Revision 1.0
64. 65. } 66. window.IntelUnite.prototype.setNumberNotification = function (number) { 67. webkit.messageHandlers.setNumberNotification.postMessage({ number: number
});
68. } 69. 70. window.IntelUnite.prototype.showScreenSharing = function (multidisplaySupporte
d) {
71. webkit.messageHandlers.showScreenSharing.postMessage({ multidisplaySupported: multidisplaySupported });
72. 73. } 74. 75. 76. /////////////////////////// 77. /*Functions with promises*/ 78. /////////////////////////// 79. 80. window.IntelUnite.prototype.getContext = function () { 81. var promise = new Promise(function (resolve, reject) { 82. var promiseId = generateUUID(); 83. window.promises[promiseId] = { resolve: resolve, reject: reject }; 84. try { 85. webkit.messageHandlers.getContext.postMessage({ promiseId: promise
Id });
86. } 87. catch (exception) { 88. console.log(exception); 89. } 90. }); 91. return promise; 92. } 93. 94. window.IntelUnite.prototype.getTheme = function () { 95. var promise = new Promise(function (resolve, reject) { 96. var promiseId = generateUUID(); 97. window.promises[promiseId] = { resolve: resolve, reject: reject }; 98. try { 99. webkit.messageHandlers.getTheme.postMessage({ promiseId: promiseId
});
100. }
101. catch (exception) {
102. console.log(exception);
103. }
104. });
105. return promise;
106. }
107.
108. window.IntelUnite.prototype.getMaxMessageSize = function () {
109. var promise = new Promise(function (resolve, reject) {
110. var promiseId = generateUUID();
111. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
112. try {
113. webkit.messageHandlers.getMaxMessageSize.postMessage({ pro
miseId: promiseId });
114. }
115. catch (exception) {
116. console.log(exception);
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 74
117. }
118. });
119. return promise;
120. }
121. window.IntelUnite.prototype.getAppointmentList = function (nextHours)
{
122. var promise = new Promise(function (resolve, reject) {
123. var promiseId = generateUUID();
124. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
125. try {
126. webkit.messageHandlers.getAppointmentList.postMessage({ pr
omiseId: promiseId, nextHours: nextHours });
127. }
128. catch (exception) {
129. console.log(exception);
130. }
131. });
132. return promise;
133. }
134. window.IntelUnite.prototype.getCurrentAppointments = function () {
135. var promise = new Promise(function (resolve, reject) {
136. var promiseId = generateUUID();
137. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
138. try {
139. webkit.messageHandlers.getCurrentAppointments.postMessage(
{ promiseId: promiseId });
140. }
141. catch (exception) {
142. console.log(exception);
143. }
144. });
145. return promise;
146. }
147. window.IntelUnite.prototype.isCalendarAvailable = function () {
148. var promise = new Promise(function (resolve, reject) {
149. var promiseId = generateUUID();
150. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
151. try {
152. webkit.messageHandlers.isCalendarAvailable.postMessage({ p
romiseId: promiseId });
153. }
154. catch (exception) {
155. console.log(exception);
156. }
157. });
158. return promise;
159. }
160. /*File Sharing*/
161. window.IntelUnite.prototype.createFile = function (fileName) {
162. var promise = new Promise(function (resolve, reject) {
163. var promiseId = generateUUID();
164. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
165. try {
166. webkit.messageHandlers.createFile.postMessage({ promiseId:
promiseId, fileName: fileName });
167. }
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
75 Revision 1.0
168. catch (exception) {
169. console.log(exception);
170. }
171. });
172. return promise;
173. }
174. window.IntelUnite.prototype.writeToFile = function (fileHandleId, base
64Chunk) {
175. var promise = new Promise(function (resolve, reject) {
176. var promiseId = generateUUID();
177. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
178. try {
179. webkit.messageHandlers.writeToFile.postMessage({ promiseId
: promiseId, fileHandleId: fileHandleId, base64Chunk: base64Chunk });
180. }
181. catch (exception) {
182. console.log(exception);
183. }
184. });
185. return promise;
186. }
187. window.IntelUnite.prototype.closeFile = function (fileHandleId) {
188. var promise = new Promise(function (resolve, reject) {
189. var promiseId = generateUUID();
190. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
191. try {
192. webkit.messageHandlers.closeFile.postMessage({ promiseId:
promiseId, fileHandleId: fileHandleId });
193. }
194. catch (exception) {
195. console.log(exception);
196. }
197. });
198. return promise;
199. }
200.
201. window.IntelUnite.prototype.openFolder = function (fileHandleId) {
202. var promise = new Promise(function (resolve, reject) {
203. var promiseId = generateUUID();
204. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
205. try {
206. webkit.messageHandlers.openFolder.postMessage({ promiseId:
promiseId, fileHandleId: fileHandleId });
207. }
208. catch (exception) {
209. console.log(exception);
210. }
211. });
212. return promise;
213. }
214. window.IntelUnite.prototype.deleteFile = function (fileHandleId) {
215. var promise = new Promise(function (resolve, reject) {
216. var promiseId = generateUUID();
217. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
218. try {
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 76
219. webkit.messageHandlers.deleteFile.postMessage({ promiseId:
promiseId, fileHandleId: fileHandleId });
220. }
221. catch (exception) {
222. console.log(exception);
223. }
224. });
225. return promise;
226. }
227.
228. window.IntelUnite.prototype.getFileTransferConfiguration = function ()
{
229. var promise = new Promise(function (resolve, reject) {
230. var promiseId = generateUUID();
231. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
232. try {
233. webkit.messageHandlers.getFileTransferConfiguration.postMe
ssage({ promiseId: promiseId });
234. }
235. catch (exception) {
236. console.log(exception);
237. }
238. });
239. return promise;
240. }
241. window.IntelUnite.prototype.getMaxFileSize = function () {
242. var promise = new Promise(function (resolve, reject) {
243. var promiseId = generateUUID();
244. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
245. try {
246. webkit.messageHandlers.getMaxFileSize.postMessage({ promis
eId: promiseId });
247. }
248. catch (exception) {
249. console.log(exception);
250. }
251. });
252. return promise;
253. }
254. /*End File Manager*/
255. /*End File Sharing*/
256. }
257. //Windows
258. if (OSName === 'Windows') {
259.
260. window.IntelUnite.prototype.logMessage = function (message, severity)
{
261. window.external.logMessage(message, severity);
262. }
263.
264.
265. window.IntelUnite.prototype.logTelemetryEvent = function (data) {
266. window.external.logTelemetryEvent(data);
267. }
268.
269. window.IntelUnite.prototype.sendMessage = function (message) {
270. window.external.sendMessage(message);
271.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
77 Revision 1.0
272. }
273. window.IntelUnite.prototype.updateToolMenu = function (label, imageBas
e64) {
274. window.external.updateToolMenu(label, imageBase64);
275.
276. }
277. window.IntelUnite.prototype.setNumberNotification = function (number)
{
278. window.external.setNumberNotification(number);
279.
280. }
281. window.IntelUnite.prototype.showScreenSharing = function (multidisplay
Supported) {
282. window.external.showScreenSharing(multidisplaySupported);
283.
284. }
285.
286. ///////////////////////////
287. /*Functions with promises*/
288. ///////////////////////////
289.
290. window.IntelUnite.prototype.getContext = function () {
291. var promise = new Promise(function (resolve, reject) {
292. var promiseId = generateUUID();
293. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
294. try {
295. window.external.getContext(promiseId);
296. }
297. catch (exception) {
298. alert(exception);
299. }
300. });
301. return promise;
302. }
303.
304. window.IntelUnite.prototype.getTheme = function () {
305. var promise = new Promise(function (resolve, reject) {
306. var promiseId = generateUUID();
307. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
308. try {
309. window.external.getTheme(promiseId);
310. }
311. catch (exception) {
312. alert(exception);
313. }
314. });
315. return promise;
316. }
317.
318. window.IntelUnite.prototype.getMaxMessageSize = function () {
319. var promise = new Promise(function (resolve, reject) {
320. var promiseId = generateUUID();
321. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
322. try {
323. window.external.getMaxMessageSize(promiseId);
324. }
325. catch (exception) {
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 78
326. alert(exception);
327. }
328. });
329. return promise;
330. }
331. window.IntelUnite.prototype.getAppointmentList = function (nextHours)
{
332. var promise = new Promise(function (resolve, reject) {
333. var promiseId = generateUUID();
334. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
335. try {
336. window.external.getAppointmentList(promiseId, nextHours);
337. }
338. catch (exception) {
339. alert(exception);
340. }
341. });
342. return promise;
343. }
344. window.IntelUnite.prototype.getCurrentAppointments = function () {
345. var promise = new Promise(function (resolve, reject) {
346. var promiseId = generateUUID();
347. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
348. try {
349. window.external.getCurrentAppointments(promiseId);
350. }
351. catch (exception) {
352. alert(exception);
353. }
354. });
355. return promise;
356. }
357. window.IntelUnite.prototype.isCalendarAvailable = function () {
358. var promise = new Promise(function (resolve, reject) {
359. var promiseId = generateUUID();
360. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
361. try {
362. window.external.isCalendarAvailable(promiseId);
363. }
364. catch (exception) {
365. alert(exception);
366. }
367. });
368. return promise;
369. }
370. /*File Manager Functions*/
371. window.IntelUnite.prototype.createFile = function (fileName) {
372. var promise = new Promise(function (resolve, reject) {
373. var promiseId = generateUUID();
374. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
375. try {
376. window.external.createFile(promiseId, fileName);
377. }
378. catch (exception) {
379. alert(exception);
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
79 Revision 1.0
380. }
381. });
382. return promise;
383. }
384. window.IntelUnite.prototype.writeToFile = function (handleId, base64Ch
unk) {
385. var promise = new Promise(function (resolve, reject) {
386. var promiseId = generateUUID();
387. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
388. try {
389. window.external.writeToFile(promiseId, handleId,base64Chun
k);
390. }
391. catch (exception) {
392. alert(exception);
393. }
394. });
395. return promise;
396. }
397. window.IntelUnite.prototype.closeFile = function (handleId) {
398. var promise = new Promise(function (resolve, reject) {
399. var promiseId = generateUUID();
400. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
401. try {
402. window.external.closeFile(promiseId, handleId);
403. }
404. catch (exception) {
405. alert(exception);
406. }
407. });
408. return promise;
409. }
410.
411. window.IntelUnite.prototype.openFolder = function (handleId) {
412. var promise = new Promise(function (resolve, reject) {
413. var promiseId = generateUUID();
414. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
415. try {
416. window.external.openFolder(promiseId, handleId);
417. }
418. catch (exception) {
419. alert(exception);
420. }
421. });
422. return promise;
423. }
424. window.IntelUnite.prototype.deleteFile = function (handleId) {
425. var promise = new Promise(function (resolve, reject) {
426. var promiseId = generateUUID();
427. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
428. try {
429. window.external.deleteFile(promiseId, handleId);
430. }
431. catch (exception) {
432. alert(exception);
433. }
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 80
434. });
435. return promise;
436. }
437.
438. window.IntelUnite.prototype.getFileTransferConfiguration = function ()
{
439. var promise = new Promise(function (resolve, reject) {
440. var promiseId = generateUUID();
441. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
442. try {
443. window.external.getFileTransferConfiguration(promiseId);
444. }
445. catch (exception) {
446. alert(exception);
447. }
448. });
449. return promise;
450. }
451.
452. window.IntelUnite.prototype.getMaxFileSize = function () {
453. var promise = new Promise(function (resolve, reject) {
454. var promiseId = generateUUID();
455. window.promises[promiseId] = { resolve: resolve, reject: rejec
t };
456. try {
457. window.external.getMaxFileSize(promiseId);
458. }
459. catch (exception) {
460. alert(exception);
461. }
462. });
463. return promise;
464. }
465. /*End File Manager*/
466. }
467. window.IntelUnite = new IntelUnite();
468.
4.2.4.1 JavaScript Section
The logic of the HTML module works with events and functions. All the functions belong to the
JavaScript* library IntelUnite.Js, and the events haves to be coded by the developer.
4.2.4.1.1 Events
The hub triggers some events. The following events notify all modules:
• onLockSession—The session is locked (refer to Figure 88).
• onMessage—The module received a message from the hub (refer to Figure 89).
• onModerationModeUpdated—The moderation mode is enabled or changed (refer to
Figure 90).
• onUnLockSession—The session is unlocked (refer to Figure 91).
• onUserConnected—One user joined the session (refer to Figure 92).
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
81 Revision 1.0
• onUserDisConnected—One user left the session (refer to Figure 93).
• onUserInfoChanged—A user updated their role or common information, such as name or
avatar (refer to Figure 94).
• showScreenSharingCallback—If True is returned, screen sharing is successful (refer to
Figure 95).
Figure 88. onLockSession
Figure 89. onMessage
Figure 90. onModerationModeulUpdated
Figure 91. onUnLockSession
Figure 92. onUserConnected
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 82
Figure 93. onUserDisConnected
Figure 94. onUserInfoChanged
Figure 95. showScreenSharingCallback
4.2.4.1.2 Functions
Functions are methods that get or send information from Intel Unite®, as follows:
• getAppointmentList—Returns a JSON* of appointment list (refer to Figure 96).
• getContext—Returns the section context of the session (refer to Figure 97).
• getCurrentAppointments—Gets the current appointment (refer to Figure 98).
• getMaxMessageSize—Gets the maximum size of the message configured for the hub
(refer to Figure 99).
• getTheme—Gets the Intel Unite theme. The theme can be used to apply the same style as
Intel Unite® in modules (refer to Figure 100).
• isCalendarAvailable—Gets the available calendar for the hub (refer to Figure 101).
• logMessage—Writes logs on the client (refer to Figure 102).
• logTelemetryEvent—Logs events on the table logs (refer to Figure 103).
• sendMessage—Communicates between client and hub (refer to Figure 104).
• setNumberNotification—Sets up a number on the sidebar icon of the HTML module.
This informs the user that a message has been sent by the hub (refer to Figure 105).
• showScreenSharing—Displays the screen sharing section (refer to Figure 106).
• updateToolMenu—Checks the sidebar icon of the HTML module. The text and image can
be configured. The image is encoded as base-64 (refer to Figure 107).
• writeFile—Saves any type of file on the client (refer to Figure 108).
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
83 Revision 1.0
Figure 96. getAppointmentList Function
Figure 97. getContext Function
Figure 98. getCurrentAppointments Function
Figure 99. getMaxMessageSize Function
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 84
Figure 100. getTheme Function
Figure 101. isCalendarAvailable Function
Figure 102. logMessage Function
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
85 Revision 1.0
Figure 103. logTelemetryEvent Function
Figure 104. sendMessage Function
Figure 105. setNumberNotification Function
Figure 106. showScreenSharing Function
Figure 107. updateToolMenu Function
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 86
Figure 108. writeFile Function
4.2.4.2 Body HTML
The body HTML includes controls used for the UI in the HTML module, as shown in Figure 109.
Figure 109. Body HTML
4.2.5 Hello World HTML Module
The Hello World HTML Module class contains the Intel Unite SDK functionality, such as logging,
allocation, deallocation, and delegate subscriptions.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
87 Revision 1.0
4.2.5.1 Private Global Variables Region
The private global variables section defines the objects important for the module. Like the
module manifest and the module information, this object is core for the deployment of the
module, as shown in Figure 110.
Figure 110. Private Variables for the HelloWorldHtmlModule
4.2.5.2 Constructor Region
Figure 111 shows the constructor region that contains two constructors used from different
events. Both constructors call the parent class and configure the ModuleInfo and the
Manifest object:
• HelloWorldHtmlModule(IModuleRuntimeContext runtimeContext)—Extends the
interface IModuleRuntimeContext.
• HelloWorldHtmlModule()—Acts as a parameter-less constructor. This constructor is
used for the manifest generator tool.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 88
Figure 111. HelloWorldHtmlModule Constructor and Initialize Method
4.2.5.3 Configuration Methods Region
The Configuration methods region specifies the manifest and module information data. The
manifest is used by the hub to load the module, and the module information is used for the
client-hub communication.
The SetupManifest method is shown in Figure 112. This method sets up the manifest
configuration. This configuration is used by the hub to load the modules and resources. The
entry-point library is used to specify the module’s core library. This class must inherit
from the HubFeatureModuleBase. If this property is not specified, the module won’t load.
When the HTML module’s manifest is set up, the FeatureModuleType property must be set
up to have the enum value FeatureModuleType.Html.
The GetDefaultConfigurationSettings method returns an empty collection of
ConfigurationSettings, but this can be configure based on the developer requirements.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
89 Revision 1.0
Figure 112. SetupManifest Implementation
Figure 113 shows the SetupModuleInfo method. The ModuleInfo object contains the
module’s common information, such as the name and ID. Both properties are important to the
hub for logging and communication purposes. The modules can also specify supported
platforms. For this sample, Mac and Windows are supported.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 90
Figure 113. SetupModuleInfo Implementation
The FillHtml method reads the HTML file and sets up the data in the _html property. The
HTMLContent.html must be configured as an embedded resource; otherwise, the module
can’t load the file. Alternatively, the HTML content can be specified with plain text, as shown in
Figure 114.
Figure 114. FillHtml Method Implementation
4.2.5.4 Abstract Class Methods Region
Figure 115 shows the methods that must be implement by the hub for the
HubFeatureModuleBase abstract class.
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
91 Revision 1.0
Figure 115. Abstract Class Methods
The Abstract Class methods can be overridden to apply the logic necessary for the module
development, using the following properties:
Code Examples
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 92
• HtmlUrlOrContent—Renders the UI and logic of the HTML content. In this property, the
javascript library IntelUnitel.js is injected.
• OkToSleepDisplay—Returns a Boolean value.
• ModuleManifest ModuleManifest—Contains the library information.
• ModuleInfo ModuleInfo—Contains the module’s common information, such as the
name and identifier.
• Dispatcher CurrentUiDispatcher—Provides a UI handler property.
• IncomingMessage(Message message)—Enables client-hub communication, as shown
in Figure 116.
• Load—Helps configure the ModuleImage property.
The remaining events are explained in Section 3.5.
Figure 116. Incoming Message Implementation
Package Creation and Deployment
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
93 Revision 1.0
5 Package Creation and Deployment
In version 4.0, IT administrators use a manifest file to install a plugin using the Intel Unite Admin
Portal. Refer to the 4.0 user guide to obtain more information about the dynamic updates in 4.0.
5.1 Creating and Uploading the Plugin Package
To create a package for the plugin package:
1. Run the Manifest Generator tool. This tool is included in the SDK package. Execute the
command with the following parameters, as show in Figure 117:
"-m PathofTheDllThatContainsTheModuleClass -t
PathAndNameOfYourModule.cab"
This creates a .cab file that contains the module, as shown in Figure 118.
Figure 117. Command for Manifest Generator on Windows Console
Figure 118. Cab File
2. Sign the .cab file. (This process is out of scope for this guide.)
3. Upload the file in the Intel Unite Admin Portal. Click the Upload Package button, and select
the file, as shown in Figure 119.
Package Creation and Deployment
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 94
Figure 119. Admin Portal Upload Package Process
4. Click Manage Configuration > View App > Features > PackageApproval. Then, to approve
the package, go to the Hub App/Features tab. The module’s features are listed, as shown in
Figure 120.
Package Creation and Deployment
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
95 Revision 1.0
Figure 120. Module Features
5. Create or edit the hub configuration, and assign the plugin to the hub configuration, as
shown in Figure 121.
Figure 121. Feature List of Hub Configuration Section on the Admin Portal
Developer Notes
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 96
6 Developer Notes
Note the following:
• Events must be abstract and non-blocking. If a long running operation occurs, a thread
should be used to ensure that the UI remains responsive.
• A plugin must handle its own exceptions.
• When a user control has to maintain the UI changes through the deallocation and allocation
process, the HubAllocationInfoObject must be configured with the property
ReuseControl set to True and specified with a unique ID. If the ID is set up with an
empty GUID, the control will not respect the configuration. This can cause and allocation
error.
Also, if the control is allocated and the developer performs a deallocation process to reuse
the same control, the contract of the control must be sent as null in the method
RuntimeContext.DisplayManager.AllocateUiInHubDisplayAsync, as explained
earlier in this document.
6.1 Logs
The developer can use RuntimeContext.LogManager for logging proposes. The interface
contains three methods, as shown in Figure 122. Figure 123 shows the enum LogLevel used to
classify the log.
The logs are written to the Unite.sql file. This file can be found on the %Temp% path, as
shown in Figure 124. The file can be opened with the open source tool SQLLiteBrowser*. Figure
125 shows the logging table written by Intel Unite.
Figure 122. IModuleLoggingManager Methods
Developer Notes
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
97 Revision 1.0
Figure 123. LogLevel enum Options
Figure 124. Unite Logs Path
Figure 125. Logging Table
Developer Notes
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 98
6.2 Commands
Commands are used to share information between the hub and client. Figure 126 illustrates the
communication. In most cases, a client sends a request to the hub, and the hub returns a
response. This is possible using commands.
Figure 126. Communication Flow from HTML Module to Hub
Most of the time, the hub requires a response for each request, but this depend of the logic and
module configuration commands (ModuleConfigurationRequest and
ModuleConfigurationResponse). Figure 127 shows the class diagram on the module
structure.
Developer Notes
Intel Unite® Plugin Software Development Kit (SDK)
API Guide September 2018
99 Revision 1.0
Figure 127. Class Diagram
Target IDs are used to identify the destination of a command, but sometimes Target IDs are
incorrectly defined. Therefore, keep the following in mind:
• Target ID is used to identify the destination of the command. Most of the time, the constant
MessageConstants.TargetBroadcastId is used. This means the message is sent to all
clients in the session.
• A message can be sent to a specific client. Clients connected to the hub contain a GUID
identifier. To get the identifier, consult the session context with the line
RuntimeContext.SessionContext.Users. This returns all the users connected in the
session.
• If a message is not arriving to the hub,
RuntimeContext.MessageSender.TrySendMessage is returning false. This situation
can occur when the size of a message is greater than the maximum allowed permitted in
Intel Unite. The default value is 65535 bytes. The size of the message can be reduced in the
Admin Portal, or the command can be split into chunk messages to respect the size
limitations.
Support
Intel Unite® Plugin Software Development Kit (SDK)
September 2018 API Guide
Revision 1.0 100
7 Support
Intel provides no official support for the Intel Unite Plugin SDK, but best efforts are made by the
team to address the needs of the development community.
For developers with an established relationship with Intel Corporation, contact your respective
Business Development Manager, Application Engineer, or other Intel team member to request
assistance with specific needs using this SDK and supporting documentation.
For all others, contact Intel Customer Support or participate in the Intel Developer Zone at
www.intel.com to receive additional attention and assistance with this SDK.
As Intel continues development the Intel Unite application and features, new updates are
posted to the SDK. Please check back for additional updates as they become available in the
future.