diff --git a/modules/samples/connectedcup/component/connected-cup-agent/pom.xml b/modules/samples/connectedcup/component/agent/pom.xml
similarity index 98%
rename from modules/samples/connectedcup/component/connected-cup-agent/pom.xml
rename to modules/samples/connectedcup/component/agent/pom.xml
index a2415794..e3308618 100644
--- a/modules/samples/connectedcup/component/connected-cup-agent/pom.xml
+++ b/modules/samples/connectedcup/component/agent/pom.xml
@@ -7,7 +7,7 @@
../pom.xml
4.0.0
- org.coffeking.agent
+ org.coffeeking.agent
war
1.9.2-SNAPSHOT
connected-cup-agent Maven Webapp
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/datasense/PushLevel.java b/modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/datasense/PushLevel.java
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/datasense/PushLevel.java
rename to modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/datasense/PushLevel.java
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/datasense/PushTemperature.java b/modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/datasense/PushTemperature.java
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/datasense/PushTemperature.java
rename to modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/datasense/PushTemperature.java
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/TransportHandler.java b/modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/TransportHandler.java
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/TransportHandler.java
rename to modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/TransportHandler.java
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/TransportHandlerException.java b/modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/TransportHandlerException.java
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/TransportHandlerException.java
rename to modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/TransportHandlerException.java
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/mqtt/ConnectedCupMQttTransportHandler.java b/modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/mqtt/ConnectedCupMQttTransportHandler.java
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/mqtt/ConnectedCupMQttTransportHandler.java
rename to modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/mqtt/ConnectedCupMQttTransportHandler.java
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/mqtt/MQTTTransportHandler.java b/modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/mqtt/MQTTTransportHandler.java
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/java/org/coffeeking/agent/transport/mqtt/MQTTTransportHandler.java
rename to modules/samples/connectedcup/component/agent/src/main/java/org/coffeeking/agent/transport/mqtt/MQTTTransportHandler.java
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/WEB-INF/web.xml b/modules/samples/connectedcup/component/agent/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/WEB-INF/web.xml
rename to modules/samples/connectedcup/component/agent/src/main/webapp/WEB-INF/web.xml
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/bootstrap.min.css b/modules/samples/connectedcup/component/agent/src/main/webapp/bootstrap.min.css
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/bootstrap.min.css
rename to modules/samples/connectedcup/component/agent/src/main/webapp/bootstrap.min.css
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/coffeecup.png b/modules/samples/connectedcup/component/agent/src/main/webapp/coffeecup.png
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/coffeecup.png
rename to modules/samples/connectedcup/component/agent/src/main/webapp/coffeecup.png
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/css/bootstrap.min.css b/modules/samples/connectedcup/component/agent/src/main/webapp/css/bootstrap.min.css
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/css/bootstrap.min.css
rename to modules/samples/connectedcup/component/agent/src/main/webapp/css/bootstrap.min.css
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/css/jquery-ui.css b/modules/samples/connectedcup/component/agent/src/main/webapp/css/jquery-ui.css
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/css/jquery-ui.css
rename to modules/samples/connectedcup/component/agent/src/main/webapp/css/jquery-ui.css
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/images/coffeecup.png b/modules/samples/connectedcup/component/agent/src/main/webapp/images/coffeecup.png
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/images/coffeecup.png
rename to modules/samples/connectedcup/component/agent/src/main/webapp/images/coffeecup.png
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/index.jsp b/modules/samples/connectedcup/component/agent/src/main/webapp/index.jsp
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/index.jsp
rename to modules/samples/connectedcup/component/agent/src/main/webapp/index.jsp
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/jquery-1.12.0.min.js b/modules/samples/connectedcup/component/agent/src/main/webapp/jquery-1.12.0.min.js
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/jquery-1.12.0.min.js
rename to modules/samples/connectedcup/component/agent/src/main/webapp/jquery-1.12.0.min.js
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/jquery-ui.css b/modules/samples/connectedcup/component/agent/src/main/webapp/jquery-ui.css
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/jquery-ui.css
rename to modules/samples/connectedcup/component/agent/src/main/webapp/jquery-ui.css
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/jquery-ui.js b/modules/samples/connectedcup/component/agent/src/main/webapp/jquery-ui.js
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/jquery-ui.js
rename to modules/samples/connectedcup/component/agent/src/main/webapp/jquery-ui.js
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/js/libs/jquery-1.12.0.min.js b/modules/samples/connectedcup/component/agent/src/main/webapp/js/libs/jquery-1.12.0.min.js
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/js/libs/jquery-1.12.0.min.js
rename to modules/samples/connectedcup/component/agent/src/main/webapp/js/libs/jquery-1.12.0.min.js
diff --git a/modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/js/libs/jquery-ui.js b/modules/samples/connectedcup/component/agent/src/main/webapp/js/libs/jquery-ui.js
similarity index 100%
rename from modules/samples/connectedcup/component/connected-cup-agent/src/main/webapp/js/libs/jquery-ui.js
rename to modules/samples/connectedcup/component/agent/src/main/webapp/js/libs/jquery-ui.js
diff --git a/modules/samples/connectedcup/component/pom.xml b/modules/samples/connectedcup/component/pom.xml
index 4fd10f7c..f32b6827 100644
--- a/modules/samples/connectedcup/component/pom.xml
+++ b/modules/samples/connectedcup/component/pom.xml
@@ -40,7 +40,8 @@
plugin
controller
manager
- connected-cup-agent
+ agent
+
diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.hbs b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.hbs
index ee2213f7..c26c6d41 100644
--- a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.hbs
+++ b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.hbs
@@ -18,7 +18,7 @@
diff --git a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.js b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.js
index 23d67125..530e0710 100644
--- a/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.js
+++ b/modules/samples/connectedcup/feature/connectedcup-feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.device-view/device-view.js
@@ -22,6 +22,9 @@ function onRequest(context) {
var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id");
+ var property = require("process").getProperty;
+ var serverIp = property("carbon.local.ip");
+
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId);
@@ -29,7 +32,8 @@ function onRequest(context) {
if (device && device.status != "error") {
log.info(device);
var deviceProperties = device.properties;
- device.accessToken = deviceProperties.accessToken
+ device.accessToken = deviceProperties.accessToken;
+ device.ip = serverIp;
return {"device": device};
}
}