diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/DigitalDisplayControllerService.java b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/DigitalDisplayControllerService.java index 0aa638f73..640b459b5 100644 --- a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/DigitalDisplayControllerService.java +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/DigitalDisplayControllerService.java @@ -66,6 +66,7 @@ public DigitalDisplayMQTTConnector getDigitalDisplayMQTTConnector() { public void setDigitalDisplayMQTTConnector(final DigitalDisplayMQTTConnector digitalDisplayMQTTConnector) { + Runnable connector = new Runnable() { public void run() { if (waitForServerStartup()) { @@ -88,22 +89,23 @@ public void run() { /** * Restart the running browser in the given digital display. * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method */ @Path("/restart-browser") @POST - @Feature(code = "restart-browser", name = "Restart Browser", type="operation", + @Feature(code = "restart-browser", name = "Restart Browser", type = "operation", description = "Restart Browser in Digital Display") public void restartBrowser(@HeaderParam("deviceId") String deviceId, @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, + @HeaderParam("Authorization") String token, @Context HttpServletResponse response) { try { - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + DigitalDisplayConstants.RESTART_BROWSER_CONSTANT + ":", ""); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.RESTART_BROWSER_CONSTANT + "::", ""); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -116,55 +118,26 @@ public void restartBrowser(@HeaderParam("deviceId") String deviceId, } - /** - * Close the running browser in the given digital display. - * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method - */ - @Path("/close-browser") - @POST - @Feature(code = "close-browser", name = "Close Browser", type="operation", - description = "Close Browser in Digital Display") - public void closeBrowser(@HeaderParam("deviceId") String deviceId, - @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, - @Context HttpServletResponse response) { - - try { - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + DigitalDisplayConstants.CLOSE_BROWSER_CONSTANT + ":", ""); - response.setStatus(Response.Status.OK.getStatusCode()); - } catch (DeviceManagementException e) { - log.error(e); - response.setStatus(Response.Status.UNAUTHORIZED.getStatusCode()); - } catch (DigitalDisplayException e) { - log.error(e); - response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); - } - - } - /** * Terminate all running processes. If this execute we have to reboot digital display manually. * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method */ @Path("/terminate-display") @POST - @Feature(code = "terminate-display", name = "Terminate Display", type="operation", + @Feature(code = "terminate-display", name = "Terminate Display", type = "operation", description = "Terminate all running process in Digital Display") public void terminateDisplay(@HeaderParam("deviceId") String deviceId, @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, + @HeaderParam("Authorization") String token, @Context HttpServletResponse response) { try { - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + DigitalDisplayConstants.TERMINATE_DISPLAY_CONSTANT + ":", ""); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.TERMINATE_DISPLAY_CONSTANT + "::", ""); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -177,24 +150,25 @@ public void terminateDisplay(@HeaderParam("deviceId") String deviceId, } /** - * Restart python server in given digital display + * Reboot running digital display * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method */ @Path("/restart-display") @POST - @Feature(code = "restart-display", name = "Restart Display", type="operation", + @Feature(code = "restart-display", name = "Restart Display", type = "operation", description = "Restart Digital Display") public void restartDisplay(@HeaderParam("deviceId") String deviceId, @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, + @HeaderParam("Authorization") String token, @Context HttpServletResponse response) { try { - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + DigitalDisplayConstants.RESTART_DISPLAY_CONSTANT + ":", ""); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.RESTART_DISPLAY_CONSTANT + "::", ""); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -211,27 +185,55 @@ public void restartDisplay(@HeaderParam("deviceId") String deviceId, * * @param deviceId id of the controlling digital display * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client + * @param token web socket id of the method invoke client * @param response response type of the method - * @param path page no need to change + * @param name name of page need to change * @param attribute this can be path,time or type * @param newValue page is used to replace path */ - @Path("/edit-content") + @Path("/edit-sequence") + @POST + @Feature(code = "edit-sequence", name = "Edit Sequence", type = "operation", + description = "Search through the sequence and edit requested resource in Digital Display") + public void editSequence(@HeaderParam("deviceId") String deviceId, + @HeaderParam("owner") String owner, + @FormParam("name") String name, + @FormParam("attribute") String attribute, + @FormParam("new-value") String newValue, + @HeaderParam("Authorization") String token, + @Context HttpServletResponse response) { + + try { + token = token.split(" ")[1]; + String params = name + "|" + attribute + "|" + newValue; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.EDIT_SEQUENCE_CONSTANT + "::", params); + response.setStatus(Response.Status.OK.getStatusCode()); + } catch (DeviceManagementException e) { + log.error(e); + response.setStatus(Response.Status.UNAUTHORIZED.getStatusCode()); + } catch (DigitalDisplayException e) { + log.error(e); + response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); + } + + } + + @Path("/upload-content") @POST - @Feature(code = "edit-content", name = "Edit Content", type="operation", + @Feature(code = "upload-content", name = "Upload Content", type = "operation", description = "Search through the sequence and edit requested resource in Digital Display") - public void editContent(@HeaderParam("deviceId") String deviceId, - @HeaderParam("owner") String owner, - @FormParam("path") String path, - @FormParam("attribute") String attribute, - @FormParam("new-value") String newValue, - @HeaderParam("sessionId") String sessionId, - @Context HttpServletResponse response) { + public void uploadContent(@HeaderParam("deviceId") String deviceId, + @HeaderParam("owner") String owner, + @FormParam("remote-path") String remotePath, + @FormParam("screen-name") String screenName, + @HeaderParam("Authorization") String token, + @Context HttpServletResponse response) { try { - String params = path + "|" + attribute + "|" + newValue; - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + DigitalDisplayConstants.EDIT_SEQUENCE_CONSTANT + ":", params); + token = token.split(" ")[1]; + String params = remotePath + "|" + screenName; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.UPLOAD_CONTENT_CONSTANT + "::", + params); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -246,38 +248,40 @@ public void editContent(@HeaderParam("deviceId") String deviceId, /** * Add new resource end to the existing sequence * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method - * @param type type of new resource - * @param time new resource visible time - * @param path URL of the new resource + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method + * @param type type of new resource + * @param time new resource visible time + * @param path URL of the new resource */ @Path("/add-resource") @POST - @Feature(code = "add-resource", name = "Add Resource", type="operation", + @Feature(code = "add-resource", name = "Add Resource", type = "operation", description = "Add new resource end to the existing sequence in Digital Display") public void addNewResource(@HeaderParam("deviceId") String deviceId, @HeaderParam("owner") String owner, @FormParam("type") String type, @FormParam("time") String time, @FormParam("path") String path, + @FormParam("name") String name, @FormParam("position") String position, - @HeaderParam("sessionId") String sessionId, + @HeaderParam("Authorization") String token, @Context HttpServletResponse response) { String params; try { - if (position.isEmpty()){ - params = type + "|" + time + "|" + path; + if (position.isEmpty()) { + params = type + "|" + time + "|" + path + "|" + name; } else { - params = type + "|" + time + "|" + path + - "|" + "after=" + position; + params = type + "|" + time + "|" + path + "|" + name + + "|" + "after=" + position; } - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + - DigitalDisplayConstants.ADD_NEW_RESOURCE_CONSTANT + ":", params); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + + DigitalDisplayConstants.ADD_NEW_RESOURCE_CONSTANT + "::", params); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -291,25 +295,26 @@ public void addNewResource(@HeaderParam("deviceId") String deviceId, /** * Delete a resource in sequence * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method - * @param path path of the page no need to delete + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method + * @param name name of the page no need to delete */ @Path("/remove-resource") @POST - @Feature(code = "remove-resource", name = "Remove Resource", type="operation", + @Feature(code = "remove-resource", name = "Remove Resource", type = "operation", description = "Delete a resource from sequence in Digital Display") public void removeResource(@HeaderParam("deviceId") String deviceId, @HeaderParam("owner") String owner, - @FormParam("path") String path, - @HeaderParam("sessionId") String sessionId, + @FormParam("name") String name, + @HeaderParam("Authorization") String token, @Context HttpServletResponse response) { try { - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + - DigitalDisplayConstants.REMOVE_RESOURCE_CONSTANT + ":", path); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + + DigitalDisplayConstants.REMOVE_RESOURCE_CONSTANT + "::", name); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -318,31 +323,28 @@ public void removeResource(@HeaderParam("deviceId") String deviceId, log.error(e); response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); } - } /** - * Remove directory and whole content + * Restart HTTP in running display * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method - * @param directoryName path of the folder need to delete + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method */ - @Path("/remove-directory") + @Path("/restart-server") @POST - @Feature(code = "remove-directory", name = "Remove Directory", type="operation", - description = "Remove directory and whole content in Digital Display") - public void removeDirectory(@FormParam("directory-name") String directoryName, - @HeaderParam("deviceId") String deviceId, - @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, - @Context HttpServletResponse response) { + @Feature(code = "restart-server", name = "Restart Server", type = "operation", + description = "Stop HTTP Server running in Digital Display") + public void restartServer(@HeaderParam("deviceId") String deviceId, + @HeaderParam("owner") String owner, + @HeaderParam("Authorization") String token, + @Context HttpServletResponse response) { try { - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + - DigitalDisplayConstants.REMOVE_DIRECTORY_CONSTANT + ":", directoryName); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.RESTART_SERVER_CONSTANT + "::", ""); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -355,29 +357,25 @@ public void removeDirectory(@FormParam("directory-name") String directoryName, } /** - * Remove content from www folder + * Get screenshot of running display * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param directoryName path of directory of request file contain - * @param content file name of need to delete - * @param response response type of the method + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method */ - @Path("/remove-content") + @Path("/screenshot") @POST - @Feature(code = "remove-content", name = "Remove Content", type="operation", - description = "Remove content from www folder in Digital Display") - public void removeContent(@FormParam("directory-name") String directoryName, - @FormParam("content") String content, - @HeaderParam("deviceId") String deviceId, - @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, - @Context HttpServletResponse response) { + @Feature(code = "screenshot", name = "Take Screenshot", type = "operation", + description = "Show current view in Digital Display") + public void showScreenshot(@HeaderParam("deviceId") String deviceId, + @HeaderParam("owner") String owner, + @HeaderParam("Authorization") String token, + @Context HttpServletResponse response) { try { - String param = directoryName + "|" + content; - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + DigitalDisplayConstants.REMOVE_CONTENT_CONSTANT + ":", param); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.SCREENSHOT_CONSTANT + "::", ""); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -386,28 +384,29 @@ public void removeContent(@FormParam("directory-name") String directoryName, log.error(e); response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); } - } /** - * Stop specific display + * Get statistics of running display * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method */ - @Path("/shutdown-display") + @Path("/get-device-status") @POST - @Feature(code = "shutdown-display", name = "Shut Down", type="operation", - description = "Stop specific display in Digital Display") - public void shutDownDisplay(@HeaderParam("deviceId") String deviceId, + @Feature(code = "get-device-status", name = "Get Device Status", type = "operation", + description = "Current status in Digital Display") + public void getDevicestatus(@HeaderParam("deviceId") String deviceId, @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, + @HeaderParam("Authorization") String token, @Context HttpServletResponse response) { try { - sendCommandViaMQTT(owner, deviceId, sessionId + "::" + DigitalDisplayConstants.SHUTDOWN_DISPLAY_CONSTANT + ":", ""); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.GET_DEVICE_STATUS_CONSTANT + + "::", ""); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -416,28 +415,28 @@ public void shutDownDisplay(@HeaderParam("deviceId") String deviceId, log.error(e); response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); } - } /** - * Check specific digital display power ON of OFF + * Stop specific display * - * @param deviceId id of the controlling digital display - * @param owner owner of the digital display - * @param sessionId web socket id of the method invoke client - * @param response response type of the method + * @param deviceId id of the controlling digital display + * @param owner owner of the digital display + * @param token web socket id of the method invoke client + * @param response response type of the method */ - @Path("/get-status") + @Path("/get-content-list") @POST - @Feature(code = "get-status", name = "Get Status", type="operation", - description = "Check specific digital display power ON or OFF") - public void getStatus(@HeaderParam("deviceId") String deviceId, - @HeaderParam("owner") String owner, - @HeaderParam("sessionId") String sessionId, - @Context HttpServletResponse response) { + @Feature(code = "get-content-list", name = "Get Content List", type = "operation", + description = "Content List in Digital Display") + public void getResources(@HeaderParam("deviceId") String deviceId, + @HeaderParam("owner") String owner, + @HeaderParam("Authorization") String token, + @Context HttpServletResponse response) { try { - sendCommandViaMQTT(owner, deviceId, sessionId + ":" + DigitalDisplayConstants.GET_STATUS_CONSTANT, ""); + token = token.split(" ")[1]; + sendCommandViaMQTT(owner, deviceId, token + "::" + DigitalDisplayConstants.GET_CONTENTLIST_CONSTANT + "::", ""); response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); @@ -446,7 +445,6 @@ public void getStatus(@HeaderParam("deviceId") String deviceId, log.error(e); response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); } - } /** @@ -463,9 +461,8 @@ private void sendCommandViaMQTT(String deviceOwner, String deviceId, String oper String param) throws DeviceManagementException, DigitalDisplayException { - log.info(deviceOwner); String topic = String.format(DigitalDisplayConstants.PUBLISH_TOPIC, deviceOwner, deviceId); - String payload = operation + ":" + param; + String payload = operation + param; try { digitalDisplayMQTTConnector.publishToDigitalDisplay(topic, payload, 2, false); diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/model/ScreenShotModel.java b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/model/ScreenShotModel.java new file mode 100644 index 000000000..9360110be --- /dev/null +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/model/ScreenShotModel.java @@ -0,0 +1,33 @@ +package org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api.model; + +public class ScreenShotModel { + + private String[] scrrenShotData; + private int length; + + public ScreenShotModel(){ + + } + + public ScreenShotModel(String[] scrrenShotData , int length){ + this.scrrenShotData = scrrenShotData; + this.length = length; + } + + public void setScrrenShotData(String[] scrrenShotData){ + this.scrrenShotData = scrrenShotData; + } + + public void setLength(int length){ + this.length = length; + } + + public String[] getScrrenShotData(){ + return this.scrrenShotData; + } + + public int getLength(){ + return this.length; + } + +} diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/util/DigitalDisplayMQTTConnector.java b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/util/DigitalDisplayMQTTConnector.java index dbc8419f2..a3f1ead4f 100644 --- a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/util/DigitalDisplayMQTTConnector.java +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/util/DigitalDisplayMQTTConnector.java @@ -4,14 +4,19 @@ import org.apache.commons.logging.LogFactory; import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttMessage; +import org.json.JSONObject; import org.wso2.carbon.device.mgt.iot.controlqueue.mqtt.MqttConfig; +import org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api.model.ScreenShotModel; import org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api.websocket.DigitalDisplayWebSocketServerEndPoint; import org.wso2.carbon.device.mgt.iot.digitaldisplay.plugin.constants.DigitalDisplayConstants; import org.wso2.carbon.device.mgt.iot.transport.TransportHandlerException; import org.wso2.carbon.device.mgt.iot.transport.mqtt.MQTTTransportHandler; import java.io.File; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; +import java.util.concurrent.ScheduledFuture; @SuppressWarnings("no JAX-WS annotation") public class DigitalDisplayMQTTConnector extends MQTTTransportHandler { @@ -25,9 +30,13 @@ public class DigitalDisplayMQTTConnector extends MQTTTransportHandler { private static String iotServerSubscriber = UUID.randomUUID().toString().substring(0, 5); + private ScheduledFuture dataPushServiceHandler; + + private Map screenshots = new HashMap<>(); + private DigitalDisplayMQTTConnector() { super(iotServerSubscriber, DigitalDisplayConstants.DEVICE_TYPE, - MqttConfig.getInstance().getMqttQueueEndpoint(), subscribeTopic); + MqttConfig.getInstance().getMqttQueueEndpoint(), subscribeTopic); } @Override @@ -65,36 +74,62 @@ public void run() { @Override public void processIncomingMessage(MqttMessage message, String... messageParams) { - if(messageParams.length != 0) { - String topic = messageParams[0]; - String ownerAndId = topic.replace("wso2" + File.separator + "iot" + File.separator, ""); - ownerAndId = ownerAndId.replace(File.separator + DigitalDisplayConstants.DEVICE_TYPE + File.separator, ":"); - ownerAndId = ownerAndId.replace(File.separator + "digital_display_publisher", ""); - - String owner = ownerAndId.split(":")[0]; - String deviceId = ownerAndId.split(":")[1]; - String[] messageData = message.toString().split(":"); - - if (log.isDebugEnabled()) { - log.debug("Received MQTT message for: [OWNER-" + owner + "] & [DEVICE.ID-" + deviceId + "]"); - } + String topic = messageParams[0]; + String ownerAndId = topic.replace("wso2" + File.separator + "iot" + File.separator, ""); + ownerAndId = ownerAndId.replace(File.separator + DigitalDisplayConstants.DEVICE_TYPE + File.separator, ":"); + ownerAndId = ownerAndId.replace(File.separator + "digital_display_publisher", ""); - if (messageData.length == 3) { - String randomId = messageData[0]; - String requestMessage = messageData[1]; - String result = messageData[2]; + String owner = ownerAndId.split(":")[0]; + String deviceId = ownerAndId.split(":")[1]; - if (log.isDebugEnabled()) { - log.debug("Return result " + result + " for Request " + requestMessage); + String[] messageData = message.toString().split("::"); + if (log.isDebugEnabled()) { + log.debug("Received MQTT message for: [OWNER-" + owner + "] & [DEVICE.ID-" + deviceId + "]"); + } + + String token = messageData[0]; + if (messageData.length == 2) { + String responseMessage = messageData[1]; + DigitalDisplayWebSocketServerEndPoint.sendMessage(token, new StringBuilder(responseMessage)); + } else if (messageData.length == 3) { + String response = messageData[2]; + JSONObject schreenshot = new JSONObject(response); + String pic_id = schreenshot.getString("pic_id"); + String data = schreenshot.getString("data"); + int pos = schreenshot.getInt("pos"); + int length = schreenshot.getInt("size"); + createScreenShot(token, pic_id, pos, length, data); + } + } + + private void createScreenShot(String token, String pic_id, int pos, int length, String data) { + + ScreenShotModel screenShotModel = screenshots.get(pic_id); + + if (screenShotModel == null) { + screenShotModel = new ScreenShotModel(); + screenShotModel.setScrrenShotData(new String[length + 1]); + screenShotModel.setLength(0); + screenshots.put(pic_id, screenShotModel); + } + if (screenShotModel.getLength() <= length) { + screenShotModel.getScrrenShotData()[pos] = data; + System.out.println(screenShotModel.getLength()); + screenShotModel.setLength(screenShotModel.getLength() + 1); + if (screenShotModel.getLength() == (length + 1)) { + StringBuilder displayScreenShot = new StringBuilder("Screenshot||"); + for (String screenshot : screenShotModel.getScrrenShotData()) { + displayScreenShot.append(screenshot); } - DigitalDisplayWebSocketServerEndPoint.sendMessage(randomId, result); + screenshots.remove(pic_id); + DigitalDisplayWebSocketServerEndPoint.sendMessage(token, displayScreenShot); } } } public void publishToDigitalDisplay(String topic, String payLoad, int qos, boolean retained) throws TransportHandlerException { - if(log.isDebugEnabled()){ + if (log.isDebugEnabled()) { log.debug("Publishing message [" + payLoad + "to topic [" + topic + "]."); } publishToQueue(topic, payLoad, qos, retained); diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/websocket/DigitalDisplayWebSocketServerEndPoint.java b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/websocket/DigitalDisplayWebSocketServerEndPoint.java index 646a14862..34521ea31 100644 --- a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/websocket/DigitalDisplayWebSocketServerEndPoint.java +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.controller.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/controller/api/websocket/DigitalDisplayWebSocketServerEndPoint.java @@ -4,23 +4,18 @@ import org.apache.commons.logging.LogFactory; import javax.inject.Singleton; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnOpen; -import javax.websocket.Session; +import javax.websocket.*; +import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import java.util.HashMap; import java.util.Map; -import java.util.UUID; - -@ServerEndpoint(value = "/digital-display-server-end-point") +@ServerEndpoint(value = "/{token}") @Singleton public class DigitalDisplayWebSocketServerEndPoint { private static Log log = LogFactory.getLog(DigitalDisplayWebSocketServerEndPoint.class); - - private static Map clientSessions = new HashMap<>(); + private static Map clientSessions = new HashMap<>(); /** * This method will be invoked when a client requests for a @@ -29,12 +24,8 @@ public class DigitalDisplayWebSocketServerEndPoint { * @param userSession the userSession which is opened. */ @OnOpen - public void onOpen(Session userSession){ - UUID uuid = UUID.randomUUID(); - log.info("Generated Random Id " + uuid.toString()); - log.info(" Connected with Session Id : " + userSession.getId()); - clientSessions.put(uuid.toString() , userSession); - userSession.getAsyncRemote().sendText("RandomID:" + uuid.toString()); + public void onOpen(Session userSession, @PathParam("token") String token) { + clientSessions.put(token, userSession); } /** @@ -44,29 +35,28 @@ public void onOpen(Session userSession){ * @param userSession the userSession which is opened. */ @OnClose - public void onClose(Session userSession){ - log.info("Client disconnected - Session Id : " + userSession.getId()); + public void onClose(Session userSession) { clientSessions.values().remove(userSession); } @OnError - public void onError(Throwable t){ - log.error("Error occurred " + t ); + public void onError(Throwable t) { + log.error("Error occurred " + t); } /** * This method will be invoked when a message received from device * to send client. * - * @param randomId the client of message to be sent. + * @param token the client of message to be sent. * @param message the message sent by device to client */ - public static void sendMessage(String randomId , String message){ - if(clientSessions.keySet().contains(randomId)){ - clientSessions.get(randomId).getAsyncRemote().sendText(message); - log.info("Message : " + message + " send to Session Id : " + randomId); - }else { + public static void sendMessage(String token, StringBuilder message) { + Session session = clientSessions.get(token); + if (session != null) { + session.getAsyncRemote().sendText(message.toString()); + } else { log.error("Client already disconnected."); } } diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/plugin/constants/DigitalDisplayConstants.java b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/plugin/constants/DigitalDisplayConstants.java index d72ad7882..6429495c2 100644 --- a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/plugin/constants/DigitalDisplayConstants.java +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/plugin/constants/DigitalDisplayConstants.java @@ -21,17 +21,17 @@ public class DigitalDisplayConstants { public final static String DEVICE_TYPE = "digital_display"; public final static String DEVICE_PLUGIN_DEVICE_NAME = "DEVICE_NAME"; public final static String DEVICE_PLUGIN_DEVICE_ID = "DIGITAL_DISPLAY_DEVICE_ID"; - public final static String SHUTDOWN_DISPLAY_CONSTANT = "shutdown_display"; + public final static String RESTART_SERVER_CONSTANT = "restart_server"; public final static String RESTART_DISPLAY_CONSTANT = "restart_display"; - public final static String REMOVE_DIRECTORY_CONSTANT = "remove_dir_and_content"; - public final static String REMOVE_CONTENT_CONSTANT = "remove_content"; - public final static String CLOSE_BROWSER_CONSTANT = "close_browser"; public final static String RESTART_BROWSER_CONSTANT = "restart_browser"; public final static String TERMINATE_DISPLAY_CONSTANT = "terminate_display"; - public final static String EDIT_SEQUENCE_CONSTANT = "edit_content_config"; + public final static String EDIT_SEQUENCE_CONSTANT = "edit_sequence"; + public final static String UPLOAD_CONTENT_CONSTANT = "upload_content"; public final static String ADD_NEW_RESOURCE_CONSTANT = "add_new_resource"; public final static String REMOVE_RESOURCE_CONSTANT = "remove_resources"; - public final static String GET_STATUS_CONSTANT = "get_status"; + public final static String SCREENSHOT_CONSTANT = "get_screenshot"; + public final static String GET_CONTENTLIST_CONSTANT = "get_content_list"; + public final static String GET_DEVICE_STATUS_CONSTANT = "get_device_status"; public final static String PUBLISH_TOPIC = "wso2/iot/%s/digital_display/%s/digital_display_subscriber"; } diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/DigitalDisplay.zip b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/DigitalDisplay.zip index 82019510b..72dae1f2b 100644 Binary files a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/DigitalDisplay.zip and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/DigitalDisplay.zip differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/ReadMe.md b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/ReadMe.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/installPackages b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/installPackages index e28e5cfac..c5572b442 100755 --- a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/installPackages +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/installPackages @@ -9,6 +9,8 @@ for P in paho-mqtt lxml; do } done +unzip DigitalDisplay +cp ./deviceConfig.properties ./DigitalDisplay diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/wso2Agent b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/wso2Agent index 352f53d51..bad47d0e6 100755 --- a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/wso2Agent +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/agent/wso2Agent @@ -4,8 +4,6 @@ ps aux|grep httpserver.py|awk '{print $2}'|xargs kill -9 #xdotool mousemove 0 0 #xdotool search -name LXTerminal windowunmap #cd ~/ -unzip DigitalDisplay -cp ./deviceConfig.properties ./DigitalDisplay cd ./DigitalDisplay/ mkdir -p tmp/dd-kernel-test python displayagent.py diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs index 5f582f5da..a2a4fb965 100644 --- a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs @@ -10,6 +10,11 @@ {{/zone}} +{{#zone "operation-status"}} + +{{/zone}} + {{#zone "device-opetations"}}
Operations @@ -20,6 +25,7 @@ {{/zone}} {{#zone "device-detail-properties"}} +
    @@ -31,26 +37,56 @@
-
-
-
Policies
-
- -
-
- No policies found +
+
+ Display Status +
+
+
+
Display View
+ + + +
+
+
Content List
+
    +
    +
    +
    Device Statics
    +
      +
      +
      +
      + +
      +
      +
      Policy Compliance
      +
      +
      Policies
      +
      + +
      +
      + No policies found +
      +
      -
      -{{/zone}} \ No newline at end of file +{{/zone}} + +{{#zone "bottomJs"}} + + {{js "js/websocket.js"}} +{{/zone}} diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.js b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.js index a102cd742..7c8a04e54 100644 --- a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.js +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.js @@ -17,9 +17,20 @@ */ function onRequest(context) { - var log = new Log("detail.js"); + + var log = new Log("device-view.js"); var deviceType = context.uriParams.deviceType; var deviceId = request.getParameter("id"); + var owner = context.user.username; + + var TokenClient = Packages.org.wso2.carbon.device.mgt.iot.apimgt.TokenClient; + var accessTokenClient = new TokenClient(deviceType); + var accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId); + var accessToken = accessTokenInfo.getAccess_token(); + + var getProperty = require("process").getProperty; + var port = getProperty("carbon.https.port"); + var host = getProperty("carbon.local.ip"); if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { var deviceModule = require("/app/modules/device.js").deviceModule; @@ -27,7 +38,7 @@ function onRequest(context) { if (device && device.status != "error") { log.info(device); - return {"device": device}; + return {"device": device, "token" : accessToken , "port" : port, "host" : host}; } } } \ No newline at end of file diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/public/images/default-screen.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/public/images/default-screen.png new file mode 100644 index 000000000..df11c247a Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/public/images/default-screen.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/public/js/websocket.js b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/public/js/websocket.js new file mode 100644 index 000000000..846f2d7ab --- /dev/null +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/public/js/websocket.js @@ -0,0 +1,64 @@ +var displayClient = null; + +window.onload = function () { + connect(); +}; + +window.onbeforeunload = function () { + disconnect(); +} + +function connect() { + + displayClient = new WebSocket("wss://" + host + ":" + port + "/digital_display/" + token); + + displayClient.onmessage = function (event) { + var message = event.data; + var operationDiv = document.getElementById("div-operation-status"); + var type = message.split('||')[0]; + var reply = message.split('||')[1]; + + if (type.valueOf() == new String("Screenshot").valueOf()) { + document.getElementById('img').setAttribute('src', 'data:image/png;base64,' + reply); + document.getElementById('zoom-image').setAttribute('href', 'data:image/png;base64,' + reply); + } else if (type.valueOf() == new String("Success").valueOf()) { + $('#div-operation-status').removeClass('hidden'); + $('#div-operation-status').text(reply); + operationDiv.style.backgroundColor = '#DFF2BF'; + operationDiv.style.color = '#4F8A10'; + } else if (type.valueOf() == new String("Failed").valueOf()) { + $('#div-operation-status').removeClass('hidden'); + $('#div-operation-status').text(reply); + operationDiv.style.backgroundColor = '#FFBABA'; + operationDiv.style.color = '#D8000C'; + } else if (type.valueOf() == new String("ContentList").valueOf()) { + var resources = reply.split("-"); + var ul = document.getElementById("content-list"); + ul.innerHTML = ""; + for (i = 0; i < resources.length; i++) { + var li = document.createElement("li"); + li.appendChild(document.createTextNode(resources[i])); + ul.appendChild(li); + } + } else if (type.valueOf() == new String("DeviceStatus").valueOf()) { + var resources = reply.split("-"); + var ul = document.getElementById("device-statics"); + ul.innerHTML = ""; + for (i = 0; i < resources.length; i++) { + var li = document.createElement("li"); + li.appendChild(document.createTextNode(resources[i])); + ul.appendChild(li); + } + } + + setTimeout(function () { + $('#div-operation-status').addClass('hidden'); + }, 10000); + + }; + +} + +function disconnect() { + displayClient.close(); +} diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/add-resource.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/add-resource.png new file mode 100644 index 000000000..d00ee206b Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/add-resource.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/edit-sequence.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/edit-sequence.png new file mode 100644 index 000000000..a194713b5 Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/edit-sequence.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/get-content-list.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/get-content-list.png new file mode 100644 index 000000000..ebda77927 Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/get-content-list.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/get-device-status.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/get-device-status.png new file mode 100644 index 000000000..caf3f39ef Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/get-device-status.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/remove-resource.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/remove-resource.png new file mode 100644 index 000000000..fc36e8828 Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/remove-resource.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-browser.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-browser.png new file mode 100644 index 000000000..cbf28a173 Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-browser.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-display.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-display.png index cf95377b7..ab98a02fe 100644 Binary files a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-display.png and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-display.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-server.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-server.png new file mode 100644 index 000000000..eb947a87f Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/restart-server.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/screenshot.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/screenshot.png new file mode 100644 index 000000000..8a5bca3d1 Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/screenshot.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/shutdown-display.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/shutdown-display.png deleted file mode 100644 index 806c39f5b..000000000 Binary files a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/shutdown-display.png and /dev/null differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/terminate-display.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/terminate-display.png new file mode 100755 index 000000000..9919cfbb5 Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/terminate-display.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/upload-content.png b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/upload-content.png new file mode 100644 index 000000000..c93072691 Binary files /dev/null and b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/public/images/operations/upload-content.png differ diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs index 5174fea69..522130410 100644 --- a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs @@ -187,7 +187,8 @@
    • 04   Unzip downloaded agent.
    • -
    • 05   Start Agent by running wso2Agent.sh +
    • 05   Start Agent by running + installpackages.sh followed by wso2Agent.sh