diff --git a/README.md b/README.md index e45f297f7d..fc9773ecae 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -#carbon-device-mgt-plugins +# carbon-device-mgt-plugins - +
+ - Java7
+ - Java8 WSO2 MOBILE DEVICE MANAGER diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml index aefb777826..b81e9cb2a2 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml index 1a3df55fa9..3c95291726 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml index 3a4395e778..f07828721c 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml index a47aba097f..a8bf9b53e6 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.devicemgt-plugins iot-analytics - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/gadget-controller.jag b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/gadget-controller.jag index 25d50b9c0c..a66ff17ded 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/gadget-controller.jag +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/gadget-controller.jag @@ -33,6 +33,9 @@ } else if(action === 'getData'){ print(providerAPI.getData(id, type, timeFrom, timeTo)); return; + } else if(action === 'getAlerts'){ + print(providerAPI.getAlerts(id)); + return; } }()); diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/js/batch-provider-api.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/js/batch-provider-api.js index b74f8d7ebd..6927917ad4 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/js/batch-provider-api.js +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/controllers/js/batch-provider-api.js @@ -34,6 +34,7 @@ var getConfig, validate, getMode, getSchema, getData, registerCallBackforPush; var JS_MIN_VALUE = "-9007199254740992"; var tableName = "ORG_WSO2_GEO_FUSEDSPATIALEVENT"; + var alertTable = "ORG_WSO2_GEO_ALERTSNOTIFICATION"; var typeMap = { "bool": "string", @@ -130,9 +131,9 @@ var getConfig, validate, getMode, getSchema, getData, registerCallBackforPush; "query": luceneQuery, "start": 0, "count": limit, - "sortBy" : [{ - "field" : "timeStamp", - "sortType" : "ASC" + "sortBy": [{ + "field": "timeStamp", + "sortType": "ASC" }] }; result = connector.search(loggedInUser, tableName, stringify(filter)).getMessage(); @@ -151,4 +152,28 @@ var getConfig, validate, getMode, getSchema, getData, registerCallBackforPush; return data; }; + getAlerts = function (deviceId) { + var limit = 50; + var result; + //if there's a filter present, we should perform a Lucene search instead of reading the table + var luceneQuery = 'id:"' + deviceId; + var filter = { + "query": luceneQuery, + "start": 0, + "count": limit, + "sortBy": [{ + "field": "timeStamp", + "sortType": "ASC" + }] + }; + result = connector.search(loggedInUser, tableName, stringify(filter)).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/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js index 10ad7582f2..7533bd9fa3 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/geo_remote.js @@ -509,38 +509,43 @@ function removeGeoFence(geoFenceElement, id) { } function getAlertsHistory(objectId) { - $.getJSON("/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/get_alerts_history.jag?objectId=" + objectId, function (data) { - var alertsContainer = $('#showAlertsArea').empty(); - $.each(data, function (key, val) { - var alertDOMElement = document.createElement('a'); // Reason for using document.createElement (performance issue) http://stackoverflow.com/questions/268490/jquery-document-createelement-equivalent - - switch (val.STATE) { - case "NORMAL": + $.ajax({ + url: '/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/gadget-controller.jag?action=getAlerts&id=' + objectId, + method: "GET", + contentType: "application/json", + async: false, + success: function (data) { + var alertsContainer = $('#showAlertsArea').empty(); + $.each(data, function (key, val) { + var alertDOMElement = document.createElement('a'); // Reason for using document.createElement (performance issue) http://stackoverflow.com/questions/268490/jquery-document-createelement-equivalent + switch (val.STATE) { + case "NORMAL": // $(alertDOMElement).addClass("list-group-item list-group-item-info"); - return; - case "WARNING": - $(alertDOMElement).addClass("list-group-item list-group-item-warning"); - break; - case "ALERTED": - $(alertDOMElement).addClass("list-group-item list-group-item-danger"); - break; - case "OFFLINE": - $(alertDOMElement).addClass("list-group-item list-group-item-success"); - break; - } - $(alertDOMElement).html(val.INFORMATION); - $(alertDOMElement).css({marginTop: "5px"}); - $(alertDOMElement).attr('onClick', 'showAlertInMap(this)'); - - // Set HTML5 data attributes for later use - $(alertDOMElement).attr('data-id', val.ID); - $(alertDOMElement).attr('data-latitude', val.LATITUDE); - $(alertDOMElement).attr('data-longitude', val.LONGITUDE); - $(alertDOMElement).attr('data-state', val.STATE); - $(alertDOMElement).attr('data-information', val.INFORMATION); - - alertsContainer.append(alertDOMElement); - }); + return; + case "WARNING": + $(alertDOMElement).addClass("list-group-item list-group-item-warning"); + break; + case "ALERTED": + $(alertDOMElement).addClass("list-group-item list-group-item-danger"); + break; + case "OFFLINE": + $(alertDOMElement).addClass("list-group-item list-group-item-success"); + break; + } + $(alertDOMElement).html(val.INFORMATION); + $(alertDOMElement).css({marginTop: "5px"}); + $(alertDOMElement).attr('onClick', 'showAlertInMap(this)'); + + // Set HTML5 data attributes for later use + $(alertDOMElement).attr('data-id', val.ID); + $(alertDOMElement).attr('data-latitude', val.LATITUDE); + $(alertDOMElement).attr('data-longitude', val.LONGITUDE); + $(alertDOMElement).attr('data-state', val.STATE); + $(alertDOMElement).attr('data-information', val.INFORMATION); + + alertsContainer.append(alertDOMElement); + }); + } }); } diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/Geo-Publisher-RDBMS-GeoAlertNotifications-1.0.0.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/Geo-Publisher-RDBMS-GeoAlertNotifications-1.0.0.xml deleted file mode 100644 index 4c84e82312..0000000000 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/Geo-Publisher-RDBMS-GeoAlertNotifications-1.0.0.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WSO2_GEO_DB - alerts_history - insert - - - diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/Geo-Publisher-RDBMS-GeoAlertNotifications.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/Geo-Publisher-RDBMS-GeoAlertNotifications.xml new file mode 100644 index 0000000000..f1fb17d2c1 --- /dev/null +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/Geo-Publisher-RDBMS-GeoAlertNotifications.xml @@ -0,0 +1,66 @@ + + + + + id + false + true + false + false + STRING + + + state + false + true + false + false + STRING + + + information + false + false + false + false + STRING + + + timeStamp + false + true + false + false + LONG + + + latitude + false + false + false + false + DOUBLE + + + longitude + false + false + false + false + DOUBLE + + + type + false + true + false + false + STRING + + + + Geo-Publisher-RDBMS-GeoAlertNotifications:1.0.0 + + false + EVENT_STORE + \ No newline at end of file diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/artifact.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/artifact.xml index 43f32df8c3..12af7705a2 100755 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/artifact.xml +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/Geo-Publisher-RDBMS-GeoAlertNotifications_1.0.0/artifact.xml @@ -16,6 +16,6 @@ ~ under the License. --> - - Geo-Publisher-RDBMS-GeoAlertNotifications-1.0.0.xml + + Geo-Publisher-RDBMS-GeoAlertNotifications.xml diff --git a/components/analytics/iot-analytics/pom.xml b/components/analytics/iot-analytics/pom.xml index 205ee43666..5048820449 100644 --- a/components/analytics/iot-analytics/pom.xml +++ b/components/analytics/iot-analytics/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins analytics - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/analytics/pom.xml b/components/analytics/pom.xml index 719beefb1d..797f382ba4 100644 --- a/components/analytics/pom.xml +++ b/components/analytics/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../../pom.xml diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_register.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_register.xml index f968318fc9..0409c62b0c 100755 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_register.xml +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_register.xml @@ -1,55 +1,55 @@ + android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginBottom="8dp" android:visibility="gone" /> + android:layout_height="153dp" + android:fillViewport="false" + > + android:layout_height="wrap_content" android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="wrap_content" android:hint="@string/prompt_username" + android:id="@+id/username" + android:inputType="text" + android:maxLines="1" android:singleLine="true" + /> + android:layout_height="wrap_content" android:hint="@string/prompt_password" + android:inputType="textPassword" + android:maxLines="1" android:singleLine="true" + /> + android:layout_width="match_parent" + android:layout_height="wrap_content" android:hint="@string/hostname" + android:id="@+id/hostname" + android:text="https://localhost:8243" + android:inputType="text" + android:maxLines="1" android:singleLine="true"/> + + + + + + diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js similarity index 55% rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js rename to components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js index ef40e6ebe2..74111c2448 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js @@ -18,20 +18,7 @@ function onRequest(context){ var viewModel = {}; - var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; - var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; - var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/raspberrypi/status"; - serviceInvokers.XMLHttp.get( - url, function (responsePayload) { - var responseContent = responsePayload.status; - new Log().error(responseContent); - if ("204" == responsePayload.status) { - viewModel["displayStatus"] = "Display"; - } - }, - function (responsePayload) { - //do nothing. - } - ); + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + viewModel["permissions"] = userModule.getUIPermissions(); return viewModel; } \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js index 950b6c5008..9a1ed8202e 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js @@ -95,3 +95,30 @@ var addConfiguration = function () { } ); }; + +var artifactUpload = function () { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/android_sense"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#androidsense-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +}; \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js index fcb3c37546..fd6d5b2f31 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js @@ -73,30 +73,3 @@ function attachEvents() { } } -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/android_sense"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#androidsense-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); -} - diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs index 9c08451e98..3d1fdf9977 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs @@ -41,9 +41,6 @@ Enroll Device Download APK Invite by Email - {{#if displayStatus}} - Deploy Analytics Artifacts - {{/if}} diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.js index adb857567a..0f769f8a04 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.js @@ -19,20 +19,9 @@ function onRequest(context){ var viewModel = {}; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; - var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; - var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/android_sense/status"; - serviceInvokers.XMLHttp.get( - url, function (responsePayload) { - var responseContent = responsePayload.status; - new Log().error(responseContent); - if ("204" == responsePayload.status) { - viewModel["displayStatus"] = "Display"; - } - }, - function (responsePayload) { - //do nothing. - } - ); + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + var uiPermissions = userModule.getUIPermissions(); + viewModel["permissions"] = uiPermissions; viewModel["hostName"] = devicemgtProps["generalConfig"]["host"]; viewModel["enrollmentURL"] = viewModel["hostName"] + context.unit.publicUri + "/asset/androidsense.apk"; return viewModel; diff --git a/components/device-types/androidsense-plugin/pom.xml b/components/device-types/androidsense-plugin/pom.xml index e11506c816..824d53667d 100644 --- a/components/device-types/androidsense-plugin/pom.xml +++ b/components/device-types/androidsense-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml index dd8176caa6..53efaa221c 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml index 584dbe8832..8d0a807714 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml @@ -21,7 +21,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/webapp/WEB-INF/web.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/webapp/WEB-INF/web.xml index dd95fb2d48..11f537183e 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/webapp/WEB-INF/web.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/webapp/WEB-INF/web.xml @@ -20,7 +20,10 @@ doAuthentication true - + + isSharedWithAllTenants + true + managed-api-enabled diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml index fa0af60599..0ead438160 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml @@ -23,7 +23,7 @@ arduino-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs index 49dcbcd125..08e1c60a21 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs @@ -27,36 +27,35 @@ class="alert alert-danger hidden" role="alert"> -
- - -
- - -
-
-
+ + {{#zone "bottomJs"}} {{js "js/platform-configuration.js"}} {{/zone}} diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js similarity index 55% rename from components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js rename to components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js index ea24f499ca..74111c2448 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js @@ -18,20 +18,7 @@ function onRequest(context){ var viewModel = {}; - var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; - var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; - var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/virtual_firealarm/status"; - serviceInvokers.XMLHttp.get( - url, function (responsePayload) { - var responseContent = responsePayload.status; - new Log().error(responseContent); - if ("204" == responsePayload.status) { - viewModel["displayStatus"] = "Display"; - } - }, - function (responsePayload) { - //do nothing. - } - ); + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + viewModel["permissions"] = userModule.getUIPermissions(); return viewModel; } \ No newline at end of file diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js index b2f6a8fd58..5a32d87334 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js @@ -103,3 +103,30 @@ var addConfiguration = function () { } ); }; + +var artifactUpload = function () { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/arduino"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#arduino-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +}; \ No newline at end of file diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view/analytics-view.js b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view/analytics-view.js index 25017af814..3362ffbd06 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view/analytics-view.js +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view/analytics-view.js @@ -31,12 +31,23 @@ function onRequest(context) { if (encodedClientKeys) { var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"]; var resp = tokenUtil.decode(encodedClientKeys).split(":"); - var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username, "default", {}); - if (tokenPair) { - token = tokenPair.accessToken; - } - websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?" - + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + + if (user.domain == "carbon.super") { + var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username , "default", {}); + if (tokenPair) { + token = tokenPair.accessToken; + } + websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?" + + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + } else { + var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain + , "default", {}); + if (tokenPair) { + token = tokenPair.accessToken; + } + websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/org.wso2.iot.devices.temperature/1.0.0?" + + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + } } return {"device": device, "websocketEndpoint": websocketEndpoint}; } \ No newline at end of file diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js index 311d058d97..09436267e8 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js @@ -184,30 +184,3 @@ function doAction(data) { }); } } - -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/arduino"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#arduino-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); -} \ No newline at end of file diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs index bac2a4b1c3..23e65b173d 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs @@ -66,11 +66,6 @@ Download Sketch - {{#if displayStatus}} - Deploy Analytics Artifacts - {{/if}} - diff --git a/components/device-types/arduino-plugin/pom.xml b/components/device-types/arduino-plugin/pom.xml index 68bde6ddc2..6c22b62c6e 100644 --- a/components/device-types/arduino-plugin/pom.xml +++ b/components/device-types/arduino-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/pom.xml b/components/device-types/pom.xml index d9008b9b60..f7ae7f88b8 100644 --- a/components/device-types/pom.xml +++ b/components/device-types/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml index e10b06f525..efc0b4f4a7 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/artifacts.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/artifacts.xml index 0828acf4db..eb937c2430 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/artifacts.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/artifacts.xml @@ -19,8 +19,6 @@ - - diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/artifact.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/artifact.xml deleted file mode 100644 index 5e7265fbc2..0000000000 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/artifact.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - raspberrypi_receiver.xml - diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml index 4b9dc938da..57de977b09 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml @@ -21,7 +21,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml index d15f838c89..1cc87f4a57 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml @@ -23,7 +23,7 @@ raspberrypi-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs index 8fc564c750..ef5652037c 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs @@ -27,43 +27,32 @@ class="alert alert-danger hidden" role="alert"> -
- - -
- - - -
- - -
-
- + +
+ + + + diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js similarity index 50% rename from components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js rename to components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js index efb12da30e..74111c2448 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js @@ -16,22 +16,9 @@ * under the License. */ -function onRequest(context) { +function onRequest(context){ var viewModel = {}; - var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; - var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; - var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/arduino/status"; - serviceInvokers.XMLHttp.get( - url, function (responsePayload) { - var responseContent = responsePayload.status; - new Log().error(responseContent); - if ("204" == responsePayload.status) { - viewModel["displayStatus"] = "Display"; - } - }, - function (responsePayload) { - //do nothing. - } - ); + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + viewModel["permissions"] = userModule.getUIPermissions(); return viewModel; } \ No newline at end of file diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js index c82bba71b3..88ab1888af 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js @@ -113,3 +113,30 @@ var addConfiguration = function () { } ); }; + +var artifactUpload = function () { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/raspberrypi"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#raspberrypi-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +}; diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/analytics-view.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/analytics-view.js index 7aaad19c6b..674dd8a590 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/analytics-view.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view/analytics-view.js @@ -28,15 +28,32 @@ function onRequest(context) { var jwtClient = jwtService.getJWTClient(); var encodedClientKeys = session.get(constants["ENCODED_TENANT_BASED_WEB_SOCKET_CLIENT_CREDENTIALS"]); var token = ""; + var user = session.get(constants.USER_SESSION_KEY); + if (!user) { + log.error("User object was not found in the session"); + throw constants.ERRORS.USER_NOT_FOUND; + } if (encodedClientKeys) { var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"]; var resp = tokenUtil.decode(encodedClientKeys).split(":"); - var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default", {}); - if (tokenPair) { - token = tokenPair.accessToken; - } - websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?" - + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + + if (user.domain == "carbon.super") { + var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username , "default", {}); + if (tokenPair) { + token = tokenPair.accessToken; + } + websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?" + + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + } else { + var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain + , "default", {}); + if (tokenPair) { + token = tokenPair.accessToken; + } + websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/org.wso2.iot.devices.temperature/1.0.0?" + + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + } + } return {"device": device, "websocketEndpoint": websocketEndpoint}; } \ No newline at end of file diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js index abd0a49f57..aced9b5323 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js @@ -182,31 +182,4 @@ function doAction(data) { hidePopup(); }); } -} - -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/raspberrypi"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#raspberrypi-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); } \ No newline at end of file diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs index 000e232a43..26cf664708 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs @@ -61,9 +61,6 @@ Download Agent - {{#if displayStatus}} - Deploy Analytics Artifacts - {{/if}}
-
- - -
- - - -
- - -
-
- + +
+
+ + + diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js new file mode 100644 index 0000000000..74111c2448 --- /dev/null +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js @@ -0,0 +1,24 @@ +/* + * 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 onRequest(context){ + var viewModel = {}; + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + viewModel["permissions"] = userModule.getUIPermissions(); + return viewModel; +} \ No newline at end of file diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js index 19f1c9ff3e..9c69e78993 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js @@ -103,3 +103,30 @@ var addConfiguration = function () { } ); }; + +var artifactUpload = function () { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#virtual-firealarm-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +}; diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js index 5c34b93312..40e36dd96d 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js @@ -28,15 +28,31 @@ function onRequest(context) { var jwtClient = jwtService.getJWTClient(); var encodedClientKeys = session.get(constants["ENCODED_TENANT_BASED_WEB_SOCKET_CLIENT_CREDENTIALS"]); var token = ""; + var user = session.get(constants.USER_SESSION_KEY); + if (!user) { + log.error("User object was not found in the session"); + throw constants.ERRORS.USER_NOT_FOUND; + } + if (encodedClientKeys) { - var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"]; - var resp = tokenUtil.decode(encodedClientKeys).split(":"); - var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default", {}); - if (tokenPair) { - token = tokenPair.accessToken; - } - websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?" - + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"]; + var resp = tokenUtil.decode(encodedClientKeys).split(":"); + if (user.domain == "carbon.super") { + var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username , "default", {}); + if (tokenPair) { + token = tokenPair.accessToken; + } + websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?" + + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + } else { + var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain + , "default", {}); + if (tokenPair) { + token = tokenPair.accessToken; + } + websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/org.wso2.iot.devices.temperature/1.0.0?" + + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token; + } } return {"device": device, "websocketEndpoint": websocketEndpoint}; } diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js index a667ef4cc5..d4ceb751f1 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js @@ -134,31 +134,4 @@ function doAction(data) { hideAgentDownloadPopup(); }); } -} - -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#virtualfirealarm-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); } \ No newline at end of file diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs index 922ace6592..f34aa0d6fa 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs @@ -54,9 +54,6 @@ Download Agent - {{#if displayStatus}} - Deploy Analytics Artifacts - {{/if}}
@@ -302,6 +304,7 @@
+ {{#unless iscloud}}
    @@ -696,6 +699,7 @@

+ {{/unless}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs index 2037c9c1c8..07fe6950ba 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs @@ -48,6 +48,7 @@ + {{#unless iscloud}} @@ -90,6 +91,7 @@ + {{/unless}}
@@ -287,6 +289,7 @@
+ {{#unless iscloud}}
Bellow restrictions will be applied on devices with Android version 5.0 Lollipop onwards only @@ -701,6 +704,7 @@
+ {{/unless}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png index 8e52309655..fe508e61f8 100644 Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/login.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/login.png deleted file mode 100644 index 9a01b0ac48..0000000000 Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/login.png and /dev/null differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register-cloud.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register-cloud.png new file mode 100644 index 0000000000..a943c862dd Binary files /dev/null and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register-cloud.png differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png index df3801a3b1..761b435874 100644 Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png index 7187b6d20d..6d516fadb5 100644 Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png index 23e6002dfd..7a9d9c7fca 100644 Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png differ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js index 5f92d11aa6..6375247c8c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js @@ -384,31 +384,4 @@ $(document).ready(function () { } ); }); -}); - -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/android"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#android-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); -} \ No newline at end of file +}); \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs index 22018141c7..183b0b96b8 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs @@ -20,7 +20,7 @@
{{#if isVirtual}}

Download our virtual Android device, enroll it with WSO2 - Device Cloud and try it out!

+ Device Cloud and try it out! @@ -79,11 +79,11 @@
-{{#if isCloud}} -
- {{#if isVirtual}} -
-
Step 1
+
+ {{#if isCloud}} +
+
Step 1
+ {{#if isVirtual}}
  1. Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.
  2. @@ -107,97 +107,101 @@
-
- {{else}} -
-
Step 1
+ {{else}}

Let's start by opening the Android agent on your device.
Tap on WSO2 Device Management Agent.

-
- {{/if}} + {{/if}} +
Step 2
-

Enter your : -

+

Enter your :

    -
  • Organization: {{@user.domain}}
  • Username: {{@user.username}}
  • Password: Your Cloud password.
- +
Step 3
-

To successfully register the virtual device,

+

To successfully register the device,

  • Tap ALLOW to provide the necessary permissions.
  • Tap ACTIVATE to enable the device administrator.
-{{else}} -
+ {{else}}
Step 1
{{#if isVirtual}} -
    -
  1. Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.
  2. -
  3. Download and install the Android SDK. -
      -
    • If you already have an Android SDK on your computer, please provide the location of the - SDK. -
    • -
    • Else, this tool will download and install the minimum SDK components required to run the - emulator. - This is a one-time process. -
    • -
    -
  4. -
  5. Next, you will be asked to create an AVD: -
      -
    • If you don't have one, the WSO2_AVD will be created for you.
    • -
    • Else, you can use an existing AVD to try out IoT Android agent.
    • -
    -
  6. -
+
+
    +
  1. Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.
  2. +
  3. Download and install the Android SDK. +
      +
    • If you already have an Android SDK on your computer, please provide the location of + the + SDK. +
    • +
    • Else, this tool will download and install the minimum SDK components required to run + the + emulator. + This is a one-time process. +
    • +
    +
  4. +
  5. Next, you will be asked to create an AVD: +
      +
    • If you don't have one, the WSO2_AVD will be created for you.
    • +
    • Else, you can use an existing AVD to try out IoT Android agent.
    • +
    +
  6. +
+
{{else}} -

Let's start by installing the Android agent on your device. Open the downloaded file, and tap - INSTALL.

+
+

Let's start by installing the Android agent on your device. Open the downloaded file, and tap + INSTALL.

+
{{/if}}
Step 2
-

Tap Skip to proceed with the default enrollment process.

+
+

Tap Skip to proceed with the default enrollment process.

+
Step 3
-

Enter the server address based on your environment, in the text box provided.

+
+

Enter the server address based on your environment, in the text box provided.

+
Step 4
-

Enter your: -

-

    -
  • Organization: {{@user.domain}}
  • -
  • Username: {{@user.username}}
  • -
  • Password: Your password.
  • -
+
+

Enter your:

+
    +
  • Organization: {{@user.domain}}
  • +
  • Username: {{@user.username}}
  • +
  • Password: Your password.
  • +
+
-{{/if}} - + {{/if}}
{{#zone "topCss"}} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js index a85a187d7f..881806f4c5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js @@ -19,21 +19,6 @@ function onRequest(context) { var viewModel = {}; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; - //uncomment this to enable analytics artifact deployment - //var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; - //var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/android/status"; - //serviceInvokers.XMLHttp.get( - // url, function (responsePayload) { - // var responseContent = responsePayload.status; - // new Log().error(responseContent); - // if ("204" == responsePayload.status) { - // viewModel["displayStatus"] = "Display"; - // } - // }, - // function (responsePayload) { - // //do nothing. - // } - //); var isCloud = devicemgtProps["isCloud"]; viewModel["isVirtual"] = request.getParameter("type") == 'virtual'; viewModel["isCloud"] = isCloud; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml index 7231a1ddc7..bc13b1bfd2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml @@ -22,7 +22,7 @@ android-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java index f5b762db02..fb8ef11775 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java @@ -20,7 +20,11 @@ package org.wso2.carbon.device.mgt.mobile.android.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.*; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.DeviceManager; +import org.wso2.carbon.device.mgt.common.InitialOperationConfig; +import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; +import org.wso2.carbon.device.mgt.common.ProvisioningConfig; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; @@ -94,7 +98,8 @@ public class AndroidDeviceManagementService implements DeviceManagementService { HashMap config = new HashMap<>(); config.put(FCM_API_KEY, this.getConfigProperty(configuration, FCM_API_KEY)); config.put(FCM_SENDER_ID, this.getConfigProperty(configuration, FCM_SENDER_ID)); - return new PushNotificationConfig(AndroidPluginConstants.NotifierType.FCM, config); + return new PushNotificationConfig(AndroidPluginConstants.NotifierType.FCM, false, + config); } } } diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml index 1dc78eea6c..5b6e8c8e00 100644 --- a/components/mobile-plugins/android-plugin/pom.xml +++ b/components/mobile-plugins/android-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/components/mobile-plugins/pom.xml b/components/mobile-plugins/pom.xml index 0c9b547d89..1ce4c04874 100644 --- a/components/mobile-plugins/pom.xml +++ b/components/mobile-plugins/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../../pom.xml diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml index 54e401c7ce..18b1ed7d0f 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml @@ -21,7 +21,7 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml @@ -265,6 +265,11 @@ org.wso2.carbon.device.mgt.common provided + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.windows + provided + org.wso2.carbon.devicemgt org.wso2.carbon.webapp.authenticator.framework diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java index 7a81fdd102..d6b51faba6 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java @@ -19,6 +19,7 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.common.util; import org.apache.commons.codec.binary.Base64; +import org.apache.http.auth.AUTH; import org.apache.ws.security.WSSecurityException; import org.apache.ws.security.handler.RequestData; import org.apache.ws.security.message.token.BinarySecurity; @@ -32,6 +33,9 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.AuthenticationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.OAuthTokenValidationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException; +import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; import java.util.HashMap; @@ -94,12 +98,17 @@ public class BSTValidator implements Validator { private boolean authenticate(String binarySecurityToken, AuthenticationInfo authenticationInfo) throws AuthenticationException { WindowsAPIUtils.startTenantFlow(authenticationInfo); - if (DeviceUtil.getCacheEntry(binarySecurityToken) != null) { - CacheEntry cacheentry = (CacheEntry) DeviceUtil.getCacheEntry(binarySecurityToken); - String username = cacheentry.getUsername(); - return username != null; - } else { - return false; + MobileCacheEntry cacheEntry; + try { + cacheEntry = DeviceUtil.getTokenEntry(binarySecurityToken); + if (cacheEntry != null) { + String username = cacheEntry.getUsername(); + return username != null; + } else { + return false; + } + } catch (WindowsDeviceEnrolmentException e) { + throw new AuthenticationException("Authentication failure when fetching token entry", e); } } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java index b378ae8c9b..51cd42b286 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java @@ -18,14 +18,17 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.common.util; -import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException; +import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; +import org.wso2.carbon.device.mgt.mobile.windows.impl.util.WindowsUtils; -import javax.cache.Cache; -import javax.cache.CacheConfiguration; -import javax.cache.CacheManager; -import javax.cache.Caching; import java.util.UUID; -import java.util.concurrent.TimeUnit; /** * Class for generate random token for XCEP and WSTEP. @@ -36,45 +39,106 @@ public class DeviceUtil { private static final String TOKEN_CACHE = "TOKEN_CACHE"; private static final long CACHE_DURATION = 15l; private static boolean isContextCacheInitialized = false; + private static WindowsTokenService tokenService; + + private static final Log log = LogFactory.getLog(DeviceUtil.class); + + static { + try { + tokenService = WindowsUtils.getEnrollmentTokenService(); + } catch (WindowsDeviceMgtPluginException e) { + log.error("WindowsTokenService cannot be initialized.", e); + } + } public static String generateRandomToken() { return String.valueOf(UUID.randomUUID()); } - public static void persistChallengeToken(String token, String deviceID, String username) { - - Object objCacheEntry = getCacheEntry(token); - CacheEntry cacheEntry; - if (objCacheEntry == null) { - cacheEntry = new CacheEntry(); - cacheEntry.setUsername(username); - } else { - cacheEntry = (CacheEntry) objCacheEntry; - } - if (deviceID != null) { - cacheEntry.setDeviceID(deviceID); + public static void persistChallengeToken(String token, String deviceID, String username) + throws WindowsDeviceEnrolmentException { + try { + if(tokenService == null) { + tokenService = WindowsUtils.getEnrollmentTokenService(); + } + MobileCacheEntry existingCacheEntry = tokenService.getCacheToken(token); + PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + if (existingCacheEntry == null) { + MobileCacheEntry newCacheEntry = new MobileCacheEntry(); + newCacheEntry.setDeviceID(deviceID); + newCacheEntry.setUsername(username); + newCacheEntry.setCacheToken(token); + newCacheEntry.setTenantDomain(carbonCtx.getTenantDomain()); + newCacheEntry.setTenanatID(carbonCtx.getTenantId()); + tokenService.saveCacheToken(newCacheEntry); + } else { + existingCacheEntry.setDeviceID(deviceID); + existingCacheEntry.setCacheToken(token); + tokenService.updateCacheToken(existingCacheEntry); + } + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error occured when saving cache token for device: " + deviceID; + log.error(msg); + throw new WindowsDeviceEnrolmentException(msg, e); + } catch (WindowsDeviceMgtPluginException e) { + String msg = "Error occured when retrieving enrollment token service"; + log.error(msg); + throw new WindowsDeviceEnrolmentException(msg, e); } - getTokenCache().put(token.trim(), cacheEntry); } - public static void removeToken(String token) { - getTokenCache().remove(token); + public static MobileCacheEntry getTokenEntry(String token) + throws WindowsDeviceEnrolmentException { + MobileCacheEntry tokenEntry; + try { + if (tokenService == null) { + tokenService = WindowsUtils.getEnrollmentTokenService(); + } + tokenEntry = tokenService.getCacheToken(token); + } catch (WindowsDeviceMgtPluginException e) { + String msg = "Error occured when retrieving enrollment token service."; + log.error(msg); + throw new WindowsDeviceEnrolmentException(msg, e); + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error occured when retrieving enrollment token."; + log.error(msg); + throw new WindowsDeviceEnrolmentException(msg, e); + } + return tokenEntry; } - public static Object getCacheEntry(String token) { - return getTokenCache().get(token); + public static MobileCacheEntry getTokenEntryFromDeviceId(String deviceId) + throws WindowsDeviceEnrolmentException { + MobileCacheEntry tokenEntry; + try { + if (tokenService == null) { + tokenService = WindowsUtils.getEnrollmentTokenService(); + } + tokenEntry = tokenService.getCacheTokenFromDeviceId(deviceId); + } catch (WindowsDeviceMgtPluginException e) { + String msg = "Error occured when retrieving enrollment token service."; + log.error(msg); + throw new WindowsDeviceEnrolmentException(msg, e); + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error occured when retrieving enrollment token."; + log.error(msg); + throw new WindowsDeviceEnrolmentException(msg, e); + } + return tokenEntry; } - private static Cache getTokenCache() { - CacheManager contextCacheManager = Caching.getCacheManager(TOKEN_CACHE_MANAGER). - getCache(TOKEN_CACHE).getCacheManager(); - if (!isContextCacheInitialized) { - return Caching.getCacheManager(TOKEN_CACHE_MANAGER).getCache(TOKEN_CACHE); - } else { - isContextCacheInitialized = true; - return contextCacheManager.createCacheBuilder(TOKEN_CACHE_MANAGER).setExpiry( - CacheConfiguration.ExpiryType.MODIFIED, - new CacheConfiguration.Duration(TimeUnit.MINUTES, CACHE_DURATION)).setStoreByValue(false).build(); + public static void removeTokenEntry(String token) { + try { + if (tokenService == null) { + tokenService = WindowsUtils.getEnrollmentTokenService(); + } + tokenService.removeCacheToken(token); + } catch (WindowsDeviceMgtPluginException e) { + String msg = "Error occured when retrieving enrollment token service."; + log.error(msg); + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error occured when removing enrollment token."; + log.error(msg); } } } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java index b8e9287e43..25f963ab38 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java @@ -22,6 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONException; import org.json.JSONObject; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java index d45455f0cc..ee3d62c9ca 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java @@ -44,6 +44,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlCrede import org.wso2.carbon.device.mgt.mobile.windows.api.services.enrollment.EnrollmentService; import org.wso2.carbon.device.mgt.mobile.windows.api.services.enrollment.beans.*; import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.beans.WindowsDevice; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; import org.xml.sax.SAXException; @@ -296,7 +297,7 @@ public class EnrollmentServiceImpl implements EnrollmentService { //CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(headerBst); // String userName = cacheEntry.getUsername(); authNameNode.setTextContent(userName); - DeviceUtil.removeToken(headerBst); + DeviceUtil.removeTokenEntry(headerBst); String password = DeviceUtil.generateRandomToken(); Node passwordAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_PASSWORD_POSITION); NamedNodeMap appSrvPasswordAttribute = passwordAuthPosition.getAttributes(); @@ -351,7 +352,12 @@ public class EnrollmentServiceImpl implements EnrollmentService { * @return User for given token. */ private String getRequestedUser(String bst) { - CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(bst); + MobileCacheEntry cacheEntry = null; + try { + cacheEntry = DeviceUtil.getTokenEntry(bst); + } catch (WindowsDeviceEnrolmentException e) { + + } return cacheEntry.getUsername(); } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java index 38dfde51de..ae0e59a9ce 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java @@ -43,6 +43,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.operations.*; import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.*; import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.DeviceInfo; import org.wso2.carbon.device.mgt.mobile.windows.api.services.DeviceManagementService; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -80,14 +81,18 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlHeader.getSource(). getLocURI()); msgId = syncmlHeader.getMsgID(); + if ((PluginConstants.SyncML.SYNCML_FIRST_MESSAGE_ID == msgId) && (PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId)) { token = syncmlHeader.getCredential().getData(); - CacheEntry cacheToken = (CacheEntry) DeviceUtil.getCacheEntry(token); + MobileCacheEntry cacheToken = DeviceUtil.getTokenEntry(token); + DeviceUtil.persistChallengeToken(token, deviceIdentifier.getId(), user); + PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + carbonCtx.setTenantId(cacheToken.getTenanatID(), true); if ((cacheToken.getUsername() != null) && (cacheToken.getUsername().equals(user))) { - if (modifyEnrollWithMoreDetail(request)) { + if (modifyEnrollWithMoreDetail(request, cacheToken.getTenantDomain(), cacheToken.getTenanatID())) { pendingOperations = operationHandler.getPendingOperations(syncmlDocument); response = operationReply.generateReply(syncmlDocument, pendingOperations); return Response.status(Response.Status.OK).entity(response).build(); @@ -102,6 +107,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { return Response.status(Response.Status.UNAUTHORIZED).entity(msg).build(); } } else { + MobileCacheEntry cacheToken = DeviceUtil.getTokenEntryFromDeviceId(deviceIdentifier.getId()); + PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + carbonCtx.setTenantId(cacheToken.getTenanatID()); if ((syncmlDocument.getBody().getAlert() != null)) { if (!syncmlDocument.getBody().getAlert().getData().equals(Constants.DISENROLL_ALERT_DATA)) { pendingOperations = operationHandler.getPendingOperations(syncmlDocument); @@ -152,7 +160,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { * @throws WindowsDeviceEnrolmentException * @throws WindowsOperationException */ - private boolean modifyEnrollWithMoreDetail(Document request) throws WindowsDeviceEnrolmentException, + private boolean modifyEnrollWithMoreDetail(Document request, String tenantDomain, int tenantId) throws WindowsDeviceEnrolmentException, WindowsOperationException { String devMan = null; @@ -177,6 +185,8 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { user = syncmlDocument.getHeader().getSource().getLocName(); AuthenticationInfo authenticationInfo = new AuthenticationInfo(); authenticationInfo.setUsername(user); + authenticationInfo.setTenantId(tenantId); + authenticationInfo.setTenantDomain(tenantDomain); WindowsAPIUtils.startTenantFlow(authenticationInfo); DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlDocument. getHeader().getSource().getLocURI()); diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java index 4cc2f0ac82..356035f040 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java @@ -22,12 +22,15 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.common.*; +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.PluginConstants; -import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlMessageFormatException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlOperationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException; @@ -35,10 +38,20 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDe import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.AuthenticationInfo; import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.DeviceUtil; import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.WindowsAPIUtils; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.ItemTag; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.ReplaceTag; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.SyncmlDocument; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.SyncmlHeader; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.WindowsOperationException; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.Constants; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.DeviceInfo; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.OperationHandler; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.OperationReply; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlGenerator; +import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlParser; import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.SyncmlService; import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.beans.WindowsDevice; -import org.wso2.carbon.device.mgt.mobile.windows.api.operations.*; -import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.*; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -143,11 +156,11 @@ public class SyncmlServiceImpl implements SyncmlService { if ((PluginConstants.SyncML.SYNCML_FIRST_MESSAGE_ID == msgId) && (PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId)) { token = syncmlHeader.getCredential().getData(); - CacheEntry cacheToken = (CacheEntry) DeviceUtil.getCacheEntry(token); + MobileCacheEntry cacheToken = DeviceUtil.getTokenEntry(token); if ((cacheToken.getUsername() != null) && (cacheToken.getUsername().equals(user))) { - if (enrollDevice(request)) { + if (enrollDevice(request, cacheToken.getTenantDomain(), cacheToken.getTenanatID())) { deviceInfoOperations = deviceInfo.getDeviceInfo(); response = generateReply(syncmlDocument, deviceInfoOperations); return Response.status(Response.Status.OK).entity(response).build(); @@ -163,7 +176,8 @@ public class SyncmlServiceImpl implements SyncmlService { } } else if (PluginConstants.SyncML.SYNCML_SECOND_MESSAGE_ID == msgId && PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId) { - if (enrollDevice(request)) { + PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + if (enrollDevice(request, carbonCtx.getTenantDomain(), carbonCtx.getTenantId())) { return Response.ok().entity(generateReply(syncmlDocument, null)).build(); } else { String msg = "Error occurred in modify enrollment."; @@ -223,7 +237,7 @@ public class SyncmlServiceImpl implements SyncmlService { * @throws WindowsDeviceEnrolmentException * @throws WindowsOperationException */ - private boolean enrollDevice(Document request) throws WindowsDeviceEnrolmentException, + private boolean enrollDevice(Document request, String tenantDomain, int tenantId) throws WindowsDeviceEnrolmentException, WindowsOperationException { String osVersion; @@ -256,6 +270,8 @@ public class SyncmlServiceImpl implements SyncmlService { user = syncmlDocument.getHeader().getSource().getLocName(); AuthenticationInfo authenticationInfo = new AuthenticationInfo(); authenticationInfo.setUsername(user); + authenticationInfo.setTenantDomain(tenantDomain); + authenticationInfo.setTenantId(tenantId); WindowsAPIUtils.startTenantFlow(authenticationInfo); if (log.isDebugEnabled()) { diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java index a749214bac..f71aa52e28 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java @@ -26,14 +26,17 @@ import org.apache.cxf.headers.Header; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.jaxws.context.WrappedMessageContext; import org.apache.cxf.message.Message; -import org.w3c.dom.*; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException; import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.mobile.windows.api.common.PluginConstants; -import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.CertificateGenerationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlMessageFormatException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WAPProvisioningException; @@ -46,6 +49,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.Additi import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.BinarySecurityToken; import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.RequestSecurityTokenResponse; import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.RequestedSecurityToken; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; import org.xml.sax.SAXException; import javax.annotation.Resource; @@ -293,10 +297,10 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe Node userNameAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_USERNAME_POSITION); NamedNodeMap appServerAttribute = userNameAuthPosition.getAttributes(); Node authNameNode = appServerAttribute.getNamedItem(PluginConstants.CertificateEnrolment.VALUE); - CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(headerBst); + MobileCacheEntry cacheEntry = DeviceUtil.getTokenEntry(headerBst); String userName = cacheEntry.getUsername(); authNameNode.setTextContent(cacheEntry.getUsername()); - DeviceUtil.removeToken(headerBst); + DeviceUtil.removeTokenEntry(headerBst); String password = DeviceUtil.generateRandomToken(); Node passwordAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_PASSWORD_POSITION); NamedNodeMap appSrvPasswordAttribute = passwordAuthPosition.getAttributes(); diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml index 25004b38bb..ae8edf1a16 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml @@ -23,13 +23,13 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.windows.ui - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Carbon - Mobile Windows UI pom diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml index bf5d201211..e24ebfe0b2 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml @@ -22,7 +22,7 @@ windows-plugin org.wso2.carbon.devicemgt-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml @@ -64,6 +64,7 @@ org.wso2.carbon.context, org.wso2.carbon.utils.*, org.wso2.carbon.device.mgt.common.*, + org.wso2.carbon.device.mgt.core.dao.*, org.wso2.carbon.ndatasource.core, org.wso2.carbon.policy.mgt.common.*, org.wso2.carbon.registry.core, diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenService.java new file mode 100644 index 0000000000..851a108c02 --- /dev/null +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenService.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, 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. + */ +package org.wso2.carbon.device.mgt.mobile.windows.impl; + +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; + +public interface WindowsTokenService { + void saveCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException; + void updateCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException; + MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException; + MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) throws MobileDeviceManagementDAOException; + void removeCacheToken(String token) throws MobileDeviceManagementDAOException; +} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java new file mode 100644 index 0000000000..68c40595fc --- /dev/null +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java @@ -0,0 +1,81 @@ +package org.wso2.carbon.device.mgt.mobile.windows.impl; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.TransactionManagementException; +import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsEnrollmentTokenDAOImpl; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; + +public class WindowsTokenServiceImpl implements WindowsTokenService { + + private static final Log log = LogFactory.getLog(WindowsTokenServiceImpl.class); + private static WindowsEnrollmentTokenDAO windowsEnrollmentTokenDAO; + + public WindowsTokenServiceImpl() { + WindowsDAOFactory windowsDAOFactory = new WindowsDAOFactory(); + windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl(); + } + + @Override + public void saveCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException { + try { + WindowsDAOFactory.beginTransaction(); + windowsEnrollmentTokenDAO.addCacheToken(entry); + WindowsDAOFactory.commitTransaction(); + } finally { + WindowsDAOFactory.closeConnection(); + } + } + + @Override + public void updateCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException { + try { + WindowsDAOFactory.beginTransaction(); + windowsEnrollmentTokenDAO.updateCacheToken(entry); + WindowsDAOFactory.commitTransaction(); + } finally { + WindowsDAOFactory.closeConnection(); + } + } + + @Override + public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException { + MobileCacheEntry cacheEntry = null; + try { + WindowsDAOFactory.beginTransaction(); + cacheEntry = windowsEnrollmentTokenDAO.getCacheToken(token); + WindowsDAOFactory.commitTransaction(); + } finally { + WindowsDAOFactory.closeConnection(); + } + return cacheEntry; + } + + @Override public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) + throws MobileDeviceManagementDAOException { + MobileCacheEntry cacheEntry = null; + try { + WindowsDAOFactory.beginTransaction(); + cacheEntry = windowsEnrollmentTokenDAO.getCacheTokenFromDeviceId(deviceId); + WindowsDAOFactory.commitTransaction(); + } finally { + WindowsDAOFactory.closeConnection(); + } + return cacheEntry; + } + + @Override + public void removeCacheToken(String token) throws MobileDeviceManagementDAOException { + try { + WindowsDAOFactory.beginTransaction(); + windowsEnrollmentTokenDAO.deleteCacheToken(token); + WindowsDAOFactory.commitTransaction(); + } finally { + WindowsDAOFactory.closeConnection(); + } + } +} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java index 6bbdf572ff..760a8a5fd8 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java @@ -21,9 +21,13 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException; import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsDeviceDAOImpl; import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsFeatureDAOImpl; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; @@ -35,7 +39,18 @@ public class WindowsDAOFactory extends AbstractMobileDeviceManagementDAOFactory private static ThreadLocal currentConnection = new ThreadLocal<>(); public WindowsDAOFactory() { - this.dataSource = getDataSourceMap().get(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); +// this.dataSource = getDataSourceMap().get(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); + String dataSourceName = "jdbc/MobileWindowsDM_DS"; + initDAO(dataSourceName); + } + + public void initDAO(String datasourceName) { + try { + Context ctx = new InitialContext(); + dataSource = (DataSource) ctx.lookup(datasourceName); + } catch (NamingException e) { + + } } @Override diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsEnrollmentTokenDAO.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsEnrollmentTokenDAO.java new file mode 100644 index 0000000000..9ab0a2b736 --- /dev/null +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsEnrollmentTokenDAO.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017, 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. + */ +package org.wso2.carbon.device.mgt.mobile.windows.impl.dao; + +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; + +public interface WindowsEnrollmentTokenDAO { + + MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException; + + MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) throws MobileDeviceManagementDAOException; + + boolean addCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException; + + boolean updateCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException; + + boolean deleteCacheToken(String mobileDeviceId) throws MobileDeviceManagementDAOException; +} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsEnrollmentTokenDAOImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsEnrollmentTokenDAOImpl.java new file mode 100644 index 0000000000..338818e791 --- /dev/null +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsEnrollmentTokenDAOImpl.java @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2017, 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. + */ +package org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl; + +import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.util.MobileDeviceManagementDAOUtil; +import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry; +import org.wso2.carbon.device.mgt.mobile.windows.impl.util.WindowsPluginConstants; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +public class WindowsEnrollmentTokenDAOImpl implements WindowsEnrollmentTokenDAO { + + public WindowsEnrollmentTokenDAOImpl() { + } + + @Override + public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException { + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + MobileCacheEntry cacheEntry = null; + try { + conn = WindowsDAOFactory.getConnection(); + String selectDBQuery = "SELECT TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, USERNAME, OWNERSHIP " + + "FROM WINDOWS_ENROLLMENT_TOKEN WHERE ENROLLMENT_TOKEN = ?"; + stmt = conn.prepareStatement(selectDBQuery); + stmt.setString(1, token); + rs = stmt.executeQuery(); + + while (rs.next()) { + cacheEntry = new MobileCacheEntry(); + cacheEntry.setDeviceID(rs.getString(WindowsPluginConstants.DEVICE_ID)); + cacheEntry.setTenantDomain(rs.getString(WindowsPluginConstants.TENANT_DOMAIN)); + cacheEntry.setTenanatID(rs.getInt(WindowsPluginConstants.TENANT_ID)); + cacheEntry.setUsername(rs.getString(WindowsPluginConstants.USER_NAME)); + cacheEntry.setOwnership(rs.getString(WindowsPluginConstants.OWNERSHIP)); + } + } catch (SQLException e) { + throw new MobileDeviceManagementDAOException("Error occurred while fetching the Windows device token for the enrollment token '" + + token + "' from the Windows db.", e); + } + return cacheEntry; + } + + @Override public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) + throws MobileDeviceManagementDAOException { + Connection conn; + PreparedStatement stmt = null; + ResultSet rs = null; + MobileCacheEntry cacheEntry = null; + try { + conn = WindowsDAOFactory.getConnection(); + String selectDBQuery = "SELECT TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, USERNAME, OWNERSHIP " + + "FROM WINDOWS_ENROLLMENT_TOKEN WHERE DEVICE_ID = ?"; + stmt = conn.prepareStatement(selectDBQuery); + stmt.setString(1, deviceId); + rs = stmt.executeQuery(); + + while (rs.next()) { + cacheEntry = new MobileCacheEntry(); + cacheEntry.setDeviceID(rs.getString(WindowsPluginConstants.DEVICE_ID)); + cacheEntry.setTenantDomain(rs.getString(WindowsPluginConstants.TENANT_DOMAIN)); + cacheEntry.setTenanatID(rs.getInt(WindowsPluginConstants.TENANT_ID)); + cacheEntry.setUsername(rs.getString(WindowsPluginConstants.USER_NAME)); + cacheEntry.setOwnership(rs.getString(WindowsPluginConstants.OWNERSHIP)); + } + } catch (SQLException e) { + throw new MobileDeviceManagementDAOException("Error occurred while fetching the Windows device token for the enrollment token '" + + deviceId + "' from the Windows db.", e); + } + return cacheEntry; + } + + @Override + public boolean addCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException { + boolean status = false; + Connection conn; + PreparedStatement stmt = null; + try { + conn = WindowsDAOFactory.getConnection(); + String sql = "INSERT INTO WINDOWS_ENROLLMENT_TOKEN(TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, " + + "USERNAME, OWNERSHIP) VALUES (?, ?, ?, ?, ?, ?)"; + stmt = conn.prepareStatement(sql); + stmt.setString(1, cacheEntry.getTenantDomain()); + stmt.setInt(2, cacheEntry.getTenanatID()); + stmt.setString(3, cacheEntry.getCacheToken()); + stmt.setString(4, cacheEntry.getDeviceID()); + stmt.setString(5, cacheEntry.getUsername()); + stmt.setString(6, cacheEntry.getOwnership()); + int rows = stmt.executeUpdate(); + if(rows > 0) { + status = true; + } + } catch (SQLException e) { + throw new MobileDeviceManagementDAOException("Error occurred while adding the Windows device enrollment token for'" + + cacheEntry.getDeviceID() + "' to the Windows db.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, null); + } + return status; + } + + @Override + public boolean updateCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException { + boolean status = false; + Connection conn; + PreparedStatement stmt = null; + try { + conn = WindowsDAOFactory.getConnection(); + String updateDBQuery = + "UPDATE WINDOWS_ENROLLMENT_TOKEN SET TENANT_DOMAIN = ?, TENANT_ID = ?, ENROLLMENT_TOKEN = ?, USERNAME = ?, " + + "DEVICE_ID = ? WHERE ENROLLMENT_TOKEN = ?"; + stmt = conn.prepareStatement(updateDBQuery); + stmt.setString(1, cacheEntry.getTenantDomain()); + stmt.setInt(2, cacheEntry.getTenanatID()); + stmt.setString(3, cacheEntry.getCacheToken()); + stmt.setString(4, cacheEntry.getUsername()); + stmt.setString(5, cacheEntry.getDeviceID()); + stmt.setString(6, cacheEntry.getCacheToken()); + int rows = stmt.executeUpdate(); + if(rows > 0) { + status = true; + } + } catch (SQLException e) { + throw new MobileDeviceManagementDAOException("Error occurred while updating the Windows device enrollment token for'" + + cacheEntry.getDeviceID() + "' to the Windows db.", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, null); + } + return status; + } + + @Override + public boolean deleteCacheToken(String mobileDeviceId) throws MobileDeviceManagementDAOException { + boolean status = false; + Connection conn; + PreparedStatement stmt = null; + try { + conn = WindowsDAOFactory.getConnection(); + String deleteDBQuery = "DELETE FROM WINDOWS_ENROLLMENT_TOKEN WHERE DEVICE_ID = ?"; + stmt = conn.prepareStatement(deleteDBQuery); + stmt.setString(1, mobileDeviceId); + int rows = stmt.executeUpdate(); + if (rows > 0) { + status = true; + } + } catch (SQLException e) { + throw new MobileDeviceManagementDAOException("Error occurred while deleting windows device '" + + mobileDeviceId + "'", e); + } finally { + MobileDeviceManagementDAOUtil.cleanupResources(stmt, null); + } + return status; + } +} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileCacheEntry.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileCacheEntry.java new file mode 100644 index 0000000000..6c138ec0ae --- /dev/null +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileCacheEntry.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017, 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. + */ +package org.wso2.carbon.device.mgt.mobile.windows.impl.dto; + +public class MobileCacheEntry { + + private String cacheToken; + private String tenantDomain; + private int tenanatID; + private String deviceID; + private String username; + private String ownership; + + public String getTenantDomain() { + return tenantDomain; + } + + public void setTenantDomain(String tenantDomain) { + this.tenantDomain = tenantDomain; + } + + public int getTenanatID() { + return tenanatID; + } + + public void setTenanatID(int tenanatID) { + this.tenanatID = tenanatID; + } + + public String getCacheToken() { + return cacheToken; + } + + public void setCacheToken(String cacheToken) { + this.cacheToken = cacheToken; + } + + public String getDeviceID() { + return deviceID; + } + + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getOwnership() { + return ownership; + } + + public void setOwnership(String ownership) { + this.ownership = ownership; + } +} diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java index d7d516b8df..a243cc9c48 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java @@ -52,5 +52,10 @@ public class WindowsPluginConstants { public static final String LANGUAGE_CODE_ENGLISH_US = "en_US"; public static final String LANGUAGE_CODE_ENGLISH_UK = "en_UK"; + //properties related to WINDOWS_ENROLLMENT_TOKEN table + public static final String TENANT_DOMAIN = "TENANT_DOMAIN"; + public static final String TENANT_ID = "TENANT_ID"; + public static final String USER_NAME = "USERNAME"; + public static final String OWNERSHIP = "OWNERSHIP"; } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java index 7fba2f5cab..994500f89e 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java @@ -18,6 +18,10 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl.util; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService; + import java.util.Map; /** @@ -32,4 +36,17 @@ public class WindowsUtils { } return deviceProperty; } + + public static WindowsTokenService getEnrollmentTokenService() throws WindowsDeviceMgtPluginException { + + PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + WindowsTokenService tokenService = (WindowsTokenService) + ctx.getOSGiService(WindowsTokenService.class, null); + + if(tokenService == null) { + String msg = "WindowsTokenService is not initialized"; + throw new WindowsDeviceMgtPluginException(msg); + } + return tokenService; + } } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java index 600aecc1c6..dd2ef82f19 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java @@ -18,6 +18,7 @@ package org.wso2.carbon.device.mgt.mobile.windows.internal; +import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService; import org.wso2.carbon.registry.core.service.RegistryService; /** @@ -26,6 +27,7 @@ import org.wso2.carbon.registry.core.service.RegistryService; public class WindowsDeviceManagementDataHolder { private RegistryService registryService; + private WindowsTokenService tokenService; private static WindowsDeviceManagementDataHolder thisInstance = new WindowsDeviceManagementDataHolder(); @@ -44,4 +46,19 @@ public class WindowsDeviceManagementDataHolder { this.registryService = registryService; } + public WindowsTokenService getTokenService() { + return tokenService; + } + + public void setTokenService(WindowsTokenService tokenService) { + this.tokenService = tokenService; + } + + public static WindowsDeviceManagementDataHolder getThisInstance() { + return thisInstance; + } + + public static void setThisInstance(WindowsDeviceManagementDataHolder thisInstance) { + WindowsDeviceManagementDataHolder.thisInstance = thisInstance; + } } diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java index fd1e661d3c..93926a93de 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java @@ -23,6 +23,8 @@ import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.ComponentContext; +import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService; +import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenServiceImpl; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.registry.core.service.RegistryService; @@ -65,6 +67,8 @@ public class WindowsDeviceManagementServiceComponent { // bundleContext.registerService(PolicyMonitoringManager.class, // new WindowsPolicyMonitoringManager(), null); + //Enrollment token service + bundleContext.registerService(WindowsTokenService.class, new WindowsTokenServiceImpl(), null); if (log.isDebugEnabled()) { log.debug("Android Mobile Device Management Service Component has been successfully activated"); @@ -114,4 +118,18 @@ public class WindowsDeviceManagementServiceComponent { WindowsDeviceManagementDataHolder.getInstance().setRegistryService(null); } + protected void setEnrollmentTokenService(WindowsTokenService service) { + if (log.isDebugEnabled()) { + log.debug("Setting windows enrollment token service provider"); + } + WindowsDeviceManagementDataHolder.getInstance().setTokenService(service); + } + + protected void unsetEnrollmentTokenService() { + if (log.isDebugEnabled()) { + log.debug("Removing windows enrollment token service provider"); + } + WindowsDeviceManagementDataHolder.getInstance().setTokenService(null); + } + } diff --git a/components/mobile-plugins/windows-plugin/pom.xml b/components/mobile-plugins/windows-plugin/pom.xml index 5fc84526e3..1a178f3a4d 100644 --- a/components/mobile-plugins/windows-plugin/pom.xml +++ b/components/mobile-plugins/windows-plugin/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml index 180dae1fc9..82eb58d1a4 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf index bc02536906..7e63903845 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf @@ -1,4 +1,9 @@ - instructions.configure = \ +instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.cdmf.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/device_management/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.cdmf.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.cdmf.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/device_management/,overwrite:true);\ \ No newline at end of file diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml index 5c03b6db62..c1a724ab08 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.iot.analytics.feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT pom WSO2 Carbon - IoT Server Analytics Feature http://wso2.org diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf index 09b6b2ec92..ffbc1a492a 100644 --- a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf +++ b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf @@ -1,4 +1,9 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\ + + diff --git a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml index 46ad5fe9f1..7701a10a52 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.iot.device.statistics.dashboard.feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT pom WSO2 Carbon - IoT Server Analytics Feature http://wso2.org diff --git a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf index 2c241844c3..ecee1af164 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf +++ b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf @@ -1,4 +1,9 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.iot.device.statistics.dashboard_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/device_management/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.iot.device.statistics.dashboard_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/device_management/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.iot.device.statistics.dashboard_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\ \ No newline at end of file diff --git a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml index 6ba0bce265..f306afa444 100644 --- a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml +++ b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins analytics-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/features/analytics-feature/pom.xml b/features/analytics-feature/pom.xml index b103e3f435..94a1e2eb05 100644 --- a/features/analytics-feature/pom.xml +++ b/features/analytics-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../../pom.xml diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml new file mode 100644 index 0000000000..b0a03ca580 --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml @@ -0,0 +1,167 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + androidsense-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature + 3.0.35-SNAPSHOT + pom + WSO2 Carbon - IoT Server Android Sense Analytics Feature + http://wso2.org + This feature contains the Android Sense Device type specific analytics implementations for the IoT Server + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.androidsense.analytics + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + unpack-analytics + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.analytics + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + unpack-geo + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.iot.geo.dashboard + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.androidsense.analytics + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + + + + + + + diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/build.properties b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/build.properties similarity index 100% rename from features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/build.properties rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/build.properties diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..f5a9c3dcc8 --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/p2.inf @@ -0,0 +1,8 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.analytics_${feature.version}/receiver/,target:${installFolder}/../../deployment/server/eventreceivers/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.analytics_${feature.version}/streams/,target:${installFolder}/../../deployment/server/eventstreams/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/carbonapps/android_sense.car);\ \ 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_sense_receiver/artifact.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/receiver/android_sense_receiver-carbon.super.xml similarity index 60% rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/receiver/android_sense_receiver-carbon.super.xml index 5f7a73ce59..727aea0283 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/receiver/android_sense_receiver-carbon.super.xml @@ -17,6 +17,11 @@ ~ under the License. --> - - android_sense_receiver.xml - + + + carbon.super/android_sense/+/data + android_sense_receiver-carbon.super + + + + diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/org.wso2.iot.android.sense_1.0.0.json b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json old mode 100755 new mode 100644 similarity index 99% rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/org.wso2.iot.android.sense_1.0.0.json rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json index 878b4b63d7..e69eb2fc0d --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/org.wso2.iot.android.sense_1.0.0.json +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json @@ -60,4 +60,4 @@ {"name": "data_sent", "type": "LONG"}, {"name": "data_received", "type": "LONG"} ] -} +} \ No newline at end of file diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml similarity index 56% rename from features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/pom.xml rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml index f586d282f6..6b865e194d 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml @@ -23,17 +23,17 @@ org.wso2.carbon.devicemgt-plugins androidsense-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 - org.wso2.carbon.device.mgt.iot.androidsense.feature - 3.0.25-SNAPSHOT + org.wso2.carbon.device.mgt.iot.androidsense.backend.feature + 3.0.35-SNAPSHOT pom - WSO2 Carbon - IoT Server Android Sense Feature + WSO2 Carbon - IoT Server Android Sense Backend Feature http://wso2.org - This feature contains the Android Sense Device type specific implementations for the IoT Server + This feature contains the Android Sense Device type specific backend implementations for the IoT Server @@ -42,6 +42,10 @@ org.wso2.carbon.device.mgt.iot.androidsense.api war + + com.h2database.wso2 + h2-database-engine + @@ -76,40 +80,54 @@ maven-dependency-plugin - unpack + copy-jaxrs-war package - unpack + copy org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.androidsense.analytics - - ${project.version} - zip - true - - ${project.build.directory}/maven-shared-archive-resources/carbonapps - - **/* - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.androidsense.ui - - ${project.version} - zip + org.wso2.carbon.device.mgt.iot.androidsense.api + war true - - ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt - - **/* + ${project.build.directory}/maven-shared-archive-resources/webapps/ + android_sense.war + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.androidsense.analytics + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + unpack-analytics package @@ -154,62 +172,8 @@ - - copy-jaxrs-war - package - - copy - - - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.androidsense.api - war - true - ${project.build.directory}/maven-shared-archive-resources/webapps/ - android_sense.war - - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - - create-android-sense-plugin-mgt-schema - package - - run - - - - - - - - - - - - - - - - - - - - - - - - + + org.wso2.maven @@ -223,7 +187,7 @@ p2-feature-gen - org.wso2.carbon.device.mgt.iot.androidsense + org.wso2.carbon.device.mgt.iot.androidsense.backend ../../../features/etc/feature.properties @@ -231,15 +195,6 @@ org.eclipse.equinox.p2.type.group:true - - org.wso2.carbon.core.server:${carbon.kernel.version} - org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version} - - - - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version} - - diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/build.properties b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..93c4b10701 --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true \ No newline at end of file diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/devicetypes/android_sense.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml similarity index 86% rename from features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/devicetypes/android_sense.xml rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml index 764aa311a5..9699c5699d 100644 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/devicetypes/android_sense.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml @@ -54,12 +54,6 @@ true - - - androidsense.mqtt.adapter - 0 - true - diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..28b42a4e8a --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/p2.inf @@ -0,0 +1,17 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/android_sense/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/receiver/,target:${installFolder}/../../resources/devicetypes/android_sense/receiver/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/streams/,target:${installFolder}/../../resources/devicetypes/android_sense/streams/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/android_sense/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/android_sense.war);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/android_sense);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/devicetypes/android_sense.xml);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../resources/devicetypes/android_sense);\ \ 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_sense_receiver/android_sense_receiver.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/receiver/android_sense_receiver.xml similarity index 80% rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/receiver/android_sense_receiver.xml index 706610654b..3faeedaf09 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/receiver/android_sense_receiver.xml @@ -17,13 +17,11 @@ ~ under the License. --> - + ${tenant-domain}/android_sense/+/data - iot-mqtt - true + android_sense_receiver-${tenant-domain} - diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json new file mode 100644 index 0000000000..e69eb2fc0d --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json @@ -0,0 +1,63 @@ +{ + "name": "org.wso2.iot.android.sense", + "version": "1.0.0", + "nickName": "android_sense_stream", + "description": "This hold the device type stream of android sense", + "metaData": [ + {"name": "owner", "type": "STRING"}, + {"name": "deviceId", "type": "STRING"}, + {"name": "type", "type": "STRING"}, + {"name": "timestamp", "type": "LONG"} + ], + "payloadData": [ + {"name": "battery", "type": "INT"}, + {"name": "battery_state", "type": "STRING"}, + {"name": "battery_status", "type": "STRING"}, + {"name": "battery_temperature", "type": "INT"}, + {"name": "gps_lat", "type": "DOUBLE"}, + {"name": "gps_long", "type": "DOUBLE"}, + {"name": "accelerometer_x", "type": "FLOAT"}, + {"name": "accelerometer_y", "type": "FLOAT"}, + {"name": "accelerometer_z", "type": "FLOAT"}, + {"name": "speed_limit", "type": "FLOAT"}, + {"name": "turn_way", "type": "STRING"}, + {"name": "magnetic_x", "type": "FLOAT"}, + {"name": "magnetic_y", "type": "FLOAT"}, + {"name": "magnetic_z", "type": "FLOAT"}, + {"name": "gyroscope_x", "type": "FLOAT"}, + {"name": "gyroscope_y", "type": "FLOAT"}, + {"name": "gyroscope_z", "type": "FLOAT"}, + {"name": "light", "type": "FLOAT"}, + {"name": "pressure", "type": "FLOAT"}, + {"name": "proximity", "type": "FLOAT"}, + {"name": "gravity_x", "type": "FLOAT"}, + {"name": "gravity_y", "type": "FLOAT"}, + {"name": "gravity_z", "type": "FLOAT"}, + {"name": "rotation_x", "type": "FLOAT"}, + {"name": "rotation_y", "type": "FLOAT"}, + {"name": "rotation_z", "type": "FLOAT"}, + {"name": "word", "type": "STRING"}, + {"name": "word_sessionId", "type": "STRING"}, + {"name": "word_status", "type": "STRING"}, + {"name": "beacon_major", "type": "INT"}, + {"name": "beacon_minor", "type": "INT"}, + {"name": "beacon_proximity", "type": "STRING"}, + {"name": "beacon_uuid", "type": "INT"}, + {"name": "call_number", "type": "STRING"}, + {"name": "call_type", "type": "STRING"}, + {"name": "call_start_time", "type": "LONG"}, + {"name": "call_end_time", "type": "LONG"}, + {"name": "screen_state", "type": "STRING"}, + {"name": "audio_playing", "type": "BOOL"}, + {"name": "headset_on", "type": "BOOL"}, + {"name": "music_volume", "type": "INT"}, + {"name": "activity_type", "type": "INT"}, + {"name": "confidence", "type": "INT"}, + {"name": "sms_number", "type": "STRING"}, + {"name": "application_name", "type": "STRING"}, + {"name": "action", "type": "STRING"}, + {"name": "data_type", "type": "STRING"}, + {"name": "data_sent", "type": "LONG"}, + {"name": "data_received", "type": "LONG"} + ] +} \ No newline at end of file diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/datasources/androidsense-datasources.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/datasources/androidsense-datasources.xml deleted file mode 100644 index 9a1374b09e..0000000000 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/datasources/androidsense-datasources.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - AndroidSenseDM_DB - The datasource used for the Android Sense database - - jdbc/AndroidSenseDM_DB - - - - jdbc:h2:repository/database/AndroidSenseDM_DB;DB_CLOSE_ON_EXIT=FALSE - - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/h2.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/h2.sql deleted file mode 100644 index ee3bfa73a4..0000000000 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/h2.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `ANDROID_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `ANDROID_SENSE_DEVICE` ( - `ANDROID_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`ANDROID_DEVICE_ID`) ); diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mssql.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mssql.sql deleted file mode 100644 index cf677ff074..0000000000 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mssql.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `ANDROID_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS ANDROID_SENSE_DEVICE ( - ANDROID_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (ANDROID_DEVICE_ID) ); diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mysql.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mysql.sql deleted file mode 100644 index 4637b4daf2..0000000000 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mysql.sql +++ /dev/null @@ -1,12 +0,0 @@ --- ----------------------------------------------------- --- Table `ANDROID_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `ANDROID_SENSE_DEVICE` ( - `ANDROID_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`ANDROID_DEVICE_ID`) ) -ENGINE = InnoDB; - - - - diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/oracle.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/oracle.sql deleted file mode 100644 index 6f8537eb82..0000000000 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/oracle.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `ANDROID_DEVICE` --- ----------------------------------------------------- -CREATE TABLE ANDROID_SENSE_DEVICE ( - ANDROID_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (ANDROID_DEVICE_ID) ); diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/postgresql.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/postgresql.sql deleted file mode 100644 index 987f4992b3..0000000000 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/postgresql.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `ANDROID_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS ANDROID_SENSE_DEVICE ( - ANDROID_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (ANDROID_DEVICE_ID)); diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/p2.inf deleted file mode 100644 index ef478b729d..0000000000 --- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,31 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/carbonapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/android_sense,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/datasources/,target:${installFolder}/../../../conf/datasources/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/database/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ - -instructions.unconfigure = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/android_sense.war);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/android_sense);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/android_sense);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/android_sense);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../conf/datasources/androidsense-datasources.xml);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/database/AndroidSenseDM_DB.h2.db);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.realtime.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/carbonapps/android_sense.car);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/android_sense.xml);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/android_sense.car);\ \ No newline at end of file diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml new file mode 100644 index 0000000000..6b46909b99 --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml @@ -0,0 +1,129 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + androidsense-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.androidsense.ui.feature + 3.0.35-SNAPSHOT + pom + WSO2 Carbon - IoT Server Android Sense UI Feature + http://wso2.org + This feature contains the Android Sense Device type UI specific implementations for the IoT Server + + + + + com.h2database.wso2 + h2-database-engine + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.androidsense.ui + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt + + **/* + + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.androidsense.ui + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + + + + + + + diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/build.properties b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..93c4b10701 --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true \ No newline at end of file diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/devicetypes/android_sense.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/devicetypes/android_sense.xml new file mode 100644 index 0000000000..9699c5699d --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/devicetypes/android_sense.xml @@ -0,0 +1,65 @@ + + + + + + + Add Keywords + Send keywords to the device + + + + + + + + Add Threshold + Send Threshold to the device + + + + + + + + Remove words + Remove Threshold from the device + + + + + + + + + + true + + + + true + + + + en_US + 1.0.0 + This is license text + + + \ No newline at end of file diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..5f2ce03b37 --- /dev/null +++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/p2.inf @@ -0,0 +1,12 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.ui_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.analytics-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.realtime.analytics-view);\ \ No newline at end of file diff --git a/features/device-types-feature/androidsense-plugin-feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/pom.xml index 06d0ca6501..7b3f652233 100644 --- a/features/device-types-feature/androidsense-plugin-feature/pom.xml +++ b/features/device-types-feature/androidsense-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml @@ -33,7 +33,9 @@ http://wso2.org - org.wso2.carbon.device.mgt.iot.androidsense.feature + org.wso2.carbon.device.mgt.iot.androidsense.ui.feature + org.wso2.carbon.device.mgt.iot.androidsense.backend.feature + org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml new file mode 100644 index 0000000000..6241d72c2d --- /dev/null +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml @@ -0,0 +1,144 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + arduino-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.arduino.analytics.feature + pom + WSO2 Carbon - IoT Server Arduino Analytics Feature + http://wso2.org + This feature contains the Arduino Device type specific anaytics implementations for the IoT Server + + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.arduino.analytics + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + unpack-analytics + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.analytics + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.arduino.analytics + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + + + + + + + diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/build.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/build.properties similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/build.properties rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/build.properties diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..3e136c2e5b --- /dev/null +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/p2.inf @@ -0,0 +1,6 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../analytics/repository/deployment/server/carbonapps/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/arduino.car);\ \ No newline at end of file diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml similarity index 74% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/pom.xml rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml index b02d869dc0..4c5f33d9df 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml @@ -23,16 +23,16 @@ org.wso2.carbon.devicemgt-plugins arduino-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 - org.wso2.carbon.device.mgt.iot.arduino.feature + org.wso2.carbon.device.mgt.iot.arduino.backend.feature pom - WSO2 Carbon - IoT Server Arduino Feature + WSO2 Carbon - IoT Server Arduino Backend Feature http://wso2.org - This feature contains the Arduino Device type specific implementations for the IoT Server + This feature contains the Arduino Device type backend specific implementations for the IoT Server @@ -78,43 +78,36 @@ org.apache.maven.plugins maven-dependency-plugin - - unpack - package - - unpack - - - + + copy-jaxrs-war + package + + copy + + + org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.arduino.analytics + org.wso2.carbon.device.mgt.iot.arduino.api - ${project.version} - zip + war true - - ${project.build.directory}/maven-shared-archive-resources/carbonapps - - **/* - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.arduino.ui - - ${project.version} - zip - true - - ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt + ${project.build.directory}/maven-shared-archive-resources/webapps/ - **/* - - - - + arduino.war + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + - unpack-analytics + unpack package unpack @@ -123,7 +116,8 @@ org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.analytics + org.wso2.carbon.device.mgt.iot.arduino.analytics + ${project.version} zip true @@ -136,28 +130,30 @@ - copy-jaxrs-war + unpack-analytics package - copy + unpack org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.arduino.api - - war + org.wso2.carbon.device.mgt.iot.analytics + ${project.version} + zip true - ${project.build.directory}/maven-shared-archive-resources/webapps/ - - arduino.war + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + org.wso2.maven carbon-p2-plugin @@ -170,7 +166,7 @@ p2-feature-gen - org.wso2.carbon.device.mgt.iot.arduino + org.wso2.carbon.device.mgt.iot.arduino.backend ../../../features/etc/feature.properties @@ -184,16 +180,10 @@ org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version} - - - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version} - - - diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.h b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.h similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.h rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.h diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.ino similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.ino rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.ino diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/Connect.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/Connect.ino similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/Connect.ino rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/Connect.ino diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PollServer.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PollServer.ino similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PollServer.ino rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PollServer.ino diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PushData.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PushData.ino similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PushData.ino rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PushData.ino diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/deviceType.png b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/deviceType.png similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/deviceType.png rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/deviceType.png diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/sketch.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/sketch.properties similarity index 100% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/sketch.properties rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/sketch.properties diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/build.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/build.properties similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/build.properties rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/build.properties diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/devicetypes/arduino.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml similarity index 94% rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/devicetypes/arduino.xml rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml index 7871e1d424..c651c04e7f 100644 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/devicetypes/arduino.xml +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml @@ -31,7 +31,7 @@ - false + true diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..2d9b5bc71b --- /dev/null +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/p2.inf @@ -0,0 +1,18 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/arduino/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/arduino/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/arduino/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino.war);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/arduino.xml);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/arduino);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/arduino.car);\ \ No newline at end of file diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/p2.inf deleted file mode 100644 index 081d93a641..0000000000 --- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,26 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/arduino/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/arduino/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/carbonapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ - -instructions.unconfigure = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino.war);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/arduino);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/arduino.car);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/arduino.xml);\ \ No newline at end of file diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml new file mode 100644 index 0000000000..e204a90921 --- /dev/null +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml @@ -0,0 +1,134 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + arduino-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.arduino.ui.feature + pom + WSO2 Carbon - IoT Server Arduino UI Feature + http://wso2.org + This feature contains the Arduino Device type UI specific implementations for the IoT Server + + + + + com.h2database.wso2 + h2-database-engine + + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.arduino.ui + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt + + **/* + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.arduino.ui + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + org.wso2.carbon.core.server:${carbon.kernel.version} + + org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version} + + + + + + + + + + diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/build.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/build.properties similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/build.properties rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/build.properties diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/devicetypes/arduino.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/devicetypes/arduino.xml new file mode 100644 index 0000000000..c651c04e7f --- /dev/null +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/devicetypes/arduino.xml @@ -0,0 +1,43 @@ + + + + + + + Control Bulb + Control Bulb on Arduino Uno + + + state + + + + + + + true + + + + en_US + 1.0.0 + This is license text + + + \ No newline at end of file diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..3ca2ec0904 --- /dev/null +++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/p2.inf @@ -0,0 +1,13 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.ui_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.analytics-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/arduino.xml);\ \ No newline at end of file diff --git a/features/device-types-feature/arduino-plugin-feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/pom.xml index f127bdfa7f..e16d7d30f4 100644 --- a/features/device-types-feature/arduino-plugin-feature/pom.xml +++ b/features/device-types-feature/arduino-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml @@ -33,7 +33,9 @@ http://wso2.org - org.wso2.carbon.device.mgt.iot.arduino.feature + org.wso2.carbon.device.mgt.iot.arduino.ui.feature + org.wso2.carbon.device.mgt.iot.arduino.backend.feature + org.wso2.carbon.device.mgt.iot.arduino.analytics.feature diff --git a/features/device-types-feature/pom.xml b/features/device-types-feature/pom.xml index eca83dd45d..36d739a1a5 100644 --- a/features/device-types-feature/pom.xml +++ b/features/device-types-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../../pom.xml 4.0.0 device-types-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT pom WSO2 Carbon - Device Management IoT Plugins Feature http://wso2.org diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml new file mode 100644 index 0000000000..73216e92c5 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml @@ -0,0 +1,144 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + raspberrypi-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature + pom + WSO2 Carbon - IoT Server RaspberryPi Analytics Feature + http://wso2.org + This feature contains the RaspberryPi Device type specific analytics implementations for the IoT Server + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.raspberrypi.analytics + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + unpack-analytics + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.analytics + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.raspberrypi.analytics + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + + + + + + + diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/build.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..9c86577d76 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..e37b5655c3 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/p2.inf @@ -0,0 +1,5 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../analytics/repository/deployment/server/carbonapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics_${feature.version}/receiver/,target:${installFolder}/../../analytics/repository/deployment/server/eventreceivers/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics_${feature.version}/streams/,target:${installFolder}/../../analytics/repository/deployment/server/eventstreams/,overwrite:true);\ diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/artifact.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/receiver/raspberrypi_receiver-carbon.super.xml similarity index 60% rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/artifact.xml rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/receiver/raspberrypi_receiver-carbon.super.xml index c9779c6934..0d8b2fd7ac 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/artifact.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/receiver/raspberrypi_receiver-carbon.super.xml @@ -16,8 +16,11 @@ ~ specific language governing permissions and limitations ~ under the License. --> - - - org.wso2.iot.raspberrypi_1.0.0.json - - + + + carbon.super/raspberrypi/+/temperature + raspberrypi_receiver-carbon.super + + + + diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/org.wso2.iot.raspberrypi_1.0.0.json b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json similarity index 100% rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/org.wso2.iot.raspberrypi_1.0.0.json rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml similarity index 65% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/pom.xml rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml index e728b99d6a..19e5612195 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml @@ -23,16 +23,16 @@ org.wso2.carbon.devicemgt-plugins raspberrypi-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 - org.wso2.carbon.device.mgt.iot.raspberrypi.feature + org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature pom - WSO2 Carbon - IoT Server RaspberryPi Feature + WSO2 Carbon - IoT Server RaspberryPi Backend Feature http://wso2.org - This feature contains the RaspberryPi Device type specific implementations for the IoT Server + This feature contains the RaspberryPi Device type specific backend implementations for the IoT Server @@ -78,41 +78,6 @@ org.apache.maven.plugins maven-dependency-plugin - - unpack - package - - unpack - - - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.raspberrypi.analytics - - ${project.version} - zip - true - - ${project.build.directory}/maven-shared-archive-resources/carbonapps - - **/* - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.raspberrypi.ui - - ${project.version} - zip - true - - ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt - - **/* - - - - copy-jaxrs-war package @@ -133,8 +98,15 @@ + + + + + org.apache.maven.plugins + maven-dependency-plugin + - unpack-analytics + unpack package unpack @@ -143,7 +115,8 @@ org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.analytics + org.wso2.carbon.device.mgt.iot.raspberrypi.analytics + ${project.version} zip true @@ -155,39 +128,26 @@ - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - create-raspberrypi-plugin-mgt-schema + unpack-analytics package - run + unpack - - - - - - - - - - - - - - - - - - + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.analytics + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + @@ -205,7 +165,7 @@ p2-feature-gen - org.wso2.carbon.device.mgt.iot.raspberrypi + org.wso2.carbon.device.mgt.iot.raspberrypi.backend ../../../features/etc/feature.properties @@ -219,11 +179,6 @@ org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version} - - - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version} - - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/Adafruit_Python_DHT.zip b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/Adafruit_Python_DHT.zip similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/Adafruit_Python_DHT.zip rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/Adafruit_Python_DHT.zip diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/README.md b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/README.md similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/README.md rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/README.md diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/RaspberryService.sh b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/RaspberryService.sh similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/RaspberryService.sh rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/RaspberryService.sh diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/deviceConfig.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/deviceConfig.properties similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/deviceConfig.properties rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/deviceConfig.properties diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/sketch.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/sketch.properties similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/sketch.properties rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/sketch.properties diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryAgent.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryAgent.py similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryAgent.py rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryAgent.py diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryStats.log b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryStats.log similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryStats.log rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryStats.log diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/httpServer.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/httpServer.py similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/httpServer.py rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/httpServer.py diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/iotUtils.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/iotUtils.py similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/iotUtils.py rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/iotUtils.py diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/mqttConnector.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/mqttConnector.py similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/mqttConnector.py rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/mqttConnector.py diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/running_mode.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/running_mode.py similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/running_mode.py rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/running_mode.py diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/startService.sh b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/startService.sh similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/startService.sh rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/startService.sh diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/testAgent.sh b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/testAgent.sh similarity index 100% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/testAgent.sh rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/testAgent.sh diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/build.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..9c86577d76 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/devicetypes/raspberrypi.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml similarity index 77% rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/devicetypes/raspberrypi.xml rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml index 85db147c6f..cc2800ea87 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/devicetypes/raspberrypi.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml @@ -31,17 +31,11 @@ - false + true true - - - raspberrypi.mqtt.adapter - 0 - true - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..fdca335457 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/p2.inf @@ -0,0 +1,25 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/raspberrypi);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/raspberrypi/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/raspberrypi/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/raspberrypi/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/receiver/,target:${installFolder}/../../resources/devicetypes/android_sense/eventreceivers/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/streams/,target:${installFolder}/../../resources/devicetypes/android_sense/eventstreams/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/android_sense/,overwrite:true);\ + + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi.war);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/raspberrypi);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/raspberrypi);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/raspberrypi.car);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/raspberrypi.xml);\ \ No newline at end of file diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/raspberrypi_receiver.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/receiver/raspberrypi_receiver.xml similarity index 80% rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/raspberrypi_receiver.xml rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/receiver/raspberrypi_receiver.xml index 1424b737e1..331a954e8b 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/raspberrypi_receiver.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/receiver/raspberrypi_receiver.xml @@ -16,11 +16,10 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + ${tenant-domain}/raspberrypi/+/temperature - iot-mqtt - true + raspberrypi_receiver-${tenant-domain} diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json new file mode 100644 index 0000000000..225db3d1c6 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json @@ -0,0 +1,16 @@ +{ + "name": "org.wso2.iot.raspberrypi", + "version": "1.0.0", + "nickName": "raspberrypi", + "description": "Temperature data received from the raspberrypi", + "metaData": [ + {"name":"owner","type":"STRING"}, + {"name":"deviceId","type":"STRING"}, + {"name":"time","type":"LONG"} + ], + "payloadData": [ + { + "name": "temperature","type": "FLOAT" + } + ] +} \ No newline at end of file diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/datasources/raspberrypi-datasources.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/datasources/raspberrypi-datasources.xml deleted file mode 100644 index 62982ef294..0000000000 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/datasources/raspberrypi-datasources.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - RaspberryPi_DB - The datasource used for the RaspberryPi database - - jdbc/RaspberryPiDM_DB - - - - jdbc:h2:repository/database/RaspberryPiDM_DB;DB_CLOSE_ON_EXIT=FALSE - - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/h2.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/h2.sql deleted file mode 100644 index 67e702ec99..0000000000 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/h2.sql +++ /dev/null @@ -1,9 +0,0 @@ - --- ----------------------------------------------------- --- Table `RASPBERRYPI_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `RASPBERRYPI_DEVICE` ( - `RASPBERRYPI_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`RASPBERRYPI_DEVICE_ID`) ); - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mssql.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mssql.sql deleted file mode 100644 index a944f4cb2e..0000000000 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mssql.sql +++ /dev/null @@ -1,9 +0,0 @@ - --- ----------------------------------------------------- --- Table `RASPBERRYPI_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS RASPBERRYPI_DEVICE ( - RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (RASPBERRYPI_DEVICE_ID) ); - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mysql.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mysql.sql deleted file mode 100644 index ad0ec54b7f..0000000000 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mysql.sql +++ /dev/null @@ -1,12 +0,0 @@ --- ----------------------------------------------------- --- Table `RASPBERRYPI_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `RASPBERRYPI_DEVICE` ( - `RASPBERRYPI_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`RASPBERRYPI_DEVICE_ID`) ) -ENGINE = InnoDB; - - - - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/oracle.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/oracle.sql deleted file mode 100644 index b72ecb564a..0000000000 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/oracle.sql +++ /dev/null @@ -1,9 +0,0 @@ - --- ----------------------------------------------------- --- Table `RASPBERRYPI_DEVICE` --- ----------------------------------------------------- -CREATE TABLE RASPBERRYPI_DEVICE ( - RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (RASPBERRYPI_DEVICE_ID) ); - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/postgresql.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/postgresql.sql deleted file mode 100644 index a944f4cb2e..0000000000 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/postgresql.sql +++ /dev/null @@ -1,9 +0,0 @@ - --- ----------------------------------------------------- --- Table `RASPBERRYPI_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS RASPBERRYPI_DEVICE ( - RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (RASPBERRYPI_DEVICE_ID) ); - diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/p2.inf deleted file mode 100644 index 935c088825..0000000000 --- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,34 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/raspberrypi/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/raspberrypi/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/raspberrypi,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/datasources/,target:${installFolder}/../../../conf/datasources/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/database/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/carbonapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ - - -instructions.unconfigure = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi.war);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/raspberrypi);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/raspberrypi);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../conf/datasources/raspberrypi-datasources.xml);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/database/RaspberryPiDM_DB.h2.db);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/raspberrypi.car);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/raspberrypi.xml);\ \ No newline at end of file diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml new file mode 100644 index 0000000000..cd944571e4 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml @@ -0,0 +1,135 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + raspberrypi-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature + pom + WSO2 Carbon - IoT Server RaspberryPi UI Feature + http://wso2.org + This feature contains the RaspberryPi Device type specific UI implementations for the IoT Server + + + + + com.h2database.wso2 + h2-database-engine + + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.raspberrypi.ui + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt + + **/* + + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.raspberrypi.ui + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + org.wso2.carbon.core.server:${carbon.kernel.version} + + org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version} + + + + + + + + + + diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/build.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..9c86577d76 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/devicetypes/raspberrypi.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/devicetypes/raspberrypi.xml new file mode 100644 index 0000000000..cc2800ea87 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/devicetypes/raspberrypi.xml @@ -0,0 +1,47 @@ + + + + + + + Control Bulb + Control Bulb on Raspberrypi + + + state + + + + + + + true + + + + true + + + + en_US + 1.0.0 + This is license text + + + \ No newline at end of file diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..619c3134b9 --- /dev/null +++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/p2.inf @@ -0,0 +1,13 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.ui_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/raspberrypi.xml);\ \ No newline at end of file diff --git a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml index dc06f58f91..68dc28f37a 100644 --- a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml +++ b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml @@ -33,7 +33,9 @@ http://wso2.org - org.wso2.carbon.device.mgt.iot.raspberrypi.feature + org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature + org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature + org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml new file mode 100644 index 0000000000..683d9ccee4 --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml @@ -0,0 +1,145 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + virtual-fire-alarm-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature + pom + WSO2 Carbon - IoT Server VirtualFireAlarm Analytics Feature + http://wso2.org + This feature contains the VirtualFireAlarm Device type specific analytics implementations for the IoT Server + + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + unpack-analytics + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.analytics + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + + + + + + + diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/build.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..9c86577d76 --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..c74ad92972 --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/p2.inf @@ -0,0 +1,8 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../analytics/repository/deployment/server/carbonapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics_${feature.version}/receiver/,target:${installFolder}/../../analytics/repository/deployment/server/eventreceivers/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics_${feature.version}/streams/,target:${installFolder}/../../analytics/repository/deployment/server/eventstreams/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/carbonapps/virtualfirealarm.car);\ \ 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_sense_streams/artifact.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/receiver/virtualfirealarm_receiver-carbon.super.xml similarity index 59% rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/artifact.xml rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/receiver/virtualfirealarm_receiver-carbon.super.xml index 44f1731391..efd5dde7ba 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/artifact.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/receiver/virtualfirealarm_receiver-carbon.super.xml @@ -16,8 +16,11 @@ ~ specific language governing permissions and limitations ~ under the License. --> - - - org.wso2.iot.android.sense_1.0.0.json - - + + + carbon.super/virtual_firealarm/+/temperature + virtualfirealarm_receiver-carbon.super + + + + diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_stream/org.wso2.iot.virtualfirealarm_1.0.0.json b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json similarity index 100% rename from components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_stream/org.wso2.iot.virtualfirealarm_1.0.0.json rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml similarity index 74% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/pom.xml rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml index 6c80377c0b..47ddc98d68 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml @@ -23,16 +23,16 @@ org.wso2.carbon.devicemgt-plugins virtual-fire-alarm-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 - org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature + org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature pom - WSO2 Carbon - IoT Server VirtualFireAlarm Feature + WSO2 Carbon - IoT Server VirtualFireAlarm Backend Feature http://wso2.org - This feature contains the VirtualFireAlarm Device type specific implementations for the IoT Server + This feature contains the VirtualFireAlarm Device type specific backend implementations for the IoT Server @@ -79,41 +79,6 @@ maven-dependency-plugin - - unpack - package - - unpack - - - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics - - ${project.version} - zip - true - - ${project.build.directory}/maven-shared-archive-resources/carbonapps - - **/* - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui - - ${project.version} - zip - true - - ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt - - **/* - - - - copy-jaxrs-war package @@ -134,7 +99,6 @@ - copy-agent-jar package @@ -162,8 +126,14 @@ + + + + org.apache.maven.plugins + maven-dependency-plugin + - unpack-analytics + unpack package unpack @@ -172,7 +142,8 @@ org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.iot.analytics + org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics + ${project.version} zip true @@ -184,40 +155,26 @@ - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - create-virtual-firealarm-plugin-mgt-schema + unpack-analytics package - run + unpack - - - - - - - - - - - - - - - - - - + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.analytics + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/carbonapps + + **/* + + @@ -235,7 +192,7 @@ p2-feature-gen - org.wso2.carbon.device.mgt.iot.virtualfirealarm + org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend ../../../features/etc/feature.properties @@ -249,11 +206,6 @@ org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version} - - - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version} - - diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/cep_query.txt b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/cep_query.txt rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/deviceConfig.properties similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/deviceConfig.properties diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/sketch.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/sketch.properties similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/sketch.properties rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/sketch.properties diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/start-device.sh b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/start-device.sh similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/start-device.sh rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/start-device.sh diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/deviceConfig.properties similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/deviceConfig.properties diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/sketch.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/sketch.properties similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/sketch.properties rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/sketch.properties diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/start-device.sh b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/start-device.sh similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/start-device.sh rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/start-device.sh diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/virtual_firealarm.jks b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/virtual_firealarm.jks similarity index 100% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/virtual_firealarm.jks rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/virtual_firealarm.jks diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/build.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..9c86577d76 --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml new file mode 100644 index 0000000000..10f1985ca6 --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml @@ -0,0 +1,61 @@ + + + + + + + Control buzzer + Control buzzer on Virtual Firealarm + + + state + + + + + + + true + + + + true + + + + + + + + + + + + + + + + + + en_US + 1.0.0 + This is license text + + + \ No newline at end of file diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..954ded23a2 --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/p2.inf @@ -0,0 +1,21 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/receiver/,target:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/receiver/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/streams/,target:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/streams/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/advanced_agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm.war);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/virtual_firealarm.xml);\ \ No newline at end of file diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_receiver/virtualfirealarm_receiver.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/receiver/virtualfirealarm_receiver.xml similarity index 80% rename from components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_receiver/virtualfirealarm_receiver.xml rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/receiver/virtualfirealarm_receiver.xml index d46fc1a567..eea9bb117f 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_receiver/virtualfirealarm_receiver.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/receiver/virtualfirealarm_receiver.xml @@ -16,11 +16,10 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + ${tenant-domain}/virtual_firealarm/+/temperature - iot-mqtt - true + virtualfirealarm_receiver-${tenant-domain} diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json new file mode 100644 index 0000000000..0ba70911ef --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json @@ -0,0 +1,16 @@ +{ + "name": "org.wso2.iot.virtualfirealarm", + "version": "1.0.0", + "nickName": "virtual_firealarm", + "description": "Temperature data received from the virtual_firealarm", + "metaData": [ + {"name":"owner","type":"STRING"}, + {"name":"deviceId","type":"STRING"}, + {"name":"time","type":"LONG"} + ], + "payloadData": [ + { + "name": "temperature","type": "FLOAT" + } + ] +} \ No newline at end of file diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/certs/wso2certs.jks b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/certs/wso2certs.jks deleted file mode 100644 index 00589cdf0d..0000000000 Binary files a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/certs/wso2certs.jks and /dev/null differ diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/datasources/virtual_firealarm-datasources.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/datasources/virtual_firealarm-datasources.xml deleted file mode 100644 index a724d94d1f..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/datasources/virtual_firealarm-datasources.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader - - - - - VirtualFireAlarmDM_DB - The datasource used for the Virtual-Firealarm database - - jdbc/VirtualFireAlarmDM_DB - - - - jdbc:h2:repository/database/VirtualFireAlarmDM_DB;DB_CLOSE_ON_EXIT=FALSE - - wso2carbon - wso2carbon - org.h2.Driver - 50 - 60000 - true - SELECT 1 - 30000 - - - - - - diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/h2.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/h2.sql deleted file mode 100644 index 160b437cbc..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/h2.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `FIREALARM_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `VIRTUAL_FIREALARM_DEVICE` ( - `VIRTUAL_FIREALARM_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`VIRTUAL_FIREALARM_DEVICE_ID`) ); diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mssql.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mssql.sql deleted file mode 100644 index 41b7e48480..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mssql.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `FIREALARM_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS VIRTUAL_FIREALARM_DEVICE ( - VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) ); diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mysql.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mysql.sql deleted file mode 100644 index 432ecbb0ef..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mysql.sql +++ /dev/null @@ -1,12 +0,0 @@ --- ----------------------------------------------------- --- Table `FIREALARM_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `VIRTUAL_FIREALARM_DEVICE` ( - `VIRTUAL_FIREALARM_DEVICE_ID` VARCHAR(45) NOT NULL , - `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (`VIRTUAL_FIREALARM_DEVICE_ID`) ) -ENGINE = InnoDB; - - - - diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/oracle.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/oracle.sql deleted file mode 100644 index 5583d16941..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/oracle.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `FIREALARM_DEVICE` --- ----------------------------------------------------- -CREATE TABLE VIRTUAL_FIREALARM_DEVICE ( - VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) ); diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/postgresql.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/postgresql.sql deleted file mode 100644 index 41b7e48480..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/postgresql.sql +++ /dev/null @@ -1,8 +0,0 @@ - --- ----------------------------------------------------- --- Table `FIREALARM_DEVICE` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS VIRTUAL_FIREALARM_DEVICE ( - VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL , - DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, - PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) ); diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf deleted file mode 100644 index 1f77296c29..0000000000 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,46 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/advanced_agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/virtual_firealarm,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/datasources/,target:${installFolder}/../../../conf/datasources/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/database/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/security/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/certs/,target:${installFolder}/../../../repository/resources/security/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/device-types/);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/carbonapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/,overwrite:true);\ - - -instructions.unconfigure = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm.war);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm_scep.war);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm_scep);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/virtual_firealarm);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../conf/datasources/virtual_firealarm-datasources.xml);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/database/VirtualFireAlarmDM_DB.h2.db);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-edit);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-wizard);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/security/wso2certs.jks);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/virtual_firealarm.xml);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/carbonapps/virtualfirealarm.car);\ \ No newline at end of file diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml new file mode 100644 index 0000000000..b9461776cb --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml @@ -0,0 +1,136 @@ + + + + + + + + org.wso2.carbon.devicemgt-plugins + virtual-fire-alarm-plugin-feature + 3.0.35-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature + pom + WSO2 Carbon - IoT Server VirtualFireAlarm UI Feature + http://wso2.org + This feature contains the VirtualFireAlarm Device type specific UI implementations for the IoT Server + + + + + com.h2database.wso2 + h2-database-engine + + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + + unpack + package + + unpack + + + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui + + ${project.version} + zip + true + + ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt + + **/* + + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:true + + + + org.wso2.carbon.core.server:${carbon.kernel.version} + + org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version} + + + + + + + + + + diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/build.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/build.properties new file mode 100644 index 0000000000..9c86577d76 --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/devicetypes/virtual_firealarm.xml similarity index 90% rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/devicetypes/virtual_firealarm.xml index 1fcfec4c60..145709c861 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/devicetypes/virtual_firealarm.xml @@ -37,11 +37,6 @@ true - - virtualfirealarm.mqtt.adapter - 0 - true - diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..295ac3fc1a --- /dev/null +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/p2.inf @@ -0,0 +1,17 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\ + + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-edit);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.analytics-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-wizard);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/virtual_firealarm.xml);\ \ No newline at end of file diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml index 892c7acc1d..ac16ca71c5 100644 --- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml +++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt-plugins device-types-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml @@ -33,7 +33,9 @@ http://wso2.org - org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature + org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature + org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature + org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature diff --git a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml index 0a57cae1f4..953945cabd 100644 --- a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml index 9f29c4249f..6df9e7c9ad 100644 --- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml org.wso2.carbon.appmgt.mdm.osgiconnector.feature pom - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Carbon - App management MDM OSGI Connector http://wso2.org This feature contains the core bundles required for APP management OSGI MDM connection @@ -36,7 +36,7 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.appmgt.mdm.osgiconnector - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT org.apache.ws.commons.axiom diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml index 844c9d95d7..c3bfd2a957 100644 --- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml org.wso2.carbon.appmgt.mdm.restconnector.feature pom - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Carbon - App management MDM REST Connector http://wso2.org This feature contains the core bundles required for APP management MDM REST connection @@ -36,7 +36,7 @@ org.wso2.carbon.devicemgt-plugins org.wso2.carbon.appmgt.mdm.restconnector - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT org.apache.ws.commons.axiom diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml index ef61e40fb8..fb7055f319 100644 --- a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml +++ b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.adapter.feature pom - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Carbon - Device Management Adapters Feature http://wso2.org This feature contains the adapter bundles required for IoT Server @@ -208,17 +208,6 @@ org.wso2.carbon.identity.carbon.auth.jwt:org.wso2.carbon.identity.authenticator.signedjwt:${identity.carbon.auth.jwt.version} - - - org.wso2.carbon.event.output.adapter.server:${carbon.analytics.common.version} - - - org.wso2.carbon.event.input.adapter.server:${carbon.analytics.common.version} - - - org.wso2.carbon.identity.jwt.client.extension:${carbon.devicemgt.version} - - diff --git a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml index 3ca8607c09..bf423b8fea 100644 --- a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml +++ b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml @@ -20,13 +20,13 @@ org.wso2.carbon.devicemgt-plugins extensions-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml org.wso2.extension.siddhi.execution.json.feature pom - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Siddhi Execution Extension - Json Feature http://wso2.org This feature contains Siddhi extension feature for changing a json string to individual properties. diff --git a/features/extensions-feature/pom.xml b/features/extensions-feature/pom.xml index bb648ca0c7..74f874ee99 100644 --- a/features/extensions-feature/pom.xml +++ b/features/extensions-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../../pom.xml 4.0.0 extensions-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT pom WSO2 Carbon - Device Management Extensions http://wso2.org diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml index 4858233dd6..e7c763f734 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins android-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.android.feature pom - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Carbon - Android Device Management Feature http://wso2.org This feature contains the core bundles required for Android Device Management diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Configuration-Management.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Configuration-Management.xml new file mode 100644 index 0000000000..41596567af --- /dev/null +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Configuration-Management.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Device-Management.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Device-Management.xml new file mode 100644 index 0000000000..d7fa119def --- /dev/null +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Device-Management.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Event-Receiver.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Event-Receiver.xml new file mode 100644 index 0000000000..e39eb25e96 --- /dev/null +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Event-Receiver.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml index c18d183042..f36a7e3a35 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml @@ -51,9 +51,13 @@ true - + - + diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf index 838bf97d3a..6a5b0d2f30 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf @@ -1,8 +1,9 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/android/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/android/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/webapps/api#device-mgt#android#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#device-mgt#android#v1.0.war,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/jaggeryapps/devicemgt,target:${installFolder}/../../deployment/server/jaggeryapps/devicemgt,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/jaggeryapps/android-web-agent,target:${installFolder}/../../deployment/server/jaggeryapps/android-web-agent,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\ @@ -13,6 +14,9 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Configuration-Management.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Configuration-Management.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Device-Management.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Device-Management.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Event-Receiver.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Event-Receiver.xml,overwrite:true);\ instructions.unconfigure = \ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-android-agent.war);\ diff --git a/features/mobile-plugins-feature/android-plugin-feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/pom.xml index 08af66d5ff..c7affd085a 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/pom.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 android-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT pom WSO2 Carbon - Device Management Android Plugin Feature http://wso2.org diff --git a/features/mobile-plugins-feature/pom.xml b/features/mobile-plugins-feature/pom.xml index dcbc3f3550..eebfac129c 100644 --- a/features/mobile-plugins-feature/pom.xml +++ b/features/mobile-plugins-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../../pom.xml 4.0.0 mobile-plugins-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT pom WSO2 Carbon - Device Management EMM Plugins Feature http://wso2.org diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml index ebd3407c8d..c61a54f51c 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt-plugins windows-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.mobile.windows.feature pom - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Carbon - Windows Device Management Feature http://wso2.org This feature contains the core bundles required for Windows Device Management diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql index f1749a8a8d..7841ec87c8 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql @@ -28,3 +28,17 @@ CREATE TABLE IF NOT EXISTS `WIN_FEATURE` ( `DESCRIPTION` VARCHAR(200) NULL, PRIMARY KEY (`ID`) ); + +-- ----------------------------------------------------- +-- Table `WINDOWS_ENROLLMENT_TOKEN` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `WINDOWS_ENROLLMENT_TOKEN` ( + `ID` INT NOT NULL AUTO_INCREMENT, + `TENANT_DOMAIN` VARCHAR(45) NOT NULL, + `TENANT_ID` INTEGER DEFAULT 0, + `ENROLLMENT_TOKEN` VARCHAR(100) NULL, + `DEVICE_ID` VARCHAR(100) NULL, + `USERNAME` VARCHAR(45) NULL, + `OWNERSHIP` VARCHAR(45) NULL, + PRIMARY KEY (`ID`) +); diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql index 524a483c7c..54a7dc720d 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql @@ -30,3 +30,17 @@ CREATE TABLE WIN_DEVICE ( DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL, PRIMARY KEY (DEVICE_ID) ); + +-- ----------------------------------------------------- +-- Table `WINDOWS_ENROLLMENT_TOKEN` +-- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WINDOWS_ENROLLMENT_TOKEN]') AND TYPE IN (N'U')) +CREATE TABLE WINDOWS_ENROLLMENT_TOKEN ( + ID INT NOT NULL IDENTITY, + TENANT_DOMAIN VARCHAR(45) NOT NULL, + ENROLLMENT_TOKEN VARCHAR (100) NULL DEFAULT NULL, + DEVICE_ID VARCHAR (100) NOT NULL, + USERNAME VARCHAR (45) NOT NULL, + OWNERSHIP VARCHAR (45) NULL DEFAULT NULL, + PRIMARY KEY (ID); +); \ No newline at end of file diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql index 2ebcc80f74..378d516dae 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql @@ -30,5 +30,18 @@ CREATE TABLE IF NOT EXISTS `WIN_FEATURE` ( PRIMARY KEY (`ID`)) ENGINE = InnoDB; +-- ----------------------------------------------------- +-- Table `WINDOWS_ENROLLMENT_TOKEN` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `WINDOWS_ENROLLMENT_TOKEN` ( + `ID` INT NOT NULL AUTO_INCREMENT, + `TENANT_DOMAIN` VARCHAR(45) NOT NULL, + `ENROLLMENT_TOKEN` VARCHAR(100) NULL, + `DEVICE_ID` VARCHAR(100) NULL, + `USERNAME` VARCHAR(45) NULL, + `OWNERSHIP` VARCHAR(45) NULL, + PRIMARY KEY (`ID`)) +ENGINE = InnoDB; + diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql index a7a3892647..3371fab897 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql @@ -31,6 +31,20 @@ CREATE TABLE WIN_FEATURE ( ) / +-- ----------------------------------------------------- +-- Table `WINDOWS_ENROLLMENT_TOKEN` +-- ----------------------------------------------------- +CREATE TABLE WINDOWS_ENROLLMENT_TOKEN ( + ID INT NOT NULL, + TENANT_DOMAIN VARCHAR(45) NOT NULL, + ENROLLMENT_TOKEN VARCHAR(100) NULL, + DEVICE_ID VARCHAR(100) NULL, + USERNAME VARCHAR(45) NULL, + OWNERSHIP VARCHAR(45) NULL, + PRIMARY KEY (ID) +) +/ + -- ----------------------------------------------------- -- Sequence `WIN_FEATURE_ID_INC_SEQ` -- ----------------------------------------------------- diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql index d7444757d2..c8af94cd6a 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql @@ -29,3 +29,15 @@ CREATE TABLE IF NOT EXISTS WIN_FEATURE ( PRIMARY KEY (ID) ); +-- ----------------------------------------------------- +-- Table `WINDOWS_ENROLLMENT_TOKEN` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS WINDOWS_ENROLLMENT_TOKEN ( + ID SERIAL NOT NULL, + TENANT_DOMAIN VARCHAR(45) NOT NULL, + ENROLLMENT_TOKEN VARCHAR(100) NULL, + DEVICE_ID VARCHAR(100) NULL, + USERNAME VARCHAR(45) NULL, + OWNERSHIP VARCHAR(45) NULL, + PRIMARY KEY (ID) +); diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml index 3c7782517a..2efa4203eb 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml @@ -166,6 +166,14 @@ + + DEVICE_INFO + 1 + + + DEVICE_LOCATION + 1 + diff --git a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml index 923daf69fe..d7c6ed49b9 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml +++ b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt-plugins mobile-plugins-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT ../pom.xml 4.0.0 windows-plugin-feature - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT pom WSO2 Carbon - Device Management Windows Plugin Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 019717eb25..a9712c3d8b 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt-plugins carbon-device-mgt-plugins-parent pom - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT WSO2 Carbon - Device Management Plugins Parent http://wso2.org WSO2 Carbon - Device Management Plugins Parent @@ -1128,14 +1128,14 @@ 1.1.1 - 2.0.42 + 2.0.58 [2.0.0, 3.0.0) 1.2.15 - 3.0.25-SNAPSHOT + 3.0.35-SNAPSHOT 4.4.8 @@ -1173,7 +1173,7 @@ 1.5.8 - 5.1.3 + 5.1.17 [5.1.3,6.0.0) 1.3.3 [1.3.0,2.0.0) @@ -1215,6 +1215,7 @@ 3.0.0.wso2v1 (3.0.0, 4.0.0] + [2.0.0,4.0.0) 0.9.1 1.1.wso2v1 3.2.2 @@ -1337,7 +1338,7 @@ --> - + maven-assembly-plugin 2.2-beta-2