From 1c61e1a68d9d2bb9446d2cd1285d8c0b0899543b Mon Sep 17 00:00:00 2001 From: lasantha Date: Tue, 20 Jun 2017 16:58:34 +0530 Subject: [PATCH] removed android activity chart gadget, android battery history chart gadget, android battery percentage chart gadget --- .../Android_Activity_Chart/conf.json | 15 - .../gadget-controller.jag | 42 --- .../Android_Activity_Chart/gadget.json | 9 - .../Android_Activity_Chart/gadget.xml | 56 ---- .../js/core/batch-provider-api.js | 190 ------------ .../js/core/donut-chart-api.js | 111 ------- .../js/core/gadget-core.js | 101 ------ .../js/core/gadget-util.js | 35 --- .../Android_Activity_Chart/thumbnail.png | Bin 15590 -> 0 bytes .../artifact.xml | 23 -- .../Android_Battery_History_Chart/conf.json | 19 -- .../gadget-controller.jag | 42 --- .../Android_Battery_History_Chart/gadget.json | 9 - .../Android_Battery_History_Chart/gadget.xml | 56 ---- .../js/core/area-chart-api.js | 135 -------- .../js/core/batch-provider-api.js | 190 ------------ .../js/core/gadget-core.js | 85 ------ .../js/core/gadget-util.js | 35 --- .../thumbnail.png | Bin 10532 -> 0 bytes .../artifact.xml | 23 -- .../conf.json | 13 - .../gadget-controller.jag | 42 --- .../gadget.json | 9 - .../gadget.xml | 60 ---- .../js/core/donut-chart-api.js | 115 ------- .../js/core/gadget-core.js | 69 ----- .../js/core/gadget-util.js | 35 --- .../js/core/provider-client.js | 51 ---- .../js/core/realtime-provider-api.js | 154 ---------- .../js/provider-libs/ws-client.js | 288 ------------------ .../thumbnail.png | Bin 15244 -> 0 bytes .../artifact.xml | 23 -- 32 files changed, 2035 deletions(-) delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/conf.json delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget-controller.jag delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.json delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.xml delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/batch-provider-api.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/donut-chart-api.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-core.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-util.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/thumbnail.png delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/artifact.xml delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/conf.json delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget-controller.jag delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.json delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.xml delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/area-chart-api.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/batch-provider-api.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-core.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-util.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/thumbnail.png delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/artifact.xml delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/conf.json delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget-controller.jag delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.json delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.xml delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/donut-chart-api.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-core.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-util.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/provider-client.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/realtime-provider-api.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/provider-libs/ws-client.js delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/thumbnail.png delete mode 100644 components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/artifact.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/conf.json b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/conf.json deleted file mode 100644 index 7c2e1c5891..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/conf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "chart-conf": { - "chart-name": "donut-chart", - "color": "action", - "gadget-name": "Android Activity Chart", - "maxLength": "30", - "x": "duration" - }, - "provider-conf": { - "limit": "", - "provider-name": "batch", - "query": "", - "tableName": "ANDROID_ACTIVITY_STAT_PER_DAY" - } -} \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget-controller.jag b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget-controller.jag deleted file mode 100644 index f84538a40a..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget-controller.jag +++ /dev/null @@ -1,42 +0,0 @@ -<% -/** - * 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 PROVIDER_CONF = 'provider-conf'; - var PROVIDER_NAME = 'provider-name'; - - var action = request.getParameter("action"); - var data = request.getContent(); - var providerConf = data[PROVIDER_CONF]; - var providerAPI = require('js/core/' + providerConf[PROVIDER_NAME] + '-provider-api.js'); - - if (action === 'getSchema') { - print(providerAPI.getSchema(providerConf)); - return; - } else if(action === 'getData'){ - print(providerAPI.getData(providerConf)); - return; - } - -}()); - - -%> diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.json b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.json deleted file mode 100644 index 76104a278e..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "Android_Activity_Chart", - "title": "Android Activity Chart", - "type": "gadget", - "thumbnail": "gadget/Android_Activity_Chart/thumbnail.png", - "data": { - "url": "gadget/Android_Activity_Chart/gadget.xml" - } -} diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.xml deleted file mode 100644 index 352af8b275..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/gadget.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - ]]> -
-
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/batch-provider-api.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/batch-provider-api.js deleted file mode 100644 index 30c96902a5..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/batch-provider-api.js +++ /dev/null @@ -1,190 +0,0 @@ -/* - * 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 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); - - /** - * require the existing config.json and push any dynamic fields that needs to be populated in the UI - */ - getConfig = function() { - var formConfig = require(PROVIDERS_LOCATION + '/' + PROVIDER_NAME + '/config.json'); - var tables; - try { - tables = JSON.parse(connector.getTableList(loggedInUser).getMessage()); - } catch (e) { - log.error(e); - } - var configs = formConfig.config; - configs.forEach(function(config) { - if (config.fieldName === TABLE_NAME) { - config.valueSet = tables; - } - }); - return formConfig; - } - - /** - * validate the user input of provider configuration - * @param providerConfig - */ - validate = function(providerConfig) { - /* - validate the form and return - - */ - return true; - } - - /** - * returns the data mode either push or pull - */ - getMode = function() { - return "PULL"; - } - - /** - * returns an array of column names & types - * @param providerConfig - */ - getSchema = function(providerConfig) { - var schema = []; - var tableName = providerConfig["tableName"]; - 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(providerConfig, limit) { - var tableName = providerConfig.tableName; - var query = providerConfig.query; - var limit = 100; - if (providerConfig.limit) { - limit = providerConfig.limit; - } - var result; - //if there's a filter present, we should perform a Lucene search instead of reading the table - if (query) { - var filter = { - "query": query, - "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; - }; - -}()); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/donut-chart-api.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/donut-chart-api.js deleted file mode 100644 index 2e19f88cbe..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/donut-chart-api.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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, isProviderRequired, draw, update; - -(function() { - - var CHART_LOCATION = '/extensions/chart-templates/'; - - /** - * return the config to be populated in the chart configuration UI - * @param schema - */ - getConfig = function(schema) { - var chartConf = require(CHART_LOCATION + '/donut-chart/config.json').config; - /* - dynamic logic goes here - */ - return chartConf; - - }; - - /** - * validate the user inout for the chart configuration - * @param chartConfig - */ - validate = function(chartConfig) { - return true; - }; - - /** - * TO be used when provider configuration steps need to be skipped - */ - isProviderRequired = function() { - - } - - - /** - * return the gadget content - * @param chartConfig - * @param schema - * @param data - */ - draw = function(placeholder, chartConfig, _schema, data) { - var schema = toVizGrammarSchema(_schema); - var view = { - id: "chart-0", - schema: schema, - chartConfig: buildChartConfig(chartConfig), - data: function() { - if(data) { - var result = []; - data.forEach(function(item) { - var row = []; - schema[0].metadata.names.forEach(function(name) { - row.push(item[name]); - }); - result.push(row); - }); - wso2gadgets.onDataReady(result); - } - } - - }; - - try { - wso2gadgets.init(placeholder, view); - var view = wso2gadgets.load("chart-0"); - } catch (e) { - console.error(e); - } - - }; - - /** - * - * @param data - */ - update = function(data) { - wso2gadgets.onDataReady(data,"append"); - } - - buildChartConfig = function (_chartConfig) { - var conf = {}; - conf.x = _chartConfig.x; - conf.maxLength = _chartConfig.maxLength; - conf.charts = []; - conf.charts[0] = { - type : "arc", - color: _chartConfig.color, - mode: "donut" - }; - conf.legendOffset = -30; - return conf; - }; - - -}()); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-core.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-core.js deleted file mode 100644 index 8831c6925e..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-core.js +++ /dev/null @@ -1,101 +0,0 @@ -/* -* 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. -*/ -$(function () { - var gadgetLocation; - var conf; - var schema; - var pref = new gadgets.Prefs(); - - var refreshInterval; - var providerData; - - var CHART_CONF = 'chart-conf'; - var PROVIDER_CONF = 'provider-conf'; - - var REFRESH_INTERVAL = 'refreshInterval'; - -var init = function () { - $.ajax({ - url: gadgetLocation + '/conf.json', - method: "GET", - contentType: "application/json", - async: false, - success: function (data) { - conf = JSON.parse(data); - // Update the date to yesterday - var currentTime = new Date(); - - // returns the month (from 0 to 11) - var month = currentTime.getMonth() + 1 - - // returns the day of the month (from 1 to 31) - var day = currentTime.getDate() - 1 // Yesterday - - // returns the year (four digits) - var year = currentTime.getFullYear() - - conf['provider-conf'].query = "year: " + year + " AND month: " + month + " AND day: " + day; - $.ajax({ - url: gadgetLocation + '/gadget-controller.jag?action=getSchema', - method: "POST", - data: JSON.stringify(conf), - contentType: "application/json", - async: false, - success: function (data) { - schema = data; - } - }); - - getProviderData(); - - } - }); -}; - -var getProviderData = function (){ - $.ajax({ - url: gadgetLocation + '/gadget-controller.jag?action=getData', - method: "POST", - data: JSON.stringify(conf), - contentType: "application/json", - async: false, - success: function (data) { - data.forEach(function(entry) { - entry.duration = entry.duration / 60000; // Convert to minutes - }); - providerData = data; - } - }); - return providerData; -}; - - -var drawGadget = function (){ - - draw('#canvas', conf[CHART_CONF], schema, providerData); - setInterval(function() { - draw('#canvas', conf[CHART_CONF], schema, getProviderData()); - },pref.getInt(REFRESH_INTERVAL)); - -}; - -getGadgetLocation(function (gadget_Location) { - gadgetLocation = gadget_Location; - init(); - drawGadget(); - -}); -}); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-util.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-util.js deleted file mode 100644 index fc7db2ea3b..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/js/core/gadget-util.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 getGadgetLocation = function (callback) { - var gadgetLocation = "/portal/store/carbon.super/fs/gadget/Android_Activity_Chart"; - var PATH_SEPERATOR = "/"; - if (gadgetLocation.search("store") != -1) { - wso2.gadgets.identity.getTenantDomain(function (tenantDomain) { - var gadgetPath = gadgetLocation.split(PATH_SEPERATOR); - var modifiedPath = ''; - for (var i = 1; i < gadgetPath.length; i++) { - if (i === 3) { - modifiedPath = modifiedPath.concat(PATH_SEPERATOR, tenantDomain); - } else { - modifiedPath = modifiedPath.concat(PATH_SEPERATOR, gadgetPath[i]) - } - } - callback(modifiedPath); - }); - } else { - callback(gadgetLocation); - } -} \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/thumbnail.png b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/Android_Activity_Chart/thumbnail.png deleted file mode 100644 index ed88c6e59bc2bdbc1bf42237de91d49cac9dd04d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15590 zcmZX*18^nX6E}Qg+u7LW#tE6jlDdkA9yc(2(C(ZA3g7005iETtr0C+|UpJaQl~} z;r>$-CY)^x`4Y^y=f>dy3mMs{v$?%87y%@&Gb4O2(jVO=HgMO`4GXwwvaLW}pWij0TGUd&S97F~TA^`kF&_oPCVj}>Y zrqBsV;DW7)fci42Nisk`I^eqD`)wf50sudO_2p?ozflChdtc872B3HP)~N-Q2p14b z?Zi!s=QocFFry~kkpg7q0Yo=jXGS>zpFaWl=91ui=z@(902M>SJrNL5N`N5qv+ix+ zm)6vF57){4ba#8@>0{ypp;vz*Y$2huT-~3I*^16#nGioW%!F z0Y+b1^{~_c+Yo}9q#_{6ADf{@o;Ajw>XP|M0sv@GqPsjNO9=onl;CPYK^I-Jw>vl7 zHV0u-q^!fW_G6dE&E>?)Y-uYtR>_w8j2sGlh=30W>Fn?x5+&W-5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vpL#UzXEg_&6WPI}Qrd5tBJiBA7y zJagPO)Q$#g@9M(aCqtp2XbV!jQ!~KqGLZ!CNt!jUb+};5BY)b1rU9tI6No@nh%ifF z>$rc#Av+?Fl+#?fj<=Cvw~~eWt0F(swfEHgqulz5!U6nAyL#O3*X2s4#JG|K#9iW};)XWJW^1l|5ke!{CF_Dyw zAp;%J_m_WCyh>So^I-jt$H>^x(81i!$=uckAZqStXQl6s^&_eEn*{rRB-Z*i&L;YX sPR5&*t^W7$IWv>!`yoI|OkT8FSkM3e0Kk;d8UO$Q diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/artifact.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/artifact.xml deleted file mode 100644 index 710dddd2ed..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_activity_chart_gadget/artifact.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Android_Activity_Chart - - diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/conf.json b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/conf.json deleted file mode 100644 index ee8bfc8d57..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/conf.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "provider-conf": { - "tableName": "ORG_WSO2_IOT_ANDROID_BATTERY_STATS", - "query": "", - "limit": "", - "provider-name": "batch" - }, - "chart-conf": { - "x": "meta_timestamp", - "xType": "time", - "y": "level", - "yType": "number", - "color": "None", - "mode": "stack", - "maxLength": "30", - "gadget-name": "Battery History", - "chart-name": "area-chart" - } -} \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget-controller.jag b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget-controller.jag deleted file mode 100644 index f84538a40a..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget-controller.jag +++ /dev/null @@ -1,42 +0,0 @@ -<% -/** - * 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 PROVIDER_CONF = 'provider-conf'; - var PROVIDER_NAME = 'provider-name'; - - var action = request.getParameter("action"); - var data = request.getContent(); - var providerConf = data[PROVIDER_CONF]; - var providerAPI = require('js/core/' + providerConf[PROVIDER_NAME] + '-provider-api.js'); - - if (action === 'getSchema') { - print(providerAPI.getSchema(providerConf)); - return; - } else if(action === 'getData'){ - print(providerAPI.getData(providerConf)); - return; - } - -}()); - - -%> diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.json b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.json deleted file mode 100644 index 2f9196eb5c..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "Android_Battery_History_Chart", - "title": "Battery History", - "type": "gadget", - "thumbnail": "gadget/Android_Battery_History_Chart/thumbnail.png", - "data": { - "url": "gadget/Android_Battery_History_Chart/gadget.xml" - } -} diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.xml deleted file mode 100644 index e0d5437a9d..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/gadget.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - ]]> -
-
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/area-chart-api.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/area-chart-api.js deleted file mode 100644 index e6172abf3a..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/area-chart-api.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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, isProviderRequired, draw, update; - -(function() { - - var CHART_LOCATION = '/extensions/chart-templates/'; - - /** - * return the config to be populated in the chart configuration UI - * @param schema - */ - getConfig = function(schema) { - var chartConf = require(CHART_LOCATION + '/area-chart/config.json').config; - /* - dynamic logic goes here - */ - - var columns = []; - - columns.push("None"); - for(var i=0; i < schema.length; i++) { - columns.push(schema[i]["fieldName"]); - } - - for(var i=0; i < chartConf.length; i++) { - if (chartConf[i]["fieldName"] == "color") { - chartConf[i]["valueSet"] = columns; - break; - } - } - - return chartConf; - }; - - /** - * validate the user inout for the chart configuration - * @param chartConfig - */ - validate = function(chartConfig) { - return true; - }; - - /** - * TO be used when provider configuration steps need to be skipped - */ - isProviderRequired = function() { - - } - - - /** - * return the gadget content - * @param chartConfig - * @param schema - * @param data - */ - draw = function(placeholder, chartConfig, _schema, data) { - _schema = updateUserPrefXYTypes(_schema, chartConfig); - var schema = toVizGrammarSchema(_schema); - - var view = { - id: "chart-0", - schema: schema, - chartConfig: buildChartConfig(chartConfig), - data: function() { - if(data) { - var result = []; - console.log(data); - data.forEach(function(item) { - var row = []; - schema[0].metadata.names.forEach(function(name) { - row.push(item[name]); - }); - result.push(row); - }); - console.log(result); - wso2gadgets.onDataReady(result); - } - } - - }; - - try { - wso2gadgets.init(placeholder, view); - var view = wso2gadgets.load("chart-0"); - } catch (e) { - console.error(e); - } - - }; - - /** - * - * @param data - */ - update = function(data) { - wso2gadgets.onDataReady(data,"append"); - } - - buildChartConfig = function (_chartConfig) { - var conf = {}; - conf.x = _chartConfig.x; - conf.xType = _chartConfig.xType; - conf.yType = _chartConfig.yType; - conf.maxLength = _chartConfig.maxLength; - conf.charts = []; - conf.charts[0] = { - type : "area", - y: _chartConfig.y - }; - - if (_chartConfig.color != "None") { - conf.charts[0].color = _chartConfig.color; - conf.charts[0].mode = _chartConfig.mode; - } - - return conf; - }; - - -}()); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/batch-provider-api.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/batch-provider-api.js deleted file mode 100644 index 30c96902a5..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/batch-provider-api.js +++ /dev/null @@ -1,190 +0,0 @@ -/* - * 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 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); - - /** - * require the existing config.json and push any dynamic fields that needs to be populated in the UI - */ - getConfig = function() { - var formConfig = require(PROVIDERS_LOCATION + '/' + PROVIDER_NAME + '/config.json'); - var tables; - try { - tables = JSON.parse(connector.getTableList(loggedInUser).getMessage()); - } catch (e) { - log.error(e); - } - var configs = formConfig.config; - configs.forEach(function(config) { - if (config.fieldName === TABLE_NAME) { - config.valueSet = tables; - } - }); - return formConfig; - } - - /** - * validate the user input of provider configuration - * @param providerConfig - */ - validate = function(providerConfig) { - /* - validate the form and return - - */ - return true; - } - - /** - * returns the data mode either push or pull - */ - getMode = function() { - return "PULL"; - } - - /** - * returns an array of column names & types - * @param providerConfig - */ - getSchema = function(providerConfig) { - var schema = []; - var tableName = providerConfig["tableName"]; - 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(providerConfig, limit) { - var tableName = providerConfig.tableName; - var query = providerConfig.query; - var limit = 100; - if (providerConfig.limit) { - limit = providerConfig.limit; - } - var result; - //if there's a filter present, we should perform a Lucene search instead of reading the table - if (query) { - var filter = { - "query": query, - "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; - }; - -}()); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-core.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-core.js deleted file mode 100644 index 9dfe8683b8..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-core.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -* 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. -*/ -$(function () { - var gadgetLocation; - var conf; - var schema; - var pref = new gadgets.Prefs(); - - var refreshInterval; - var providerData; - - var CHART_CONF = 'chart-conf'; - var PROVIDER_CONF = 'provider-conf'; - - var REFRESH_INTERVAL = 'refreshInterval'; - -var init = function () { - $.ajax({ - url: gadgetLocation + '/conf.json', - method: "GET", - contentType: "application/json", - async: false, - success: function (data) { - conf = JSON.parse(data); - $.ajax({ - url: gadgetLocation + '/gadget-controller.jag?action=getSchema', - method: "POST", - data: JSON.stringify(conf), - contentType: "application/json", - async: false, - success: function (data) { - schema = data; - } - }); - - getProviderData(); - - } - }); -}; - -var getProviderData = function (){ - $.ajax({ - url: gadgetLocation + '/gadget-controller.jag?action=getData', - method: "POST", - data: JSON.stringify(conf), - contentType: "application/json", - async: false, - success: function (data) { - providerData = data; - } - }); - return providerData; -}; - - -var drawGadget = function (){ - - draw('#canvas', conf[CHART_CONF], schema, providerData); - setInterval(function() { - draw('#canvas', conf[CHART_CONF], schema, getProviderData()); - },pref.getInt(REFRESH_INTERVAL)); - -}; - -getGadgetLocation(function (gadget_Location) { - gadgetLocation = gadget_Location; - init(); - drawGadget(); - -}); -}); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-util.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-util.js deleted file mode 100644 index 2317e157db..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/js/core/gadget-util.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 getGadgetLocation = function (callback) { - var gadgetLocation = "/portal/store/carbon.super/fs/gadget/Android_Battery_History_Chart"; - var PATH_SEPERATOR = "/"; - if (gadgetLocation.search("store") != -1) { - wso2.gadgets.identity.getTenantDomain(function (tenantDomain) { - var gadgetPath = gadgetLocation.split(PATH_SEPERATOR); - var modifiedPath = ''; - for (var i = 1; i < gadgetPath.length; i++) { - if (i === 3) { - modifiedPath = modifiedPath.concat(PATH_SEPERATOR, tenantDomain); - } else { - modifiedPath = modifiedPath.concat(PATH_SEPERATOR, gadgetPath[i]) - } - } - callback(modifiedPath); - }); - } else { - callback(gadgetLocation); - } -} \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/thumbnail.png b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_history_chart_gadget/Android_Battery_History_Chart/thumbnail.png deleted file mode 100644 index ca23094d0a01ee671e94b3cff2503edcdffe3879..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10532 zcmV+GzAOJ~3 zK~#9!?VWkNm1WiUzw5g1J)DtwI-pFVh$v2g%!49oie~y~T50vB`Sw=UQ$1OtD46!7 z=2L3+RBG8|ikgZMDD#Y(I58;mJi{6Gc;DB0|2T*c2LwFB-sfDu&u4%5u=hUq-g{l^ zd#|;w5uBWyoSdAFN8(ISxB6P5yVvpU7SV`T9LZFsilUxZYJIN&YYIiRScPI$#nkY( z77!6csZ^0lj7^vzOlHEcJX##D%7&HMjc4r6{HAba=q&93$w}Qcd$^Q(3DnE@yQQQg z5=d(Tuag)$qk00+3Fst3D;1iHQmha|i2^=C6#ax2QZhh*kP%3$P$|kDRdxa!fDMSO zSIb)ba6{JD9WAt?Lc(ZJ9u{)vkQwS)$^la6x@Yk)N$*vO7Wl@GXemKh7GQd+>KP!X zpwbPr%!o8srBD^59xVLP=ZKI{)jc4aRCE>SauIpk$1cP7HU(KJ&m;ru6{_AjaJGZS z0rKhflX)XdVKd*9Z>cIZ#nEmAawf_-R`nbsbOBl@;^(3v6%aH4c3WkQ5qSgQ4NJI$ zRCZ-)$KvwDuE73i;B@O++5vJ@8aHdWc)m4-r7^E!PqHlPMfwC;9f~kOpeI5L$z!u= zbw0OCmE{QYeNSd(!t9dL<^`Lo%EK@WtQ|MhrDP6}f75+)hkC(D#xF~3amnzqeiBwvcUAvjsAx=_~D>gp#!7|>yEht4OPBh+ESWl(hO8& zv_*!A>dC6&Nt3gVh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0ez3YWIj?s~{UxbOVOX8p<~Hf}N3Udhd`Sol-BqvQtZ%8Ezju z!@=MH$$bq@ogg>F&NAgoE23LB?ukbIf=CoECN}&;K-74N3}HGGB(v>0HqVrvT9WyF m`d@ZVe7$piCnu+d)Bgt_#n7}!GfHLv0000 - - - - Android_Battery_History_Chart - diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/conf.json b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/conf.json deleted file mode 100644 index 292ad07348..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/conf.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "chart-conf": { - "chart-name": "donut-chart", - "color": "owner", - "gadget-name": "Android Battery Percentage Chart", - "maxLength": "2", - "x": "level" - }, - "provider-conf": { - "provider-name": "realtime", - "streamName": "org.wso2.iot.android.battery:1.0.0" - } -} diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget-controller.jag b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget-controller.jag deleted file mode 100644 index f84538a40a..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget-controller.jag +++ /dev/null @@ -1,42 +0,0 @@ -<% -/** - * 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 PROVIDER_CONF = 'provider-conf'; - var PROVIDER_NAME = 'provider-name'; - - var action = request.getParameter("action"); - var data = request.getContent(); - var providerConf = data[PROVIDER_CONF]; - var providerAPI = require('js/core/' + providerConf[PROVIDER_NAME] + '-provider-api.js'); - - if (action === 'getSchema') { - print(providerAPI.getSchema(providerConf)); - return; - } else if(action === 'getData'){ - print(providerAPI.getData(providerConf)); - return; - } - -}()); - - -%> diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.json b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.json deleted file mode 100644 index 848a5e7402..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "Android_Battery_Percentage_Chart", - "title": "Android Battery Percentage Chart", - "type": "gadget", - "thumbnail": "gadget/Android_Battery_Percentage_Chart/thumbnail.png", - "data": { - "url": "gadget/Android_Battery_Percentage_Chart/gadget.xml" - } -} diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.xml deleted file mode 100644 index 9eadeb816e..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/gadget.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - ]]> -
-
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/donut-chart-api.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/donut-chart-api.js deleted file mode 100644 index acfd684cdd..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/donut-chart-api.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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, isProviderRequired, draw, update; - -(function() { - - var CHART_LOCATION = '/extensions/chart-templates/'; - - /** - * return the config to be populated in the chart configuration UI - * @param schema - */ - getConfig = function(schema) { - var chartConf = require(CHART_LOCATION + '/donut-chart/config.json').config; - /* - dynamic logic goes here - */ - return chartConf; - - }; - - /** - * validate the user inout for the chart configuration - * @param chartConfig - */ - validate = function(chartConfig) { - return true; - }; - - /** - * TO be used when provider configuration steps need to be skipped - */ - isProviderRequired = function() { - - } - - - /** - * return the gadget content - * @param chartConfig - * @param schema - * @param data - */ - draw = function(placeholder, chartConfig, _schema, data) { - var schema = toVizGrammarSchema(_schema); - var view = { - id: "chart-0", - schema: schema, - chartConfig: buildChartConfig(chartConfig), - data: function() { - if(data) { - var result = []; - console.log(data); - data.forEach(function(item) { - var row = []; - schema[0].metadata.names.forEach(function(name) { - row.push(item[name]); - }); - result.push(row); - }); - console.log(result); - wso2gadgets.onDataReady(result); - } - } - - }; - - try { - wso2gadgets.init(placeholder, view); - var view = wso2gadgets.load("chart-0"); - } catch (e) { - console.error(e); - } - - }; - - /** - * - * @param data - */ - update = function(data) { - wso2gadgets.onDataReady(data,"append"); - } - - buildChartConfig = function (_chartConfig) { - var conf = {}; - conf.x = _chartConfig.x; - conf.maxLength = _chartConfig.maxLength; - conf.charts = []; - conf.charts[0] = { - type : "arc", - color: _chartConfig.color - }; - conf.tooltip = {"enabled":false} - conf.legend = false; - conf.percentage = true; - conf.colorScale = ["#50B432", "#eefaeb"]; - return conf; - }; - - -}()); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-core.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-core.js deleted file mode 100644 index d87093956a..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-core.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -* 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. -*/ -$(function () { - var gadgetLocation; - var conf; - var schema; - var pref = new gadgets.Prefs(); - - var CHART_CONF = 'chart-conf'; - var PROVIDER_CONF = 'provider-conf'; - -var init = function () { - $.ajax({ - url: gadgetLocation + '/conf.json', - method: "GET", - contentType: "application/json", - async: false, - success: function (data) { - conf = JSON.parse(data); - $.ajax({ - url: gadgetLocation + '/gadget-controller.jag?action=getSchema', - method: "POST", - data: JSON.stringify(conf), - contentType: "application/json", - async: false, - success: function (data) { - schema = data; - } - }); - - } - }); -}; - - -var drawGadget = function (){ - - draw('#canvas', conf[CHART_CONF], schema, null); - registerCallBackforPush(conf[PROVIDER_CONF], schema, function(providerData) { - var dummyData = jQuery.extend(true, {}, providerData[0]); - providerData[0][1] = "YES"; - dummyData[4] = (100 - dummyData[4]); - dummyData[1] = "NO"; - providerData.push(dummyData); - update(providerData); - }); - -}; - -getGadgetLocation(function (gadget_Location) { - gadgetLocation = gadget_Location; - init(); - drawGadget(); - -}); -}); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-util.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-util.js deleted file mode 100644 index 0a76ceef03..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/gadget-util.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 getGadgetLocation = function (callback) { - var gadgetLocation = "/portal/store/carbon.super/fs/gadget/Android_Battery_Percentage_Chart"; - var PATH_SEPERATOR = "/"; - if (gadgetLocation.search("store") != -1) { - wso2.gadgets.identity.getTenantDomain(function (tenantDomain) { - var gadgetPath = gadgetLocation.split(PATH_SEPERATOR); - var modifiedPath = ''; - for (var i = 1; i < gadgetPath.length; i++) { - if (i === 3) { - modifiedPath = modifiedPath.concat(PATH_SEPERATOR, tenantDomain); - } else { - modifiedPath = modifiedPath.concat(PATH_SEPERATOR, gadgetPath[i]) - } - } - callback(modifiedPath); - }); - } else { - callback(gadgetLocation); - } -} \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/provider-client.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/provider-client.js deleted file mode 100644 index 6196677f67..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/provider-client.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 registerCallBackforPush; - -(function() { - - var callback; - - /** - * TODO Need to read hostname,port, and tenantId from providerConfig - * @param providerConfig - * @param schema - */ - registerCallBackforPush = function(providerConfig, schema, _callback) { - var streamId = providerConfig['streamName']; - var hostname = window.parent.location.hostname; - var port = window.parent.location.port; - - subscribe(streamId.split(":")[0], streamId.split(":")[1], - '10', - onData, onError, - hostname, - port, - 'WEBSOCKET' - ); - callback = _callback; - }; - - function onData(streamId, data) { - callback(data); - }; - - function onError(error) { - console.error(error); - }; - -}()); - diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/realtime-provider-api.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/realtime-provider-api.js deleted file mode 100644 index 7cf59af776..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/core/realtime-provider-api.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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 = 'realtime'; - - var log = new Log(); - var utils = require('/modules/utils.js'); - var carbon = require("carbon"); - var EventPublisherConstants = Packages.org.wso2.carbon.event.publisher.core.config.EventPublisherConstants; - var eventPublisherService = carbon.server.osgiService('org.wso2.carbon.event.publisher.core.EventPublisherService'); - var eventStreamService = carbon.server.osgiService('org.wso2.carbon.event.stream.core.EventStreamService'); - - var typeMap = { - "bool": "string", - "boolean": "string", - "string": "string", - "int": "number", - "integer": "number", - "long": "number", - "double": "number", - "float": "number", - "time": "time" - }; - - getConfig = function() { - var formConfig = require(PROVIDERS_LOCATION + '/' + PROVIDER_NAME + '/config.json'); - var datasources = []; - try { - var eventPublisherConfigurationList = eventPublisherService.getAllActiveEventPublisherConfigurations(); - for (var i = 0; i < eventPublisherConfigurationList.size(); i++) { - var eventPublisherConfiguration = eventPublisherService.getActiveEventPublisherConfiguration( - eventPublisherConfigurationList.get(i).getEventPublisherName());; - - var mappingTypeIsWso2 = eventPublisherConfiguration.getOutputMapping() - .getMappingType().equals(EventPublisherConstants.EF_WSO2EVENT_MAPPING_TYPE); - - var adapterType = null; - if (eventPublisherConfiguration.getToAdapterConfiguration() != null) { - adapterType = eventPublisherConfiguration.getToAdapterConfiguration().getType(); - } - if (mappingTypeIsWso2 && adapterType.trim() == "ui") { - var streamName = eventPublisherConfiguration.getFromStreamName(); - var streamVersion = eventPublisherConfiguration.getFromStreamVersion(); - var streamId = streamName + ":" + streamVersion; - datasources.push(streamId); - } - } - var datasourceCfg = { - "fieldLabel": "Event Stream", - "fieldName": "streamName", - "fieldType": "dropDown" - }; - datasourceCfg['valueSet'] = datasources; - } catch (e) { - log.error(e); - } - formConfig.config.push(datasourceCfg); - return formConfig; - }; - - /** - * validate the user input of provider configuration - * @param providerConfig - */ - validate = function(providerConfig) { - /* - validate the form and return - - */ - return true; - }; - - /** - * returns the data mode either push or pull - */ - getMode = function() { - return 'push'; - }; - - /** - * returns an array of column names & types - * @param providerConfig - */ - getSchema = function(providerConfig) { - var streamId = providerConfig["streamName"]; - var output = []; - - output.push({ - fieldName: "TIMESTAMP", - fieldType: "time" - }); - - if (eventStreamService != null) { - var eventStreamConfiguration = eventStreamService.getEventStreamConfiguration(streamId); - if (eventStreamConfiguration != null) { - var metaData = eventStreamConfiguration.getStreamDefinition().getMetaData(); - var correlationData = eventStreamConfiguration.getStreamDefinition().getCorrelationData(); - var payloadData = eventStreamConfiguration.getStreamDefinition().getPayloadData(); - if (metaData != null) { - for (var i = 0; i < metaData.size(); i++) { - var type = metaData.get(i).getType().toString().toLowerCase(); - output.push({ - fieldName: metaData.get(i).getName(), - fieldType: typeMap[type.toLowerCase()] - }); - } - } - if (correlationData != null) { - for (var i = 0; i < correlationData.size(); i++) { - var type = correlationData.get(i).getType().toString().toLowerCase(); - output.push({ - fieldName: correlationData.get(i).getName(), - fieldType: typeMap[type.toLowerCase()] - }); - } - } - if (payloadData != null) { - for (var i = 0; i < payloadData.size(); i++) { - var type = payloadData.get(i).getType().toString().toLowerCase(); - output.push({ - fieldName: payloadData.get(i).getName(), - fieldType: typeMap[type.toLowerCase()] - }); - } - } - } - } - return output; - }; - - getData = function(providerConfig,limit) { - var data = []; - return data; - }; - - -}()); diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/provider-libs/ws-client.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/provider-libs/ws-client.js deleted file mode 100644 index 96c8356426..0000000000 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_percentage_chart_gadget/Android_Battery_Percentage_Chart/js/provider-libs/ws-client.js +++ /dev/null @@ -1,288 +0,0 @@ -/* - * 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. - */ - -var CONSTANTS = { - urlSeperator: '/', - queryParamStreamName : '?streamname=', - queryParamStreamVersion : '&version=', - queryParamLastUpdatedTime : '&lastUpdatedTime=', - urlSecureTransportWebsocket : 'wss://', - urlSecureTransportHttp : 'https://', - colon : ':', - defaultIntervalTime : 10 * 1000, - defaultHostName : 'localhost', - defaultSecurePortNumber : '9443', - defaultMode : 'AUTO', - processModeHTTP : 'HTTP', - processModeWebSocket : 'WEBSOCKET', - processModeAuto : 'AUTO', - numThousand : 1000, - websocketTimeAppender : 400, - websocketSubscriptionEndpoint : 'portal/uipublisher/websocketSubscriptionEndpoint.jag', - httpEventRetrievalEndpoint : 'portal/uipublisher/httpEventRetrievalEndpoint.jag' -}; - - -var websocket = null; -var webSocketUrl; -var httpUrl; -var cepHostName; -var cepPortNumber; -var isErrorOccured = false; -var lastUpdatedtime = -1; -var polingInterval; -var stream; -var streamVersion; -var firstPollingAttempt; -var processMode; -var onSuccessFunction; -var onErrorFunction; -var terminateWebsocketInstance = false; -var pollingContinue = true; - -function subscribe(streamName,version,intervalTime, - listeningFuncSuccessData,listeningFuncErrorData,cepHost,cepPort,mode){ - stopPollingProcesses(); - stream = streamName; - streamVersion = version; - onSuccessFunction = listeningFuncSuccessData; - onErrorFunction = listeningFuncErrorData; - - if(intervalTime == null || intervalTime == ""){ - polingInterval = CONSTANTS.defaultIntervalTime; - } else{ - polingInterval = intervalTime * CONSTANTS.numThousand; - } - - if(cepHost == null || cepHost == ""){ - cepHostName = CONSTANTS.defaultHostName; - } else{ - cepHostName = cepHost; - } - - if(cepPort == null || cepPort == ""){ - cepPortNumber = CONSTANTS.defaultSecurePortNumber; - } else{ - cepPortNumber = cepPort; - } - - if(mode == null || mode == ""){ - processMode = CONSTANTS.defaultMode; - } else{ - processMode = mode; - } - - webSocketUrl = CONSTANTS.urlSecureTransportWebsocket + cepHostName + CONSTANTS.colon + cepPortNumber + - CONSTANTS.urlSeperator + CONSTANTS.websocketSubscriptionEndpoint; - - if(processMode == CONSTANTS.processModeHTTP){ - firstPollingAttempt = true; - pollingContinue = true; - startPoll(); - } else{ - initializeWebSocket(webSocketUrl); - } -} - - -/** - * Initializing Web Socket - */ -function initializeWebSocket(webSocketUrl){ - websocket = new WebSocket(webSocketUrl); - websocket.onopen = webSocketOnOpen; - websocket.onmessage = webSocketOnMessage; - websocket.onclose = webSocketOnClose; - websocket.onerror = webSocketOnError; -} - -function getWebsocketSubscriptionMessage(streamName, streamVersion, streamProperties, streamValues) { - if (streamProperties.length === streamValues.length) { - var message = {}; - message.streamName = streamName; - message.streamVersion = streamVersion; - var i; - for (i = 0; i < streamProperties.length; i++) { - message.filterProps = []; - message.filterProps.push({ - 'name': streamProperties[i], - 'value': streamValues[i] - }); - } - return JSON.stringify(message); - } else { - console.log('stream properties and values are not in equal size'); - } -} - -/** - * Get the parameters as query parameters. - * This method parses those parameters and returns. - * */ -function getAllQueryParamsFromURL() { - var queryParamList = {}, qParam; - var urlQueryString = decodeURIComponent(window.top.location.search.substring(1)); - - if (urlQueryString) { - var queryStringPairs = urlQueryString.split('&'); - for (var i = 0; i < queryStringPairs.length; i++) { - qParam = queryStringPairs[i].split('='); - queryParamList[qParam[0]] = qParam[1]; - } - return queryParamList; - - } else { - return null; - } -} - -/** - * Web socket On Open - */ -var webSocketOnOpen = function () { - var params = getAllQueryParamsFromURL(); - var deviceId; - var owner; - if (params) { - owner = params["owner"]; - deviceId = params["deviceId"]; - } - var filterPropNames = ["meta_owner", "meta_deviceId"]; - var filterPropVals = [owner, deviceId]; - var data = getWebsocketSubscriptionMessage(stream, streamVersion, filterPropNames, filterPropVals); - websocket.send(data); -}; - -/** - * On server sends a message - */ -var webSocketOnMessage = function (evt) { - var event = evt.data; - var array = JSON.parse(event); - constructPayload(array); -}; - -/** - * On server close - */ -var webSocketOnClose =function (e) { - - if(isErrorOccured){ - if(processMode != CONSTANTS.processModeWebSocket){ - firstPollingAttempt = true; - pollingContinue = true; - startPoll(); - } - } else{ - if(!terminateWebsocketInstance){ - waitForSocketConnection(websocket); - } else{ - terminateWebsocketInstance = false; - } - - } -}; - -/** - * On server Error - */ -var webSocketOnError = function (err) { - var error = "Error: Cannot connect to Websocket URL:" + webSocketUrl + " .Hence closing the connection!"; - - onErrorFunction(error); - isErrorOccured = true; - -}; - -/** - * Gracefully increments the connection retry - */ -var waitTime = CONSTANTS.numThousand; -function waitForSocketConnection(socket, callback){ - setTimeout( - function () { - if (socket.readyState === 1) { - initializeWebSocket(webSocketUrl); - console.log("Connection is made"); - if(callback != null){ - callback(); - } - return; - } else { - websocket = new WebSocket(webSocketUrl); - waitTime += CONSTANTS.websocketTimeAppender; - waitForSocketConnection(websocket, callback); - } - }, waitTime); -} - -/** - * Polling to retrieve events from http request periodically - */ -function startPoll(){ - - (function poll(){ - setTimeout(function(){ - httpUrl = CONSTANTS.urlSecureTransportHttp + cepHostName + CONSTANTS.colon + cepPortNumber + - CONSTANTS.urlSeperator + CONSTANTS.httpEventRetrievalEndpoint + CONSTANTS.queryParamStreamName + stream + - CONSTANTS.queryParamStreamVersion + streamVersion + CONSTANTS.queryParamLastUpdatedTime + lastUpdatedtime;; - $.getJSON(httpUrl, function(responseText) { - if(firstPollingAttempt){ - /*var data = $("textarea#idConsole").val(); - $("textarea#idConsole").val(data + "Successfully connected to HTTP.");*/ - firstPollingAttempt = false; - } - var eventList = $.parseJSON(responseText.events); - if(eventList.length != 0){ - lastUpdatedtime = responseText.lastEventTime; - for(var i=0;i1pp590RX-<0D!;6x70fE0bx|u(@ z*C)-^oYWROs>-Tt-@phW1WJQS&9;5Fi;O+~XPGITMDdESGT}8zNagU;e6Xti5CoWV zDSfv1{m;1=LM(o0fKUKJ06c(|0}cj2AOr*DfioI2O+uGvXNBK2Kny{ zbLh}VA@Oys^?5v#HyE;>9CMy+5P(#nPQ?(uUdywpgYpr;`kYwSn6Me)kVFbJl>B+% zfCwx;5+!K@7?Yx8X&FfKB|RI!Dr5x!$mVBq!5~_aePV<98B|8I4Vr9_S~@PUl5<9h zj&-aP9vkfjE^m~W3QFec4|wKe9{sZ9cR~h#h+VBAiv6YmCGo9aZ(`Dn^SMczx_?EhH1&D-Oml1lIYuPmF~6^+-5+m>IbNj!Zz2>Q3jjp4I(IQ>PXr& z!EUWdhULl*c}d{71d9Cp7^8?BD$4xa%N%vhEfCH|f1iVhie@-#{(at$UU*_n%K|uW zRm*xwk}D&lb2#gJf~v_rkvNT;t|~snF~zz23swkN}CUq%=WC`ce^ash(rCBrJ7jS7D zu9Zmg2w{?^dJ^DbLcu;gf)y*%1ABCce$O6T99c9^P86F0D}e?n_eGxrDd2PC z?wQ4)tM|A9lOENjWDH3~r-2VB#a%Q`)YYbMxMi@6=GK8`|NSk_(%}q@GL=ccsS?CN z23v(;*i;8RYeC8dDj5_Kq|uncI91}|31ZkWJcvO6v3&z0>s+`T@9#XH-u1ikfy93^ zG(_J0Gol9#qHQKQ^G?j?;qziwArkx;8g40n%cR1iq#|Z;N^){a@K^fZh+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