add screensharing support

revert-dabc3590
warunalakshitha 7 years ago
commit e0b27c0a5c

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -153,5 +153,5 @@ select meta_owner, meta_deviceId, meta_timestamp, data_type as type, data_receiv
insert into DataStream;
from AndroidSense[meta_type == 'gps']
select meta_deviceId ,meta_type as meta_deviceType, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude
select meta_deviceId ,'android_sense' as meta_deviceType, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude
insert into geoLocationStream;

@ -3,7 +3,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -31,6 +31,9 @@
{{/zone}}
{{#zone "device-details"}}
<span class="device-id"
data-deviceid="{{device.deviceIdentifier}}"
data-type="{{device.type}}"></span>
{{/zone}}
{{#zone "device-view-tabs"}}
@ -38,45 +41,42 @@
data-toggle="tab" aria-controls="device_statistics">Device
Statistics</a>
</li>
<li><a class="list-group-item location_tab" href="#geo_dashboard" role="tab" data-toggle="tab"
aria-controls="geo_dashboard">Device Location</a></li>
<li><a class="initGeoLocationLink" href="#geo_dashboard" role="tab" data-toggle="tab"
aria-controls="geo_dashboard"
data-lat="{{device.location.latitude}}"
data-long="{{device.location.longitude}}">Device Location</a></li>
{{/zone}}
{{#zone "device-view-tab-contents"}}
<div class="panel panel-default tab-pane active"
id="device_statistics" role="tabpanel" aria-labelledby="device_statistics">
<div class="panel-heading">Device Statistics</div>
{{unit "cdmf.unit.device.type.android_sense.realtime.analytics-view" device=device}}
</div>
<div class="panel panel-default tab-pane"
id="geo_dashboard" role="tabpanel" aria-labelledby="geo_dashboard">
<div class="panel-heading">Device Location</div>
<br/>
{{unit "cdmf.unit.geo-dashboard" device=device}}
{{#if locationHistory}}
<div id="device-location"
data-locations = "{{locationHistory}}">
{{#if locationEnabled}}
<div id="location" class="tab-pane">
<div class="tab-actions">
<div class="action-btn-container" id="location-action-bar">
</div>
</div>
<br/>
<a class="padding-left" target="_blank"
href="{{portalUrl}}/portal/dashboards/geo-dashboard/?GLOBAL-STATE={{anchor}}">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-map-location fw-stack-1x"></i>
</span> Add Geo Fencing
</a>
{{unit "cdmf.unit.geo-dashboard" device=device noGeoFencing=false hideSearch=true}}
</div>
{{else}}
<div id="map-error" class="message message-warning">
<h4 class="remove-margin">
<i class="icon fw fw-warning"></i>
{{#if geoServicesEnabled}}
Device location information is not available.
{{else}}
Geo Location Based Services is not enabled.
{{/if}}
</h4>
</div>
<p class="add-padding-5x"></p>
<p class="add-padding-5x"></p>
<p class="add-padding-5x"></p>
{{/if}}
<div id="chartWrapper">
</div>
</div>
{{/zone}}

@ -37,6 +37,8 @@ function onRequest(context) {
viewObject.portalUrl = devicemgtProps['portalURL'];
viewObject.anchor = encodeURI(JSON.stringify(anchor));
viewObject.locationHistory = stringify(device.content.locationHistory);
viewObject.locationEnabled = (device.content.locationHistory.length !== 0);
viewObject.geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled;
return viewObject;
} else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");

@ -20,29 +20,43 @@ function onRequest(context) {
var log = new Log("stats.js");
var carbonServer = require("carbon").server;
var device = context.unit.params.device;
// graph configuration
var graphData = {
Sensors:["accelerometer","magnetic", "gravity", "pressure", "proximity", "gyroscope"],
Realtime_Data:['battery','light','rotation']
};
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var websocketEndpoint = devicemgtProps["wssURL"].replace("https", "wss");
var jwtService = carbonServer.osgiService(
'org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService');
var jwtClient = jwtService.getJWTClient();
var encodedClientKeys = session.get(constants["ENCODED_TENANT_BASED_WEB_SOCKET_CLIENT_CREDENTIALS"]);
var token = "";
var tokenPair = null;
var user = userModule.getCarbonUser();
var tenantDomain = user.domain;
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 (tenantDomain == "carbon.super") {
tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default", {});
if (tokenPair) {
token = tokenPair.accessToken;
}
websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.android.sense/1.0.0?" +
"deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
} else {
tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + tenantDomain,"default", {});
if (tokenPair) {
token = tokenPair.accessToken;
}
websocketEndpoint = websocketEndpoint + "/secured-websocket/t/"+tenantDomain+"/org.wso2.iot.android.sense/1.0.0?" +
"deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
}
}
return {"device": device, "websocketEndpoint": websocketEndpoint, "graphData":graphData};
}

@ -158,6 +158,15 @@ function threeDlineGraph(type, xChartData, yChartData, zChartData) {
graph: graph
});
new Rickshaw.Graph.HoverDetail({
graph: graph,
formatter: function (series, x, y) {
var date = '<span class="date">' + moment(x * 1000).format('Do MMM YYYY h:mm:ss a') + '</span>';
var swatch = '<span class="detail_swatch" style="background-color: ' + series.color + '"></span>';
return swatch + series.name + ": " + parseInt(y) + '<br>' + date;
}
});
graph.render();
return graph;
@ -234,58 +243,61 @@ function connect(target) {
if (ws) {
ws.onmessage = function (event) {
var dataPoint = JSON.parse(event.data);
if (dataPoint) {
var time = parseInt(dataPoint[4]) / 1000;
switch (dataPoint[typeId]) {
case "battery":
graphUpdate(batteryData, time, dataPoint[batteryId], graphMap["battery"]);
graphUpdate(batteryData, time, dataPoint[batteryId]);
graphMap["battery"].update();
break;
case "light":
graphUpdate(lightData, time, dataPoint[lightId], graphMap["light"]);
graphUpdate(lightData, time, dataPoint[lightId]);
graphMap["light"].update();
break;
case "pressure":
graphUpdate(pressureData, time, dataPoint[pressureId], graphMap["pressure"]);
graphUpdate(pressureData, time, dataPoint[pressureId]);
graphMap["pressure"].update();
break;
case "proximity":
graphUpdate(proximityData, time, dataPoint[proximityId], graphMap["proximity"]);
graphUpdate(proximityData, time, dataPoint[proximityId]);
graphMap["proximity"].update();
break;
case "accelerometer":
dataUpdate(accelerometer_xData, time, dataPoint[accelerometer_xId]);
dataUpdate(accelerometer_yData, time, dataPoint[accelerometer_yId]);
dataUpdate(accelerometer_zData, time, dataPoint[accelerometer_zId]);
graphUpdate(accelerometer_xData, time, dataPoint[accelerometer_xId]);
graphUpdate(accelerometer_yData, time, dataPoint[accelerometer_yId]);
graphUpdate(accelerometer_zData, time, dataPoint[accelerometer_zId]);
graphMap["accelerometer"].update();
break;
case "magnetic":
dataUpdate(magnetic_xData, time, dataPoint[magnetic_xId]);
dataUpdate(magnetic_yData, time, dataPoint[magnetic_yId]);
dataUpdate(magnetic_zData, time, dataPoint[magnetic_zId]);
graphUpdate(magnetic_xData, time, dataPoint[magnetic_xId]);
graphUpdate(magnetic_yData, time, dataPoint[magnetic_yId]);
graphUpdate(magnetic_zData, time, dataPoint[magnetic_zId]);
graphMap["magnetic"].update();
break;
case "gyroscope":
dataUpdate(gyroscope_xData, time, dataPoint[gyroscope_xId]);
dataUpdate(gyroscope_yData, time, dataPoint[gyroscope_yId]);
dataUpdate(gyroscope_zData, time, dataPoint[gyroscope_zId]);
graphUpdate(gyroscope_xData, time, dataPoint[gyroscope_xId]);
graphUpdate(gyroscope_yData, time, dataPoint[gyroscope_yId]);
graphUpdate(gyroscope_zData, time, dataPoint[gyroscope_zId]);
graphMap["gyroscope"].update();
break;
case "rotation":
dataUpdate(magnetic_xData, time, dataPoint[rotation_xId]);
dataUpdate(magnetic_yData, time, dataPoint[rotation_yId]);
dataUpdate(magnetic_zData, time, dataPoint[rotation_zId]);
graphUpdate(magnetic_xData, time, dataPoint[rotation_xId]);
graphUpdate(magnetic_yData, time, dataPoint[rotation_yId]);
graphUpdate(magnetic_zData, time, dataPoint[rotation_zId]);
graphMap["rotation"].update();
break;
case "gravity":
dataUpdate(gravity_xData, time, dataPoint[gravity_xId]);
dataUpdate(gravity_yData, time, dataPoint[gravity_yId]);
dataUpdate(gravity_zData, time, dataPoint[gravity_zId]);
graphUpdate(gravity_xData, time, dataPoint[gravity_xId]);
graphUpdate(gravity_yData, time, dataPoint[gravity_yId]);
graphUpdate(gravity_zData, time, dataPoint[gravity_zId]);
graphMap["gravity"].update();
break;
}
@ -294,16 +306,7 @@ function connect(target) {
}
}
function graphUpdate(chartData, xValue, yValue, graph) {
chartData.push({
x: parseInt(xValue),
y: parseFloat(yValue)
});
chartData.shift();
graph.update();
}
function dataUpdate(chartData, xValue, yValue) {
function graphUpdate(chartData, xValue, yValue) {
chartData.push({
x: parseInt(xValue),
y: parseFloat(yValue)

@ -17,7 +17,7 @@
}}
{{unit "cdmf.unit.device.type.qr-modal" enrollmentURL=enrollmentURL deviceTypeName="Android"}}
{{unit "cdmf.unit.device.type.email.invite-modal" deviceTypeView="androidsense"}}
{{unit "cdmf.unit.device.type.email.invite-modal" deviceTypeView="android_sense"}}
<div class="col-lg-12 margin-top-double">
<h1 class="grey ">Android Sense</h1>
@ -41,7 +41,7 @@
<a href="#" class="download-link btn-operations"><i class="fw fw-mobile fw-inverse fw-lg add-margin-1x"></i> Enroll Device</a>
<a href="{{hostName}}{{@unit.publicUri}}/asset/androidsense.apk" class="btn-operations"><i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a>
<a href="javascript:toggleEmailInvite()" class="btn-operations"><i class="fw fw-mail fw-inverse fw-lg add-margin-1x"></i> Invite by Email</a>
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Android+Sense"
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS310/Android+Sense"
target="_blank">[ here ]</a> for latest instructions and
troubleshooting.</p>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -221,13 +221,21 @@ public class ArduinoServiceImpl implements ArduinoService {
String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
.getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext
.getThreadLocalCarbonContext().getTenantDomain();
;
if (apiApplicationKey == null) {
String adminUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminUserName();
String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {ArduinoConstants.DEVICE_TYPE};
try{
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername);
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
ArduinoConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true,
ArduinoConstants.APIM_APPLICATION_TOKEN_VALIDITY_PERIOD);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
String scopes = " device_" + deviceId + " perm:arduino:enroll";

@ -23,7 +23,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -73,9 +73,9 @@ $(window).load(function () {
connect(websocketUrl)
});
$(window).unload(function () {
window.onbeforeunload = function() {
disconnect();
});
};
//websocket connection
function connect(target) {

@ -31,8 +31,7 @@
<div class="col-xs-12 col-sm-8 col-md-9 col-lg-9 padding-top">
<h3 class="uppercase">What it Does</h3>
<hr>
<p class="grey margin-top">Connect Arduino UNO board to WSO2 IoT Server and visualize sensor
data.</p>
<p class="grey margin-top">Connect the Arduino UNO board to WSO2 IoT Server and visualize sensor data.</p>
<br>
<h3 class="uppercase">What You Need</h3>
<hr>
@ -43,20 +42,19 @@
</li>
<li>
<span class="badge">ITEM 02</span>
Adafruit Wifi Shield for Arduino.
Adafruit WiFi Shield for Arduino.
</li>
<li>
<span class="badge">ITEM 03</span>
LED bulb connected to Pin 13.
<i>(If not available, will use the one on the board.)</i>
A LED bulb connected to pin 13. If you do not have a LED bulb, use the one on the Arduino board. The one on the board is connected to pin 13 by default.
</li>
<li>
<span class="badge">ITEM 04</span>
Resister( e.g 330 ohms )
Resister (e.g., 330 ohm)
</li>
<li>
<span class="badge">STEP 05</span>
Proceed to [Prepare] section.
Next, proceed to the [Prepare] section. (remove the step 5 coz that' is the only step all the others are items.)
</ul>
<br>
<a href="/api-store/apis/info?name={{@uriParams.deviceType}}&version=1.0.0&provider=admin"
@ -66,7 +64,7 @@
<a href="#" class="download-link btn-operations">
<i class="fw fw-download add-margin-1x"></i>Download Sketch
</a>
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Arduino"
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS310/Arduino"
target="_blank">here</a> for latest instructions and
troubleshooting.</p>
<div id="download-device-modal-content" class="hide">
@ -197,11 +195,11 @@
<ul class="list-unstyled">
<li class="padding-top-double">
<span class="badge">01</span>
Wifi-Shield mounted onto the Arduino-UNO board
Mount the WiFi shield to the Arduino UNO board.
</li>
<li class="padding-top-double">
<span class="badge">02</span>
Connect LED bulb to arduino as follows
Connect the LED bulb to Arduino as shown below:
<br/><br/>
<a href="{{@unit.publicUri}}/images/schematicsGuide.jpg" target="_blank">
<img src="{{@unit.publicUri}}/images/schematicsGuide.jpg" class="img-responsive">
@ -211,26 +209,25 @@
<li class="padding-top-double">
<span class="badge">03</span>
Download Arduino-Sketch from [Download Sketch] link above.
Click [Download Sketch] above to download the Arduino Sketch.
</li>
<li class="padding-top-double">
<span class="badge">04</span>
Unzip the downloaded Arduino Agent
Unzip the downloaded Arduino agent.
</li>
<li class="padding-top-double">
<span class="badge">05</span>
Create a folder called "ArduinoBoardSketch" and move all source files
inside
Create a folder by the name ArduinoBoardSketch and move the downloaded agent and the source files to it.
</li>
<li class="padding-top-double">
<span class="badge">06</span>
Open ArduinoBoardSketch.h and provide appropriate values for
Open the ArduinoBoardSketch.h file and provide the values for the
<i>[WLAN_SSID]</i>,
<i>[WLAN_PASS]</i>,
<i>[SERVICE_PORT]</i>,
<i>[server]</i> and
<i>[deviceIP]</i>
variables according to your network.
variables for the device to connect to your WiFi network.
</li>
<li class="padding-top-double">
<span class="badge">07</span>
@ -242,14 +239,14 @@
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-right-arrow fw-stack-1x"></i>
</span>
Arduino will publish it's internal temperature to WSO2-IoT-Server
The Arduino will publish its internal temperature to WSO2 IoT Server.
<br/><br/>
<span class="fw-stack margin-right">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-right-arrow fw-stack-1x"></i>
</span>
LED on <i>PIN 13</i> can be controlled from Device Management page.
Control the LED on <i>PIN 13</i> via the Device Management page.
</li>
</ul>
<br>
@ -263,18 +260,16 @@
<ul class="list-unstyled">
<li class="padding-top-double">
<span class="badge">01</span>
You can view all your connected devices at
View all your connected devices in the
<a href="{{@app.context}}/devices">[Device Management]</a> page.
</li>
<li class="padding-top-double">
<span class="badge">02</span>
Select one of connected devices and check for available control
operations and monitor Real-Time data.
Try out the control operations on your connected devices and monitor real-time data.
</li>
<li class="padding-top-double">
<span class="badge">03</span>
You can also view analytics of the data published to IoT-Server by
navigating to Device Analytics page.
Do we need this step? Is this supported?
</li>
</ul>
<br/>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -203,14 +203,23 @@ public class RaspberryPiServiceImpl implements RaspberryPiService {
throw new DeviceManagementException(msg);
}
if (apiApplicationKey == null) {
String adminUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminUserName();
String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
.getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext
.getThreadLocalCarbonContext().getTenantDomain();
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {RaspberrypiConstants.DEVICE_TYPE};
try{
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername);
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
RaspberrypiConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true,
RaspberrypiConstants.APIM_APPLICATION_TOKEN_VALIDITY_PERIOD);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
String scopes = " device_" + deviceId;

@ -23,7 +23,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -84,8 +84,8 @@ function attachEvents() {
* on Device Management page in WSO2 DC Console.
*/
$("a.download-link").click(function () {
var sketchType = $(this).data("sketchtype");
var deviceType = $(this).data("devicetype");
var sketchType = $(".deviceType").val();
var deviceType = $(".sketchType").val();
var downloadDeviceAPI = "/devicemgt/api/devices/sketch/generate_link";
var payload = {"sketchType": sketchType, "deviceType": deviceType};
$(modalPopupContent).html($('#download-device-modal-content').html());
@ -100,16 +100,24 @@ function attachEvents() {
$('label[for=deviceName]').remove();
if (deviceName && deviceName.length >= 4) {
payload.deviceName = deviceName;
invokerUtil.post(
downloadDeviceAPI,
payload,
function (data, textStatus, jqxhr) {
doAction(data);
},
function (data) {
doAction(data);
var request = {
url: downloadDeviceAPI,
type: "POST",
contentType: "application/json",
data: JSON.stringify(payload),
accept: "application/json",
async : true,
success: doAction,
error: function (jqXHR) {
if (jqXHR.status == 401) {
$(modalPopupContent).html($("#error-msg").html());
showPopup();
} else {
doAction(jqXHR);
}
);
}
};
$.ajax(request);
}else if(deviceName){
$('.controls').append('<label for="deviceName" generated="true" class="error" ' +
'style="display: inline-block;">Please enter at least 4 ' +
@ -159,10 +167,7 @@ function doAction(data) {
if (data.status == "200") {
$(modalPopupContent).html($('#download-device-modal-content-links').html());
$("input#download-device-url").val(data.responseText);
$("input#download-device-url").focus(function () {
$(this).select();
});
$("#download-device-url").html(data.responseText);
showPopup();
} else if (data.status == "401") {
$(modalPopupContent).html($('#device-401-content').html());

@ -62,7 +62,7 @@
<i class="fw fw-download add-margin-1x"></i>Download Agent
</a>
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Raspberry+Pi"
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS310/Raspberry+Pi"
target="_blank">here</a> for latest instructions and
troubleshooting.</p>
<div id="download-device-modal-content" class="hide">
@ -112,6 +112,15 @@
</div>
</div>
</div>
<div id="download-device-modal-content-links" class="hide">
<div class="modal-content">
<div class="row">
<div class="col-md-7 col-centered center-container">
<h4 id="download-device-url"></h4>
</div>
</div>
</div>
</div>
<div id="device-400-content" class="hide">
<div class="modal-content">
<div class="row">

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -233,15 +233,27 @@ public class VirtualFireAlarmServiceImpl implements VirtualFireAlarmService {
throw new DeviceManagementException(msg);
}
if (apiApplicationKey == null) {
String adminUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
.getRealmConfiguration().getAdminUserName();
String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getTenantDomain();
String applicationUsername =
PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration()
.getAdminUserName() + "@" + PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getTenantDomain();
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {VirtualFireAlarmConstants.DEVICE_TYPE};
try {
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername);
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
VirtualFireAlarmConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true,
VirtualFireAlarmConstants.APIM_APPLICATION_TOKEN_VALIDITY_PERIOD);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
String scopes = " device_" + deviceId;

@ -23,7 +23,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -59,7 +59,7 @@
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS310/Enterprise+IoT+solution"
target="_blank">[ here ]</a> for the latest instructions and troubleshooting tips.
We need to link the 310 pack to the 310 docs.</p>
</p>
<div id="download-device-modal-content" class="hide">
<div class="modal-header">
<h4 class="pull-left modal-title">

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>appm-connector</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>appm-connector</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mb-extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>pull-notification-listeners</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>siddhi-extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>siddhi-extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -73,13 +73,13 @@ public class EventReceiverServiceImpl implements EventReceiverService {
String eventPayload = eventBeanWrapper.getPayload();
JsonObject jsonObject = gson.fromJson(eventPayload, JsonObject.class);
Object payload[] = {
jsonObject.get(TIME_STAMP),
jsonObject.get(LONGITUDE),
jsonObject.get(LATITUDE)
jsonObject.get(TIME_STAMP).getAsLong(),
jsonObject.get(LONGITUDE).getAsDouble(),
jsonObject.get(LATITUDE).getAsDouble()
};
try {
if (AndroidAPIUtils.getEventPublisherService().publishEvent(
EVENT_STREAM_DEFINITION, "1.0.0", new Object[0], new Object[0], payload)) {
EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload)) {
message.setResponseCode("Event is published successfully.");
return Response.status(Response.Status.CREATED).entity(message).build();
} else {

@ -21,7 +21,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -156,7 +156,7 @@ public class TryIt {
if (!new File(localPath).delete()) {
System.out.println("Delete " + localPath + " and try again");
}
handleException("Downloading " + localPath + " failed.", e);
handleException("Download failed for file : " + localPath, e);
} finally {
if (in != null)
try {
@ -193,7 +193,7 @@ public class TryIt {
String response = new Scanner(System.in, StandardCharsets.UTF_8.toString()).next();
String emulatorLocationPath = response + File.separator + "tools" + File.separator + "emulator";
if (osSuffix.equals(Constants.WINDOWS_OS)) {
emulatorLocationPath += Constants.WINDOWS_EXTENSION_BAT;
emulatorLocationPath += Constants.WINDOWS_EXTENSION_EXE;
}
if (new File(emulatorLocationPath).exists()) {
androidSdkHome = response;
@ -255,7 +255,7 @@ public class TryIt {
private void getTools(String url, String folderName) {
System.out.println("Downloading " + folderName);
downloadArtifacts(url, androidSdkHome + File.separator + folderName);
System.out.println("Configuring " + folderName);
System.out.println("Configuring " + folderName + ", please wait");
extractFolder(androidSdkHome + File.separator + folderName);
}
@ -269,7 +269,7 @@ public class TryIt {
checkForSystemImages();
if (!new File(wso2AvdLocation).isDirectory()) {
Scanner read = new Scanner(System.in, StandardCharsets.UTF_8.toString());
System.out.print("Do you want to create WSO2_AVD with default configs (Y/n)?: ");
System.out.print("Do you want to create WSO2_AVD with default configs (y/n)?: ");
if (read.next().toLowerCase().matches("y")) {
createAVD();
return;
@ -494,17 +494,29 @@ public class TryIt {
/**
* This method gets the Android SDK location if available and sets the SDK path else downloads the SDK.
*/
private int count = 0;
private void setAndroidSDK() {
sdkConfigFile = new File("sdkConfigLocation");
if (!(sdkConfigFile.exists() && !sdkConfigFile.isDirectory())) {
//TODO
Scanner read = new Scanner(System.in, StandardCharsets.UTF_8.toString());
System.out.print("Do you have an Android SDK installed on your computer (y/N) ? : ");
String response = read.next().toLowerCase();
System.out.print("Do you have an Android SDK installed on your computer (y/n) ? : ");
String response = read.nextLine().toLowerCase();
if (response.matches("y")) {
setSDKPath();
} else {
} else if (response.matches("n")) {
getAndroidSDK();
} else {
if (count < 5) {
System.out.println("Please enter a valid parameter .");
count++;
setAndroidSDK();
return;
} else {
System.out.println("Terminating process");
System.exit(1);
}
}
} else {
Scanner scanner = null;
@ -634,7 +646,7 @@ public class TryIt {
*/
private void installAgent() {
String androidAgentLocation = workingDirectory + Constants.APK_LOCATION;
System.out.println("Installing agent ...");
System.out.println("Installing agent, please wait...");
ProcessBuilder installAgentProcessBuilder = new ProcessBuilder(adbLocation, "install",
androidAgentLocation);
try {
@ -722,19 +734,24 @@ public class TryIt {
if (!new File(haxmLocation).mkdirs()) {
makeDirectoryError(haxmLocation, androidSdkHome);
}
String folderName = "_haxm.zip";
getTools(System.getProperty(Constants.HAXM_URL), haxmLocation + File.separator
+ folderName);
String haxmInstaller = haxmLocation + File.separator + "silent_install";
if (osSuffix.equals(Constants.WINDOWS_OS)) {
haxmInstaller += Constants.WINDOWS_EXTENSION_BAT;
String haxmInstaller;
String folderName = "extras" + File.separator + "intel" + File.separator
+ "Hardware_Accelerated_Execution_Manager" + File.separator + "_haxm.zip";
getTools(System.getProperty(Constants.HAXM_URL), folderName);
ProcessBuilder processBuilder;
if (osSuffix.equals(Constants.MAC_OS)) {
haxmInstaller = haxmLocation + File.separator + "silent_install.sh";
setExecutePermission(haxmInstaller);
processBuilder = new ProcessBuilder("sudo", haxmInstaller, "-m", "2048", "-log",
androidSdkHome + File.separator + "haxmSilentRun.log");
} else {
haxmInstaller += Constants.MAC_HAXM_EXTENSION;
}
haxmInstaller = haxmLocation + File.separator + "silent_install.bat";
setExecutePermission(haxmInstaller);
processBuilder = new ProcessBuilder(haxmInstaller, "-m", "2048", "-log",
androidSdkHome + File.separator + "haxmSilentRun.log");
}
ProcessBuilder processBuilder = new ProcessBuilder(haxmInstaller, "-m", "2048", "-log",
workingDirectory + File.separator + "haxmSilentRun.log");
System.out.println("Installing intel HAXM, Please wait . . . ");
processBuilder.directory(new File(haxmLocation));
processBuilder.redirectInput(ProcessBuilder.Redirect.INHERIT);
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
@ -818,6 +835,7 @@ public class TryIt {
private void checkCacheImg(String deviceId) {
File cacheImg = new File(userHome + File.separator + ".android"
+ File.separator + "avd" + File.separator + deviceId + ".avd" + File.separator + "cache.img");
System.out.print("Creating cache image, please wait ");
while (!cacheImg.exists()) {
System.out.print(".");
delay(1000);

@ -23,13 +23,13 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.android.ui</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<name>WSO2 Carbon - Mobile Android UI</name>
<packaging>pom</packaging>

@ -194,8 +194,6 @@
</div>
</div>
</div>
<div class="panel panel-default visible-xs-block" role="tabpanel"
id="policy_compliance_tab">
<div class="panel-heading visible-xs collapsed" id="policy_compliance">

@ -22,7 +22,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -49,7 +49,6 @@ public class DiscoveryServiceImpl implements DiscoveryService {
public static final String FEDERATED = "Federated";
private static final String DELIMITER = "@";
private static final int DOMAIN_SEGMENT = 1;
private static Log log = LogFactory.getLog(
org.wso2.carbon.device.mgt.mobile.windows.api.services.discovery.impl.DiscoveryServiceImpl.class);
@ -67,7 +66,7 @@ public class DiscoveryServiceImpl implements DiscoveryService {
String emailId = discoveryRequest.getEmailId();
String[] userDomains = emailId.split(DELIMITER);
String domain = userDomains[DOMAIN_SEGMENT];
String domain = userDomains[(userDomains.length)-1];
DiscoveryResponse discoveryResponse;
if (!PluginConstants.WindowsVersionProperties.REQUESTED_WIN81_VERSION.equals(discoveryRequest.getVersion())

@ -102,9 +102,10 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService {
String message;
ConfigurationEntry licenseEntry = null;
PlatformConfiguration configuration = new PlatformConfiguration();
configuration.setConfiguration(windowsPlatformConfiguration.getConfiguration());
try {
configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
List<ConfigurationEntry> configs = configuration.getConfiguration();
List<ConfigurationEntry> configs = windowsPlatformConfiguration.getConfiguration();
for (ConfigurationEntry entry : configs) {
if (PluginConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) {
License license = new License();

@ -23,13 +23,13 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.windows.ui</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<name>WSO2 Carbon - Mobile Windows UI</name>
<packaging>pom</packaging>

@ -17,12 +17,12 @@
data-owner="{{device.owner}}"
data-status="{{device.status}}">
{{device.owner}}'s {{device.name}}
</h1>
<a id="device-info-tooltip" href="#" data-toggle="tooltip" title="Device Identifier: {{device.deviceIdentifier}}
Firmware Build Date: {{device.osBuildDate}}
UDID: {{device.udid}}">
<i class="fw fw-info"></i>
</a>
</h1>
{{#if device.model}}
<h4>{{device.vendor}} {{device.model}}</h4>
{{/if}}

@ -91,7 +91,7 @@ function onRequest(context) {
viewModel["ramUsage"]["value"] = (filteredDeviceData["latestDeviceInfo"]["availableRAMMemory"]);
viewModel["internalMemory"] = {};
viewModel["internalMemory"]["value"] = Math.round((filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) / 1024);
viewModel["internalMemory"]["value"] = replaceNaNVal(Math.round((filteredDeviceData["latestDeviceInfo"]["internalAvailableMemory"]) / 1024));
}
if (!filteredDeviceData["initialDeviceInfo"] && !filteredDeviceData["latestDeviceInfo"]) {
@ -118,4 +118,11 @@ function onRequest(context) {
deviceViewData["autoCompleteParams"] = autoCompleteParams;
deviceViewData["permissions"] = permissions;
return deviceViewData;
function replaceNaNVal(val) {
if (isNaN(val)) {
return "N/A";
}
return val;
}
}

@ -84,7 +84,7 @@ $(document).ready(function () {
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
});
var windowsConfigAPI = "/api/device-mgt/windows/v1.0/services/configuration";
var windowsConfigAPI = "/api/device-mgt/windows/v1.0/configuration";
invokerUtil.get(
windowsConfigAPI,
@ -193,24 +193,24 @@ $(document).ready(function () {
$("#config-save-form").addClass("hidden");
$("#record-created-msg").removeClass("hidden");
} else if (data == 500) {
$(errorMsg).text("Exception occurred at backend.");
$(errorMsgWindows).text("Exception occurred at backend.");
} else if (data == 400) {
$(errorMsg).text("Configurations cannot be empty.");
$(errorMsgWindows).text("Configurations cannot be empty.");
} else {
$(errorMsg).text("An unexpected error occurred.");
$(errorMsgWindows).text("An unexpected error occurred.");
}
$(errorMsgWrapperWindows).removeClass("hidden");
}, function (data) {
data = data.status;
if (data == 500) {
$(errorMsg).text("Exception occurred at backend.");
$(errorMsgWindows).text("Exception occurred at backend.");
} else if (data == 403) {
$(errorMsg).text("Action was not permitted.");
$(errorMsgWindows).text("Action was not permitted.");
} else {
$(errorMsg).text("An unexpected error occurred.");
$(errorMsgWindows).text("An unexpected error occurred.");
}
$(errorMsgWrapper).removeClass("hidden");
$(errorMsgWrapperWindows).removeClass("hidden");
}
);
}

@ -10,7 +10,9 @@
"perm:windows:lock-reset",
"perm:windows:reboot",
"perm:windows:location",
"perm:windows:disenroll"
"perm:windows:disenroll",
"perm:windows:manage-configuration",
"perm:windows:view-configuration"
],
"analyticsEnabled": "false",
"groupingEnabled": "false",

@ -22,7 +22,7 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.analytics.feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.iot.device.statistics.dashboard.feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.backend.feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense Backend Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.ui.feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense UI Feature</name>
<url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,13 +22,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>device-types-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management IoT Plugins Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>4.0.35-SNAPSHOT</version>
<version>4.0.53-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save