diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/conf/alerts/Geo-ExecutionPlan-Within_alert.siddhiql b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/conf/alerts/Geo-ExecutionPlan-Within_alert.siddhiql index 85e57604e..b58fd59e3 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/conf/alerts/Geo-ExecutionPlan-Within_alert.siddhiql +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/conf/alerts/Geo-ExecutionPlan-Within_alert.siddhiql @@ -12,9 +12,9 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp lo @Export('org.wso2.geo.ProcessedSpatialEvents:1.0.0') define stream dataOut (id string, latitude double, longitude double, timeStamp long, type string ,speed float, heading float, eventId string, state string, information string); -from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==true and id == $deviceId]#geodashboard:subscribe() +from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")==true and id == "$deviceId"]#geodashboard:subscribe() select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "ALERTED" as state, "This device is in $areaName restricted area!!!" as information insert into dataOut; -from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=true and id == $deviceId] +from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=true and id == "$deviceId"] select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information insert into dataOut; diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js index b96b4194e..b3b3ced6f 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js @@ -281,7 +281,8 @@ function setWithinAlert(leafletId) { 'parseData': JSON.stringify({ 'geoFenceGeoJSON': selectedAreaGeoJson, 'executionPlanName': createExecutionPlanName(queryName, "WithIn", deviceId), - 'areaName': areaName + 'areaName': areaName, + 'deviceId' : deviceId }), 'executionPlan': 'Within', 'customName': areaName, // TODO: fix , When template copies there can be two queryName and areaName id elements in the DOM diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/websocket.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/websocket.js index 4e6d77126..87e500eee 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/websocket.js +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/websocket.js @@ -677,13 +677,14 @@ function intializeWebsocketUrls() { .constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance .CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION - + "?token=ee9971c8-bf09-3c83-b097-ce87a0c88806&deviceId=" + deviceId + "&deviceType=" + deviceType; + + "?deviceId=" + deviceId + "&deviceType=" + deviceType; alertWebSocketURL = 'wss://' + data.ip + ':' + data.httpsPort + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance .CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions .constance.TENANT_INDEX + ApplicationOptions.constance.PATH_SEPARATOR + data.user.domain + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance .CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME + ApplicationOptions.constance.PATH_SEPARATOR + ApplicationOptions.constance.VERSION - + "?token=ee9971c8-bf09-3c83-b097-ce87a0c88806&deviceId=" + deviceId + "&deviceType=" + deviceType; + + "?deviceId=" + deviceId + "&deviceType=" + deviceType; + document.cookie = "websocket-token=f98d6142-e988-3c7f-a8c9-7e6d74da7113; path=/"; initializeWebSocket(); initializeOnAlertWebSocket(); }); @@ -705,7 +706,8 @@ intializeWebsocketUrls(); SpatialObject.prototype.stateIcon = function () { - var iconUrl = "/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/object-types/" + this.type.toLowerCase(); + //TODO : Need to add separate icons for each device type + var iconUrl = "/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/object-types/default_icons"; if (0 < this.speed && (-360 <= this.heading && 360 >= this.heading)) { iconUrl = iconUrl + "/moving/" + this.state.toLowerCase(); } else { diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql index 71a2ee953..7c232af0c 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-ExecutionPlan-EventsFusionGenerateNotifications_1.0.0/Geo-ExecutionPlan-EventsFusionGenerateNotifications-1.0.0.siddhiql @@ -12,7 +12,7 @@ define stream dataIn (id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, eventId string, state string, information string ); @Export('org.wso2.geo.AlertsNotifications:1.0.0') -define stream alertsOut ( id string, state string, information string, timeStamp long, latitude double, longitude double ); +define stream alertsOut ( id string, state string, information string, timeStamp long, latitude double, longitude double, type string); @Export('org.wso2.geo.FusedSpatialEvent:1.0.0') define stream dataOut ( id string, latitude double, longitude double, timeStamp long, type string, speed float, heading float, state string, information string, notify bool ); @@ -25,5 +25,5 @@ select id, latitude, longitude, timeStamp, type, speed, heading, state , informa insert into dataOut; from dataOut[notify == true] -select id,state,information,timeStamp, latitude, longitude +select id, state, information,timeStamp, latitude, longitude, type insert into alertsOut; \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-FusedSpacialEvent_1.0.0/Geo-Publisher-WebSocketLocal-FusedSpacialEvent-1.0.0.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-FusedSpacialEvent_1.0.0/Geo-Publisher-WebSocketLocal-FusedSpacialEvent-1.0.0.xml index f7f8f50ee..561ce7c05 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-FusedSpacialEvent_1.0.0/Geo-Publisher-WebSocketLocal-FusedSpacialEvent-1.0.0.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-FusedSpacialEvent_1.0.0/Geo-Publisher-WebSocketLocal-FusedSpacialEvent-1.0.0.xml @@ -7,8 +7,8 @@ "messageType" : "Point", "type": "Feature", "id": {{id}}, - "deviceId": "rkxb293yw2t2", - "deviceType": "virtual_firealarm", + "deviceId": {{id}}, + "deviceType": {{type}}, "properties": { "speed": {{speed}}, "heading": {{heading}}, diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-GeoAlertNotifications_1.0.0/Geo-Publisher-WebSocketLocal-GeoAlertNotifications-1.0.0.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-GeoAlertNotifications_1.0.0/Geo-Publisher-WebSocketLocal-GeoAlertNotifications-1.0.0.xml index 264069b11..a8a35ce1b 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-GeoAlertNotifications_1.0.0/Geo-Publisher-WebSocketLocal-GeoAlertNotifications-1.0.0.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-WebSocketLocal-GeoAlertNotifications_1.0.0/Geo-Publisher-WebSocketLocal-GeoAlertNotifications-1.0.0.xml @@ -8,8 +8,8 @@ "messageType" : "Alert", "type": "Feature", "id": {{id}}, - "deviceId": "rkxb293yw2t2", - "deviceType" : "virtual_firealarm", + "deviceId": {{id}}, + "deviceType" : "{{type}}", "state": {{state}}, "information": {{information}}, "longitude" : {{longitude}}, diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.AlertsNotifications_1.0.0/org.wso2.geo.AlertsNotifications-1.0.0.json b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.AlertsNotifications_1.0.0/org.wso2.geo.AlertsNotifications-1.0.0.json index 23853ed93..767f9d6d1 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.AlertsNotifications_1.0.0/org.wso2.geo.AlertsNotifications-1.0.0.json +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/org.wso2.geo.AlertsNotifications_1.0.0/org.wso2.geo.AlertsNotifications-1.0.0.json @@ -27,6 +27,10 @@ { "name": "longitude", "type": "DOUBLE" + }, + { + "name": "type", + "type": "STRING" } ] } \ No newline at end of file