Committing the changes for the android persisted goe alert.
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
~
|
||||
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||
~ Version 2.0 (the "License"); you may not use this file except
|
||||
~ in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<parent>
|
||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||
<artifactId>iot-analytics</artifactId>
|
||||
<version>3.0.3-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>org.wso2.carbon.iot.das.rest.api</artifactId>
|
||||
<name>WSO2 Carbon - IoT Server REST API</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-scr-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-scr-descriptor</id>
|
||||
<goals>
|
||||
<goal>scr</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
|
||||
<Bundle-Name>${project.artifactId}</Bundle-Name>
|
||||
<Private-Package>
|
||||
</Private-Package>
|
||||
<Export-Package>
|
||||
</Export-Package>
|
||||
<Import-Package>
|
||||
</Import-Package>
|
||||
<DynamicImport-Package>*</DynamicImport-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,42 @@
|
||||
<%
|
||||
/**
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
(function () {
|
||||
|
||||
response.contentType = 'application/json';
|
||||
var action = request.getParameter("action");
|
||||
var id = request.getParameter("id");
|
||||
var type = request.getParameter("type");
|
||||
var timeFrom = request.getParameter("timeFrom");
|
||||
var timeTo = request.getParameter("timeTo");
|
||||
var log = new Log();
|
||||
|
||||
var providerAPI = require('js/batch-provider-api.js');
|
||||
if (action === 'getSchema') {
|
||||
print(providerAPI.getSchema());
|
||||
return;
|
||||
} else if(action === 'getData'){
|
||||
log.info('FromTime : '+timeFrom+', toTime: '+ timeTo);
|
||||
print(providerAPI.getData(id, type, timeFrom, timeTo));
|
||||
return;
|
||||
}
|
||||
}());
|
||||
|
||||
|
||||
%>
|
||||
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var getConfig, validate, getMode, getSchema, getData, registerCallBackforPush;
|
||||
|
||||
(function () {
|
||||
|
||||
var PROVIDERS_LOCATION = '/extensions/providers/';
|
||||
|
||||
var PROVIDER_NAME = 'batch';
|
||||
var TYPE = "type";
|
||||
var TABLE_NAME = "tableName";
|
||||
var HTTPS_TRANSPORT = "https";
|
||||
var CONTENT_TYPE_JSON = "application/json";
|
||||
var AUTHORIZATION_HEADER = "Authorization";
|
||||
var USER_TOKEN = "user";
|
||||
var TENANT_DOMAIN = "domain";
|
||||
var CONST_AT = "@";
|
||||
var USERNAME = "username";
|
||||
var HTTP_USER_NOT_AUTHENTICATED = 403;
|
||||
var JS_MAX_VALUE = "9007199254740992";
|
||||
var JS_MIN_VALUE = "-9007199254740992";
|
||||
|
||||
var tableName = "ORG_WSO2_GEO_FUSEDSPATIALEVENT";
|
||||
|
||||
var typeMap = {
|
||||
"bool": "string",
|
||||
"boolean": "string",
|
||||
"string": "string",
|
||||
"int": "number",
|
||||
"integer": "number",
|
||||
"long": "number",
|
||||
"double": "number",
|
||||
"float": "number",
|
||||
"time": "time"
|
||||
};
|
||||
|
||||
var log = new Log();
|
||||
var carbon = require('carbon');
|
||||
var configs = require('/configs/designer.json');
|
||||
var utils = require('/modules/utils.js');
|
||||
var JSUtils = Packages.org.wso2.carbon.analytics.jsservice.Utils;
|
||||
var AnalyticsCachedJSServiceConnector = Packages.org.wso2.carbon.analytics.jsservice.AnalyticsCachedJSServiceConnector;
|
||||
var AnalyticsCache = Packages.org.wso2.carbon.analytics.jsservice.AnalyticsCachedJSServiceConnector.AnalyticsCache;
|
||||
var cacheTimeoutSeconds = 5;
|
||||
var loggedInUser = null;
|
||||
|
||||
if (configs.cacheTimeoutSeconds) {
|
||||
cacheTimeoutSeconds = parseInt(configs.cacheTimeoutSeconds);
|
||||
}
|
||||
var cacheSizeBytes = 1024 * 1024 * 1024; // 1GB
|
||||
if (configs.cacheSizeBytes) {
|
||||
cacheSizeBytes = parseInt(configs.cacheSizeBytes);
|
||||
}
|
||||
response.contentType = CONTENT_TYPE_JSON;
|
||||
|
||||
var authParam = request.getHeader(AUTHORIZATION_HEADER);
|
||||
if (authParam != null) {
|
||||
credentials = JSUtils.authenticate(authParam);
|
||||
loggedInUser = credentials[0];
|
||||
} else {
|
||||
var token = session.get(USER_TOKEN);
|
||||
if (token != null) {
|
||||
loggedInUser = token[USERNAME] + CONST_AT + token[TENANT_DOMAIN];
|
||||
} else {
|
||||
log.error("user is not authenticated!");
|
||||
response.status = HTTP_USER_NOT_AUTHENTICATED;
|
||||
print('{ "status": "Failed", "message": "User is not authenticated." }');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var cache = application.get("AnalyticsWebServiceCache");
|
||||
if (cache == null) {
|
||||
cache = new AnalyticsCache(cacheTimeoutSeconds, cacheSizeBytes);
|
||||
application.put("AnalyticsWebServiceCache", cache);
|
||||
}
|
||||
var connector = new AnalyticsCachedJSServiceConnector(cache);
|
||||
|
||||
|
||||
/**
|
||||
* returns an array of column names & types
|
||||
* @param providerConfig
|
||||
*/
|
||||
getSchema = function () {
|
||||
var schema = [];
|
||||
var result = connector.getTableSchema(loggedInUser, tableName).getMessage();
|
||||
result = JSON.parse(result);
|
||||
|
||||
var columns = result.columns;
|
||||
Object.getOwnPropertyNames(columns).forEach(function (name, idx, array) {
|
||||
var type = "ordinal";
|
||||
if (columns[name]['type']) {
|
||||
type = columns[name]['type'];
|
||||
}
|
||||
schema.push({
|
||||
fieldName: name,
|
||||
fieldType: typeMap[type.toLowerCase()]
|
||||
});
|
||||
});
|
||||
// log.info(schema);
|
||||
return schema;
|
||||
};
|
||||
|
||||
/**
|
||||
* returns the actual data
|
||||
* @param providerConfig
|
||||
* @param limit
|
||||
*/
|
||||
getData = function (deviceId, deviceType, fromTime, toTime) {
|
||||
var luceneQuery = "timeStamp:[" + fromTime + " TO " + toTime + "]";
|
||||
var limit = 100;
|
||||
var result;
|
||||
//if there's a filter present, we should perform a Lucene search instead of reading the table
|
||||
if (luceneQuery) {
|
||||
luceneQuery = 'id:"' + deviceId + '" AND type:"' + deviceType + '" AND ' + luceneQuery;
|
||||
var filter = {
|
||||
"query": luceneQuery,
|
||||
"start": 0,
|
||||
"count": limit
|
||||
};
|
||||
result = connector.search(loggedInUser, tableName, stringify(filter)).getMessage();
|
||||
} else {
|
||||
var from = JS_MIN_VALUE;
|
||||
var to = JS_MAX_VALUE;
|
||||
result = connector.getRecordsByRange(loggedInUser, tableName, from, to, 0, limit, null).getMessage();
|
||||
|
||||
}
|
||||
result = JSON.parse(result);
|
||||
var data = [];
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var values = result[i].values;
|
||||
data.push(values);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
}());
|
||||
|
After Width: | Height: | Size: 86 B |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 90 B |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,27 @@
|
||||
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
|
||||
.ui-timepicker-div dl { text-align: left; }
|
||||
.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
|
||||
.ui-timepicker-div dl dd { margin: 0 10px 10px 40%; }
|
||||
.ui-timepicker-div td { font-size: 90%; }
|
||||
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
|
||||
.ui-timepicker-div .ui_tpicker_unit_hide{ display: none; }
|
||||
|
||||
.ui-timepicker-rtl{ direction: rtl; }
|
||||
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
|
||||
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
|
||||
.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; }
|
||||
|
||||
/* Shortened version style */
|
||||
.ui-timepicker-div.ui-timepicker-oneLine { padding-right: 2px; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dt { display: none; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label { display: block; padding-top: 2px; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl { text-align: right; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd > div { display:inline-block; margin:0; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before { content:':'; display:inline-block; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before { content:'.'; display:inline-block; }
|
||||
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,
|
||||
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{ display: none; }
|
||||
@ -0,0 +1,5 @@
|
||||
/*! jQuery Timepicker Addon - v1.5.3 - 2015-04-19
|
||||
* http://trentrichardson.com/examples/timepicker
|
||||
* Copyright (c) 2015 Trent Richardson; Licensed MIT */
|
||||
|
||||
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
|
||||
@ -79,3 +79,9 @@
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,.5);
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-title {
|
||||
word-break: keep-all !important;
|
||||
word-wrap: normal !important;
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*html, body {*/
|
||||
/*height: 100%;*/
|
||||
/*height: 100%;*/
|
||||
/*}*/
|
||||
|
||||
#map {
|
||||
@ -31,4 +31,4 @@
|
||||
|
||||
.leaflet-control-attribution.leaflet-control {
|
||||
font-size: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +102,6 @@
|
||||
<!-- Self javascript libraries (Order of the import is very important, changing the order might shadow some variables, append new script to bottom ) -->
|
||||
<!-- ** comment out below imports if using minimized wso2_geo.min library ** -->
|
||||
<script src="js/application_options.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function reformatRadius(val){
|
||||
if(val != "" && !isNaN(val)){
|
||||
@ -136,6 +135,11 @@
|
||||
|
||||
|
||||
<div class="navbar-collapse collapse" style="display:inline-block;">
|
||||
<ul class="nav">
|
||||
<li>
|
||||
<button id='realTimeShow' type="submit" class="btn btn-primary" style="display:none;" onclick='enableRealTime()'>Return to Real Time View</button>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav-left">
|
||||
<li class="hidden-xs"><a href="#left_side_pannel" data-uk-offcanvas>
|
||||
<i class="fa fa-list" style="color: #FF9900"></i></a>
|
||||
@ -718,7 +722,17 @@
|
||||
<p id="information" class="bg-primary" style="margin: 0px;padding: 0px;"></p>
|
||||
<h6>Speed<span class="label label-primary pull-right"><span id="speed"></span> km/h</span></h6>
|
||||
<h6>Heading<span id="heading" class="label label-primary pull-right"></span></h6>
|
||||
<button type="button" class="btn btn-info btn-xs" onClick="focusOnSpatialObject(document.getElementById('objectId').innerHTML);return false;">History</button>
|
||||
<button type="button" class="btn btn-info btn-xs" onClick="focusOnSpatialObject(document.getElementById('objectId').innerHTML);return false;">Recent History</button>
|
||||
<button type="button" class="btn btn-info btn-xs" onClick="popupDateRange();">Full History</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dateRangePopup">
|
||||
<!--<h3 class="popover-title">ID <span id="objectId"></span></h3>-->
|
||||
<div>
|
||||
<label> From: <input id="timeFrom" type="text"> </label>
|
||||
<label> To: <input id="timeTo" type="text"> </label>
|
||||
<button type="button" class="btn btn-info btn-xs" onClick="focusOnHistorySpatialObject(document.getElementById('objectId').innerHTML, document.getElementById('timeFrom').value, document.getElementById('timeTo').value);return false;">Full History</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ function initializeMap() {
|
||||
|
||||
map = L.map("map", {
|
||||
zoom: 14,
|
||||
center:[51.548525, 0.111749],
|
||||
center: [51.548525, 0.111749],
|
||||
layers: [defaultOSM, defaultTFL],
|
||||
zoomControl: false,
|
||||
attributionControl: false,
|
||||
@ -137,7 +137,7 @@ var attributionControl;
|
||||
var groupedOverlays;
|
||||
var layerControl;
|
||||
|
||||
function processAfterInitializationMap(){
|
||||
function processAfterInitializationMap() {
|
||||
attributionControl = L.control({
|
||||
position: "bottomright"
|
||||
});
|
||||
@ -259,11 +259,12 @@ $('#searchbox').typeahead({
|
||||
displayKey: 'value',
|
||||
source: substringMatcher()
|
||||
}).on('typeahead:selected', function ($e, datum) {
|
||||
objectId = datum['value'];
|
||||
focusOnSpatialObject(objectId)
|
||||
});
|
||||
objectId = datum['value'];
|
||||
focusOnSpatialObject(objectId)
|
||||
});
|
||||
|
||||
var toggled = false;
|
||||
|
||||
function focusOnSpatialObject(objectId) {
|
||||
console.log("Selecting" + objectId);
|
||||
var spatialObject = currentSpatialObjects[objectId];// (local)
|
||||
@ -302,6 +303,110 @@ function focusOnSpatialObject(objectId) {
|
||||
}
|
||||
|
||||
|
||||
var getProviderData = function (timeFrom, timeTo) {
|
||||
var tableData;
|
||||
$.ajax({
|
||||
url: '/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/gadget-controller.jag?action=getData&id=' + deviceId + '&type=' + deviceType + '&timeFrom=' + timeFrom + '&timeTo=' + timeTo,
|
||||
method: "GET",
|
||||
contentType: "application/json",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
tableData = data;
|
||||
}
|
||||
});
|
||||
return tableData;
|
||||
};
|
||||
|
||||
function notifyError(message) {
|
||||
$.UIkit.notify({
|
||||
message: message,
|
||||
status: 'warning',
|
||||
timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
|
||||
pos: 'bottom-left'
|
||||
});
|
||||
}
|
||||
|
||||
function enableRealTime() {
|
||||
document.getElementById('realTimeShow').style.display = 'none';
|
||||
spatialObject = currentSpatialObjects[selectedSpatialObject];
|
||||
spatialObject.removePath();
|
||||
spatialObject.marker.closePopup();
|
||||
selectedSpatialObject = null;
|
||||
clearFocus();
|
||||
clearMap();
|
||||
document.getElementById('objectInfo').style.display = 'none';
|
||||
isBatchModeOn = false;
|
||||
}
|
||||
function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
|
||||
if (!timeFrom) {
|
||||
notifyError('No start time provided to show history. Please provide a suitable value' + timeFrom);
|
||||
} else if (!timeTo) {
|
||||
notifyError('No end time provided to show history. Please provide a suitable value' + timeTo);
|
||||
} else {
|
||||
document.getElementById('realTimeShow').style.display = 'block';
|
||||
isBatchModeOn = true;
|
||||
clearFocus(); // Clear current focus if any
|
||||
clearMap();
|
||||
var tableData = getProviderData(timeFrom, timeTo);
|
||||
for (var i = 0; i < tableData.length; i++) {
|
||||
var data = tableData[i];
|
||||
var geoMessage = {
|
||||
"messageType": "Point",
|
||||
"type": "Feature",
|
||||
"id": data.id,
|
||||
"deviceId": data.id,
|
||||
"deviceType": data.type,
|
||||
"properties": {
|
||||
"speed": data.speed,
|
||||
"heading": data.heading,
|
||||
"state": data.state,
|
||||
"information": data.information,
|
||||
"notify": data.notify,
|
||||
"type": data.type
|
||||
},
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [data.longitude, data.latitude]
|
||||
}
|
||||
};
|
||||
processPointMessage(geoMessage);
|
||||
}
|
||||
var spatialObject = currentSpatialObjects[objectId];// (local)
|
||||
if (!spatialObject) {
|
||||
$.UIkit.notify({
|
||||
message: "Spatial Object <span style='color:red'>" + objectId + "</span> not in the Map!!",
|
||||
status: 'warning',
|
||||
timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
|
||||
pos: 'top-center'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
selectedSpatialObject = objectId; // (global) Why not use 'var' other than implicit declaration http://stackoverflow.com/questions/1470488/what-is-the-function-of-the-var-keyword-and-when-to-use-it-or-omit-it#answer-1471738
|
||||
|
||||
console.log("Selected " + objectId + " type " + spatialObject.type);
|
||||
if (spatialObject.type == "area") {
|
||||
spatialObject.focusOn(map);
|
||||
return true;
|
||||
}
|
||||
|
||||
map.setView(spatialObject.marker.getLatLng(), 15, {animate: true}); // TODO: check the map._layersMaxZoom and set the zoom level accordingly
|
||||
|
||||
$('#objectInfo').find('#objectInfoId').html(selectedSpatialObject);
|
||||
spatialObject.marker.openPopup();
|
||||
if (!toggled) {
|
||||
$('#objectInfo').animate({width: 'toggle'}, 100);
|
||||
toggled = true;
|
||||
}
|
||||
getAlertsHistory(objectId);
|
||||
spatialObject.drawPath();
|
||||
setTimeout(function () {
|
||||
createChart();
|
||||
chart.load({columns: [spatialObject.speedHistory.getArray()]});
|
||||
}, 100);
|
||||
$('#dateRangePopup').dialog('close');
|
||||
}
|
||||
}
|
||||
|
||||
// Unfocused on current searched spatial object
|
||||
function clearFocus() {
|
||||
if (selectedSpatialObject) {
|
||||
|
||||
@ -29,6 +29,7 @@ var waitTime = 1000;
|
||||
var webSocketURL, alertWebSocketURL, trafficStreamWebSocketURL;
|
||||
var deviceId;
|
||||
var deviceType;
|
||||
var isBatchModeOn = false;
|
||||
|
||||
function processPointMessage(geoJsonFeature) {
|
||||
if (geoJsonFeature.id in currentSpatialObjects) {
|
||||
@ -72,6 +73,10 @@ function SpatialObject(json) {
|
||||
return this;
|
||||
}
|
||||
|
||||
function popupDateRange(){
|
||||
$('#dateRangePopup').attr('title', 'Device ID - '+ deviceId +" Device Type - "+ deviceType).dialog();
|
||||
}
|
||||
|
||||
SpatialObject.prototype.update = function (geoJSON) {
|
||||
this.latitude = geoJSON.geometry.coordinates[1];
|
||||
this.longitude = geoJSON.geometry.coordinates[0];
|
||||
@ -163,6 +168,13 @@ SpatialObject.prototype.removeFromMap = function () {
|
||||
this.marker.closePopup();
|
||||
};
|
||||
|
||||
function clearMap() {
|
||||
for (var i=0; i< currentSpatialObjects.length; i++ ){
|
||||
console.log("removed - " + currentSpatialObjects[i]);
|
||||
currentSpatialObjects[i].removeFromMap();
|
||||
}
|
||||
}
|
||||
|
||||
SpatialObject.prototype.createLineStringFeature = function (state, information, coordinates) {
|
||||
return {
|
||||
"type": "Feature",
|
||||
@ -552,11 +564,13 @@ var webSocketOnAlertOpen = function () {
|
||||
};
|
||||
|
||||
var webSocketOnAlertMessage = function processMessage(message) {
|
||||
var json = $.parseJSON(message.data);
|
||||
if (json.messageType == "Alert") {
|
||||
processAlertMessage(json);
|
||||
} else {
|
||||
console.log("Message type not supported.");
|
||||
if (!isBatchModeOn) {
|
||||
var json = $.parseJSON(message.data);
|
||||
if (json.messageType == "Alert") {
|
||||
processAlertMessage(json);
|
||||
} else {
|
||||
console.log("Message type not supported.");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -594,18 +608,19 @@ var webSocketOnOpen = function () {
|
||||
};
|
||||
|
||||
var webSocketOnMessage = function (message) {
|
||||
var json = $.parseJSON(message.data);
|
||||
if (json.messageType == "Point") {
|
||||
processPointMessage(json);
|
||||
} else if (json.messageType == "Prediction") {
|
||||
//processPredictionMessage(json);
|
||||
} else {
|
||||
console.log("Message type not supported.");
|
||||
if(!isBatchModeOn) {
|
||||
var json = $.parseJSON(message.data);
|
||||
if (json.messageType == "Point") {
|
||||
processPointMessage(json);
|
||||
} else if (json.messageType == "Prediction") {
|
||||
//processPredictionMessage(json);
|
||||
} else {
|
||||
console.log("Message type not supported.");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var webSocketOnClose = function (e) {
|
||||
|
||||
if (websocket.get_opened()) {
|
||||
$.UIkit.notify({
|
||||
message: 'Connection lost with server!!',
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<artifact name="Geo-EventSink-FusedStream" version="1.0.0" type="analytics/eventstore" serverRole="GeoDashboard">
|
||||
<file>org_wso2_geo_FusedSpatialEvent.xml</file>
|
||||
</artifact>
|
||||
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<EventStoreConfiguration>
|
||||
<TableSchema>
|
||||
<ColumnDefinition>
|
||||
<Name>id</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>STRING</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>latitude</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>false</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>DOUBLE</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>longitude</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>false</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>DOUBLE</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>timeStamp</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>LONG</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>type</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>STRING</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>speed</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>false</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>FLOAT</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>heading</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>false</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>FLOAT</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>state</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>STRING</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>information</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>STRING</Type>
|
||||
</ColumnDefinition>
|
||||
<ColumnDefinition>
|
||||
<Name>notify</Name>
|
||||
<IsFacet>false</IsFacet>
|
||||
<EnableIndexing>true</EnableIndexing>
|
||||
<IsPrimaryKey>false</IsPrimaryKey>
|
||||
<EnableScoreParam>false</EnableScoreParam>
|
||||
<Type>BOOLEAN</Type>
|
||||
</ColumnDefinition>
|
||||
</TableSchema>
|
||||
<Source>
|
||||
<StreamId>org.wso2.geo.FusedSpatialEvent:1.0.0</StreamId>
|
||||
</Source>
|
||||
<MergeSchema>false</MergeSchema>
|
||||
<RecordStoreName>EVENT_STORE</RecordStoreName>
|
||||
</EventStoreConfiguration>
|
||||
@ -27,6 +27,7 @@
|
||||
<dependency artifact="ThemeGeoDashboard" version="1.0.0" include="true" serverRole="GeoDashboard"/>
|
||||
<!-- CEP Artifacts -->
|
||||
<dependency artifact="Geo-Dashboard-Http-Receiver" version="1.0.0" include="true" serverRole="GeoDashboard"/>
|
||||
<dependency artifact="Geo-EventSink-FusedStream" version="1.0.0" include="true" serverRole="GeoDashboard"/>
|
||||
<dependency artifact="Geo-ExecutionPlan-EventsFusionGenerateNotifications" version="1.0.0" include="true" serverRole="GeoDashboard"/>
|
||||
<dependency artifact="Geo-ExecutionPlan-InputStandardizer" version="1.0.0" include="true" serverRole="GeoDashboard"/>
|
||||
<dependency artifact="Geo-ExecutionPlan-Pass_through" version="1.0.0" include="true" serverRole="GeoDashboard"/>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
-->
|
||||
|
||||
<artifacts>
|
||||
<artifact name="android_analytics" version="1.0.0" type="carbon/application">
|
||||
<artifact name="androidsense" version="1.0.0" type="carbon/application">
|
||||
<dependency artifact="android_active_stack_chart_gadget" version="1.0.0" include="true"
|
||||
serverRole="DataAnalyticsServer"/>
|
||||
<dependency artifact="android_active_time_chart_gadget" version="1.0.0" include="true"
|
||||
|
||||