Merge pull request #615 from wso2/cloud-3.1.0

Cloud related fixes
revert-dabc3590
Kamidu Sachith Punchihewa 8 years ago committed by GitHub
commit 95f64b0a15

@ -26,7 +26,7 @@
<property name="Arduino_dir" value="Arduino"/> <property name="Arduino_dir" value="Arduino"/>
<target name="clean"> <target name="clean">
<delete dir="${target-dir}" /> <delete dir="${target-dir}"/>
</target> </target>
<target name="zip" depends="clean"> <target name="zip" depends="clean">

@ -16,7 +16,8 @@
~ specific language governing permissions and limitations ~ specific language governing permissions and limitations
~ under the License. ~ under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<artifactId>arduino-plugin</artifactId> <artifactId>arduino-plugin</artifactId>
@ -40,7 +41,7 @@
<phase>process-resources</phase> <phase>process-resources</phase>
<configuration> <configuration>
<target> <target>
<ant antfile="build.xml" target="zip" /> <ant antfile="build.xml" target="zip"/>
</target> </target>
</configuration> </configuration>
<goals> <goals>

@ -17,8 +17,8 @@
--> -->
<assembly <assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>src</id> <id>src</id>
<formats> <formats>

@ -16,7 +16,8 @@
~ specific language governing permissions and limitations ~ specific language governing permissions and limitations
~ under the License. ~ under the License.
--> -->
<eventReceiver name="arduino_receiver" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver"> <eventReceiver name="arduino_receiver" statistics="disable" trace="disable"
xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="oauth-http"> <from eventAdapterType="oauth-http">
<property name="contentValidator">iot-http</property> <property name="contentValidator">iot-http</property>
</from> </from>

@ -17,7 +17,7 @@
~ under the License. ~ under the License.
--> -->
<artifact name= "arduino_stream" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer"> <artifact name="arduino_stream" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.arduino_1.0.0.json</file> <file>org.wso2.iot.arduino_1.0.0.json</file>
</artifact> </artifact>

@ -4,12 +4,19 @@
"nickName": "Arduino", "nickName": "Arduino",
"description": "Temperature data received from the Arduino", "description": "Temperature data received from the Arduino",
"metaData": [ "metaData": [
{"name":"owner","type":"STRING"}, {
{"name":"deviceId","type":"STRING"} "name": "owner",
"type": "STRING"
},
{
"name": "deviceId",
"type": "STRING"
}
], ],
"payloadData": [ "payloadData": [
{ {
"name": "temperature","type": "FLOAT" "name": "temperature",
"type": "FLOAT"
} }
] ]
} }

@ -17,7 +17,8 @@
~ under the License. ~ under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>arduino-plugin</artifactId> <artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId> <groupId>org.wso2.carbon.devicemgt-plugins</groupId>

@ -19,7 +19,6 @@
package org.wso2.carbon.device.mgt.iot.arduino.service.impl; package org.wso2.carbon.device.mgt.iot.arduino.service.impl;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.device.mgt.iot.arduino.service.impl.constants.ArduinoConstants; import org.wso2.carbon.device.mgt.iot.arduino.service.impl.constants.ArduinoConstants;

@ -220,7 +220,8 @@ public class ArduinoServiceImpl implements ArduinoService {
} }
String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm() String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
.getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext .getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext
.getThreadLocalCarbonContext().getTenantDomain();; .getThreadLocalCarbonContext().getTenantDomain();
;
if (apiApplicationKey == null) { if (apiApplicationKey == null) {
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService(); APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {ArduinoConstants.DEVICE_TYPE}; String[] tags = {ArduinoConstants.DEVICE_TYPE};

@ -16,9 +16,9 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
@ -30,7 +30,7 @@
</bean> </bean>
</jaxrs:serviceBeans> </jaxrs:serviceBeans>
<jaxrs:providers> <jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" /> <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
</jaxrs:providers> </jaxrs:providers>
</jaxrs:server> </jaxrs:server>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<web-app version="2.5" <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
metadata-complete="true"> metadata-complete="true">
<display-name>Arduino</display-name> <display-name>Arduino</display-name>
@ -28,7 +28,8 @@
</context-param> </context-param>
<listener> <listener>
<listener-class>org.wso2.carbon.device.mgt.iot.arduino.service.impl.listener.ArduinoPermissionUpdateListener</listener-class> <listener-class>org.wso2.carbon.device.mgt.iot.arduino.service.impl.listener.ArduinoPermissionUpdateListener
</listener-class>
</listener> </listener>
</web-app> </web-app>

@ -18,7 +18,8 @@
~ under the License. ~ under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<artifactId>arduino-plugin</artifactId> <artifactId>arduino-plugin</artifactId>

@ -17,8 +17,8 @@
--> -->
<assembly <assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>src</id> <id>src</id>
<formats> <formats>

@ -22,20 +22,20 @@ function onRequest(context) {
var deviceId = request.getParameter("id"); var deviceId = request.getParameter("id");
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var autoCompleteParams = [ var autoCompleteParams = [
{"name" : "deviceId", "value" : deviceId} {"name": "deviceId", "value": deviceId}
]; ];
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
var anchor = { "device" : { "id" : device.content.deviceIdentifier, "type" : device.content.type}}; var anchor = {"device": {"id": device.content.deviceIdentifier, "type": device.content.type}};
return { return {
"device": device.content, "device": device.content,
"autoCompleteParams" : autoCompleteParams, "autoCompleteParams": autoCompleteParams,
"encodedFeaturePayloads": "", "encodedFeaturePayloads": "",
"portalUrl" : devicemgtProps['portalURL'], "portalUrl": devicemgtProps['portalURL'],
"anchor" : JSON.stringify(anchor) "anchor": JSON.stringify(anchor)
}; };
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");

@ -31,7 +31,7 @@ function onRequest(context) {
if (encodedClientKeys) { if (encodedClientKeys) {
var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"]; var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"];
var resp = tokenUtil.decode(encodedClientKeys).split(":"); var resp = tokenUtil.decode(encodedClientKeys).split(":");
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default", {}); var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username, "default", {});
if (tokenPair) { if (tokenPair) {
token = tokenPair.accessToken; token = tokenPair.accessToken;
} }

@ -4,7 +4,7 @@
"category": "iot", "category": "iot",
"downloadAgentUri": "arduino/device/download", "downloadAgentUri": "arduino/device/download",
"category": "iot", "category": "iot",
"scopes" : [ "scopes": [
"perm:arduino:enroll" "perm:arduino:enroll"
] ]
} }

@ -21,15 +21,19 @@
width: 50px; width: 50px;
color: #fff; color: #fff;
} }
.padding-top-double { .padding-top-double {
padding-top: 20px; padding-top: 20px;
} }
.padding-double { .padding-double {
padding: 20px; padding: 20px;
} }
.grey { .grey {
color: #333; color: #333;
} }
hr { hr {
display: block; display: block;
height: 1px; height: 1px;
@ -39,20 +43,25 @@ hr {
padding: 0; padding: 0;
opacity: 0.2; opacity: 0.2;
} }
.light-grey { .light-grey {
color: #7c7c7c; color: #7c7c7c;
} }
.uppercase { .uppercase {
text-transform: uppercase; text-transform: uppercase;
} }
.grey-bg { .grey-bg {
background-color: #f6f4f4; background-color: #f6f4f4;
} }
.doc-link{
.doc-link {
background: none; background: none;
color: #000; color: #000;
padding: 10px 0px; padding: 10px 0px;
} }
.doc-link a { .doc-link a {
color: #006eff; color: #006eff;
} }

@ -110,7 +110,7 @@ function attachEvents() {
doAction(data); doAction(data);
} }
); );
}else if(deviceName){ } else if (deviceName) {
$('.controls').append('<label for="deviceName" generated="true" class="error" ' + $('.controls').append('<label for="deviceName" generated="true" class="error" ' +
'style="display: inline-block;">Please enter at least 4 ' + 'style="display: inline-block;">Please enter at least 4 ' +
'characters.</label>'); 'characters.</label>');
@ -146,7 +146,7 @@ function downloadAgent() {
setTimeout(function () { setTimeout(function () {
hidePopup(); hidePopup();
}, 1000); }, 1000);
}else { } else {
$("#invalid-username-error-msg span").text("Invalid device name"); $("#invalid-username-error-msg span").text("Invalid device name");
$("#invalid-username-error-msg").removeClass("hidden"); $("#invalid-username-error-msg").removeClass("hidden");
} }

@ -67,7 +67,8 @@
<i class="fw fw-download add-margin-1x"></i>Download Sketch <i class="fw fw-download add-margin-1x"></i>Download Sketch
</a> </a>
{{#if displayStatus}} {{#if displayStatus}}
<a href="javascript:artifactUpload()" class="btn-operations"><i class="fw fw-upload fw-inverse fw-lg add-margin-1x"></i> Deploy Analytics Artifacts</a> <a href="javascript:artifactUpload()" class="btn-operations"><i
class="fw fw-upload fw-inverse fw-lg add-margin-1x"></i> Deploy Analytics Artifacts</a>
{{/if}} {{/if}}
<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/IoTS300/Arduino"

@ -16,7 +16,7 @@
* under the License. * under the License.
*/ */
function onRequest(context){ function onRequest(context) {
var viewModel = {}; var viewModel = {};
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];

@ -17,7 +17,8 @@
~ under the License. ~ under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId> <groupId>org.wso2.carbon.devicemgt-plugins</groupId>

@ -27,9 +27,16 @@
to save it to your computer.</p> to save it to your computer.</p>
<p class="doc-link">For further instructions and troubleshooting please visit the following <a href="https://docs.wso2.com/display/IoTS300/Android" <p class="doc-link">For further instructions and troubleshooting please visit the following <a href="https://docs.wso2.com/display/IoTS300/Android"
target="_blank">link</a>.</p>--> target="_blank">link</a>.</p>-->
{{#if isCloud}}
<p class="doc-link text-center">Need help? Read <a <p class="doc-link text-center">Need help? Read <a
href="https://docs.wso2.com/display/DeviceCloud/Enrolling+an+Android+Device" target="_blank">WSO2 Device href="https://docs.wso2.com/display/IoTS300/Android" target="_blank">WSO2 Device
Cloud documentation.</a></p> Cloud documentation.</a></p>
{{else}}
<p class="doc-link text-center">Need help? Read <a
href="https://docs.wso2.com/display/DeviceCloud/Enrolling+an+Android+Device" target="_blank">WSO2
IoT Server documentation.</a></p>
{{/if}}
</div> </div>
</div> </div>
@ -40,21 +47,16 @@
</div> </div>
</div> </div>
<div class="row grey-bg"> {{#if isCloud}}
{{#if isCloud}} <div class="row grey-bg">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 add-padding-top-2x add-padding-bottom-2x">
{{else}}
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x">
{{/if}}
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 1</strong></h5> <h5><strong>Step 1</strong></h5>
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap <b>INSTALL</b>.</p> <p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap
<b>INSTALL</b>.</p>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive"> <img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-md-offset-2 col-lg-offset-2 add-padding-top-2x add-padding-bottom-2x">
{{#if isCloud}}
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 2</strong></h5> <h5><strong>Step 2</strong></h5>
<p>Enter your: <p>Enter your:
<p> <p>
@ -65,7 +67,14 @@
</ul> </ul>
<img src="{{@unit.publicUri}}/images/login.png" class="img-responsive"> <img src="{{@unit.publicUri}}/images/login.png" class="img-responsive">
</div> </div>
{{else}} {{else}}
<div class="row grey-bg">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 1</strong></h5>
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap
<b>INSTALL</b>.</p>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x"> <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 2</strong></h5> <h5><strong>Step 2</strong></h5>
@ -88,7 +97,7 @@
</ul> </ul>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive"> <img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
</div> </div>
{{/if}} {{/if}}
</div> </div>
@ -151,10 +160,10 @@
<br/> <br/>
{{#zone "topCss"}} {{#zone "topCss"}}
{{css "css/styles.css"}} {{css "css/styles.css"}}
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
{{js "js/type-view.js"}} {{js "js/type-view.js"}}
{{/zone}} {{/zone}}

Loading…
Cancel
Save