• No results found

Socialite Client Application

In document Architecting Social Internet of Things (Page 104-108)

4.7 END USER EMPOWERED REASONING FRAMEWORK

4.7.2 Socialite Client Application

The Socialite client application is a Web based application using Backbone.js, which is a light-weight JavaScript library with a REST Web Service and is based on the model view presenter design paradigm [134]. We selected a Web based application because potential users would use different mobile devices and computers when they access the existing social networks site, as we found in the user survey. The Web based application can be accessible from any type of devices. Obviously the client application can be extended with mobile applications in the future.

4.7.2.1 Features Figure 29a shows all menus available in the Socialite Web based ap- plication. As shown in 1 in Figure 29a, user profile management, user’s owned device management, user’s friends management, user’s owned devices’ thriends management, and rule management are realized in the Socialite client application. The Figure 29a is a screen- shot of when a current user clicks “My Devices” menu from 1 . It shows that two devices are registered in Living room and Bedroom. If the current user wants to register a new device, the user clicks one of devices from the device catalog in 2 , and drag and drop to one of the rooms in the left pane. Clearly, the room layout and other user interface can be further enhanced with other available libraries, but it is beyond of the scope of this dissertation.

When a user clicks right top corner of icon representing one of the registered devices, the user can monitor and control the selected device by interacting with the pop-up window as shown in 3 in Figure29b. The history of the selected device is visualized as a graph when the user clicks the left bottom corner of the device icon on the room layout. A device can be removed by also clicking the trash can on the right bottom of the device icon. The left top corner of the device icon is used to edit the device information.

(a) Basic features

(b) Remote control of a lamp

Push notifications originated by the server are sent to the client application through web sockets and managed by the publish and subscribe service in the server side.

All operations originated by the client use the Socialite REST APIs provided by the Socialite server.

4.7.2.2 End User Programming for Rules The Socialite end-user programming tool is represented to the user as a trigger-action programming, which is one of the most common formats in the academic literature that matches with users’ mental model [65, 68,163].

Figure 30 represents the main UI view of a rule creation. The devices listed in 1 are devices that satisfy the filtering options from 1 (relationship types) and 2 (device properties or contexts). If the user drags and drops one of the devices or contexts listed in 3 (Trigger panel) to 7 (IF panel), then a pop-up window is shown to allow the user to add a condition (e.g., temperature >80 ◦F). The user can add as many devices and contexts from 3 as s/he wants to express more conditions. The default operator among condition is conjunction.

In the panel 6 (Actuator panel), all user’s devices with action capabilities and services are shown as a default. The user can select a different relationship type in 4 or filter devices with a certain action capability or services in 5 . The user can select one of devices or services and drag it to 8 (THEN panel). The user can set the action value by using the pop-up window ( 9 ) with a default action pre-selected from 5 . For the service actuator, the user can select relationship types provided by the service. For example, a “repair solution query service” may ask a user to select kinship or/and thriendship as parameter values used for the implemented service. The user can also create a context instead of device action or service invocation, by clicking the save context menu in 5 .

Once the user finishes the condition and action expression of the rule, then the user clicks save button in 10 , which will call a Socialite server API to add the new rule for the current user after providing the rule meta information, such as the rule name and description.

The current implementation of the end user programming application enables the de- vice capability as well as device type based automation, context generation, context based automation, and service invocation.

Figure 30: End-user programm ing user in terface

4.7.2.3 Architecture Overview The Socialite client application is a light-weight Web- based application that communicates with the Socialite server via REST APIs. As explained earlier in this section, we employed Backbone.js as a basic framework. Therefore, the ar- chitecture design is based on the model view presenter architectural pattern. Figure 31

illustrates the Socialite client architecture overview with a rule creation user interface. The client UI view represents HTML documents together with templates, which are markup that can be used to create different reusable copies of that markup but populating each component with different data. The model represents the data model such as rule, device, relationship, user, etc. The presenter (e.g., rule presenter, device presenter) uses the observer design pattern [78] to subscribe to changes from the model.

The Socialite end user programming support device/capability based automation, con- text based automation, context generation and service invocation with consideration of re- lationships. Although the server APIs are available, the existing end user programming has not yet implemented preference based automation and temporal reasoning in the user interface.

In document Architecting Social Internet of Things (Page 104-108)