diff --git a/modules/distribution/src/repository/conf/cdm-config.xml b/modules/distribution/src/repository/conf/cdm-config.xml
index 4ac277e3..19a845e1 100644
--- a/modules/distribution/src/repository/conf/cdm-config.xml
+++ b/modules/distribution/src/repository/conf/cdm-config.xml
@@ -57,5 +57,10 @@
+
+
+ localhost
+ 9443
+
diff --git a/modules/p2-profile-gen/pom.xml b/modules/p2-profile-gen/pom.xml
index e2cb63c5..69c171aa 100644
--- a/modules/p2-profile-gen/pom.xml
+++ b/modules/p2-profile-gen/pom.xml
@@ -212,6 +212,9 @@
org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.gateway.feature:${carbon.api.mgt.version}
+
+ org.wso2.carbon.apimgt:org.wso2.carbon.forum.server.feature:${carbon.api.mgt.version}
+
@@ -883,6 +886,10 @@
org.wso2.carbon.apimgt.gateway.feature.group
${carbon.api.mgt.version}
+
+ org.wso2.carbon.forum.server.feature.group
+ ${carbon.api.mgt.version}
+
diff --git a/modules/samples/connectedcup/component/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
index 1c735cd4..7d3cc0af 100644
--- a/modules/samples/connectedcup/component/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
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
+
package org.coffeeking.agent.datasense;
import org.apache.commons.logging.Log;
diff --git a/modules/samples/connectedcup/component/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
index d520dc98..f4f33de4 100644
--- a/modules/samples/connectedcup/component/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
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
+
package org.coffeeking.agent.datasense;
import org.apache.commons.logging.Log;
diff --git a/modules/samples/connectedcup/component/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
index 797ddc3b..8804f715 100644
--- a/modules/samples/connectedcup/component/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
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
+
package org.coffeeking.agent.transport.mqtt;
import org.apache.commons.logging.Log;
diff --git a/modules/samples/connectedcup/component/analytics/build.xml b/modules/samples/connectedcup/component/analytics/build.xml
index 9f8b8850..2b91ec40 100644
--- a/modules/samples/connectedcup/component/analytics/build.xml
+++ b/modules/samples/connectedcup/component/analytics/build.xml
@@ -17,14 +17,14 @@
~ under the License.
-->
-
+
-
-
+
+
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventExecution_ConnectedCup_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventExecution_ConnectedCup_1.0.0/artifact.xml
deleted file mode 100644
index ea5b8630..00000000
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventExecution_ConnectedCup_1.0.0/artifact.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- EventExecution_ConnectedCup.siddhiql
-
-
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/artifacts.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/artifacts.xml
similarity index 57%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/artifacts.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/artifacts.xml
index 86306d71..652aab82 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/artifacts.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/artifacts.xml
@@ -18,10 +18,10 @@
-->
-
-
-
-
-
+
+
+
+
+
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventreceiver_coffeelevel_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_receiver/artifact.xml
similarity index 82%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventreceiver_coffeelevel_1.0.0/artifact.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_receiver/artifact.xml
index ab46c07d..ef5b1648 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventreceiver_coffeelevel_1.0.0/artifact.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_receiver/artifact.xml
@@ -17,6 +17,6 @@
~ under the License.
-->
-
- EventReceiver_coffeelevel.xml
+
+ coffee_level_receiver.xml
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventreceiver_coffeelevel_1.0.0/EventReceiver_coffeelevel.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_receiver/coffee_level_receiver.xml
similarity index 92%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventreceiver_coffeelevel_1.0.0/EventReceiver_coffeelevel.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_receiver/coffee_level_receiver.xml
index f61865c5..ebe3b990 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventreceiver_coffeelevel_1.0.0/EventReceiver_coffeelevel.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_receiver/coffee_level_receiver.xml
@@ -17,7 +17,7 @@
~ under the License.
-->
-
false
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Sparkscripts_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_script/artifact.xml
similarity index 83%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Sparkscripts_1.0.0/artifact.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_script/artifact.xml
index 0ed651a9..e43343eb 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Sparkscripts_1.0.0/artifact.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_script/artifact.xml
@@ -17,6 +17,6 @@
~ under the License.
-->
-
- CoffeeLevel_Sensor_Script.xml
+
+ coffee_level_script.xml
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Sparkscripts_1.0.0/CoffeeLevel_Sensor_Script.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_script/coffee_level_script.xml
similarity index 59%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Sparkscripts_1.0.0/CoffeeLevel_Sensor_Script.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_script/coffee_level_script.xml
index 84e3e693..15684e58 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Sparkscripts_1.0.0/CoffeeLevel_Sensor_Script.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_script/coffee_level_script.xml
@@ -18,20 +18,13 @@
-->
- CoffeeLevel_Sensor_Script
+ coffee_level_script
- 0 * * * * ?
+ 0 0/5 * * * ?
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstore_coffeelevel_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_store/artifact.xml
similarity index 87%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstore_coffeelevel_1.0.0/artifact.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_store/artifact.xml
index 74bd1698..2aeb6edf 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstore_coffeelevel_1.0.0/artifact.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_store/artifact.xml
@@ -17,6 +17,6 @@
~ under the License.
-->
-
+
org_wso2_iot_devices_coffeelevel.xml
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstore_coffeelevel_1.0.0/org_wso2_iot_devices_coffeelevel.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_store/org_wso2_iot_devices_coffeelevel.xml
similarity index 100%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstore_coffeelevel_1.0.0/org_wso2_iot_devices_coffeelevel.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_store/org_wso2_iot_devices_coffeelevel.xml
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstream_coffeelevel_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_stream/artifact.xml
similarity index 87%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstream_coffeelevel_1.0.0/artifact.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_stream/artifact.xml
index 5af619c1..14ed35ee 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstream_coffeelevel_1.0.0/artifact.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_stream/artifact.xml
@@ -17,7 +17,7 @@
~ under the License.
-->
-
+
org.wso2.iot.devices.coffeelevel_1.0.0.json
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstream_coffeelevel_1.0.0/org.wso2.iot.devices.coffeelevel_1.0.0.json b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_stream/org.wso2.iot.devices.coffeelevel_1.0.0.json
similarity index 82%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstream_coffeelevel_1.0.0/org.wso2.iot.devices.coffeelevel_1.0.0.json
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_stream/org.wso2.iot.devices.coffeelevel_1.0.0.json
index f9058d22..abcace4e 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/Eventstream_coffeelevel_1.0.0/org.wso2.iot.devices.coffeelevel_1.0.0.json
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/coffee_level/coffee_level_stream/org.wso2.iot.devices.coffeelevel_1.0.0.json
@@ -1,7 +1,7 @@
{
"name": "org.wso2.iot.devices.coffeelevel",
"version": "1.0.0",
- "nickName": "Coffee Level Data",
+ "nickName": "CoffeeLevel",
"description": "Coffee Level data received from the Device",
"metaData": [
{"name":"owner","type":"STRING"},
@@ -14,7 +14,4 @@
"name": "coffeelevel","type": "FLOAT"
}
]
-}
-
-
-
+}
\ No newline at end of file
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/artifacts.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/artifacts.xml
similarity index 62%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/artifacts.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/artifacts.xml
index 0269500e..f5ef3482 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/CoffeeLevel_Sensor/artifacts.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/artifacts.xml
@@ -18,13 +18,10 @@
-->
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventPublisher_ConnectedCup_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_execution/artifact.xml
similarity index 81%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventPublisher_ConnectedCup_1.0.0/artifact.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_execution/artifact.xml
index fc2dc057..b20dcc84 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventPublisher_ConnectedCup_1.0.0/artifact.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_execution/artifact.xml
@@ -17,6 +17,7 @@
~ under the License.
-->
-
- EventPublisher_ConnectedCup.xml
+
+ connected_cup_execution.siddhiql
+
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventExecution_ConnectedCup_1.0.0/EventExecution_ConnectedCup.siddhiql b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_execution/connected_cup_execution.siddhiql
similarity index 90%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventExecution_ConnectedCup_1.0.0/EventExecution_ConnectedCup.siddhiql
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_execution/connected_cup_execution.siddhiql
index 8983afbf..51552f2b 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventExecution_ConnectedCup_1.0.0/EventExecution_ConnectedCup.siddhiql
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_execution/connected_cup_execution.siddhiql
@@ -1,8 +1,8 @@
/* Enter a unique ExecutionPlan */
-@Plan:name('connectedcup_execution')
+@Plan:name('connected_cup_execution')
/* Enter a unique description for ExecutionPlan */
--- @Plan:description('connectedcup_execution')
+-- @Plan:description('connected_cup_execution')
/* define streams/tables and write queries here ... */
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventReceiver_ConnectedCup_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_publisher/artifact.xml
similarity index 81%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventReceiver_ConnectedCup_1.0.0/artifact.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_publisher/artifact.xml
index bbfbaceb..354893d8 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventReceiver_ConnectedCup_1.0.0/artifact.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_publisher/artifact.xml
@@ -17,6 +17,6 @@
~ under the License.
-->
-
- EventReceiver_ConnectedCup.xml
+
+ connected_cup_publisher.xml
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventPublisher_ConnectedCup_1.0.0/EventPublisher_ConnectedCup.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_publisher/connected_cup_publisher.xml
similarity index 87%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventPublisher_ConnectedCup_1.0.0/EventPublisher_ConnectedCup.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_publisher/connected_cup_publisher.xml
index 8a2615a5..58557f25 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventPublisher_ConnectedCup_1.0.0/EventPublisher_ConnectedCup.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_publisher/connected_cup_publisher.xml
@@ -17,7 +17,7 @@
~ under the License.
-->
-
+
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_receiver/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_receiver/artifact.xml
new file mode 100644
index 00000000..fc46f231
--- /dev/null
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_receiver/artifact.xml
@@ -0,0 +1,22 @@
+
+
+
+
+ connected_cup_receiver.xml
+
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventReceiver_ConnectedCup_1.0.0/EventReceiver_ConnectedCup.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_receiver/connected_cup_receiver.xml
similarity index 58%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventReceiver_ConnectedCup_1.0.0/EventReceiver_ConnectedCup.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_receiver/connected_cup_receiver.xml
index 94c1c435..cd9b0657 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventReceiver_ConnectedCup_1.0.0/EventReceiver_ConnectedCup.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_receiver/connected_cup_receiver.xml
@@ -17,17 +17,17 @@
~ under the License.
-->
-
+
- wso2/carbon.super/connectedcup/#
+ carbon.super/connectedcup/#
admin
- device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:3
- default
- https://localhost:9443/dynamic-client-web/register
- tcp://localhost:1883
+ device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:2
+ org.wso2.carbon.device.mgt.iot.input.adapter.mqtt.util.MQTTContentValidator
+ default
+ https://localhost:${carbon.https.port}/dynamic-client-web/register
+ tcp://${mqtt.broker.host}:${mqtt.broker.port}
true
-
-
+
\ No newline at end of file
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventStream_ConnectedCup_1.0.0/artifact.xml b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_stream/artifact.xml
similarity index 87%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventStream_ConnectedCup_1.0.0/artifact.xml
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_stream/artifact.xml
index b913ea40..7d5f267f 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventStream_ConnectedCup_1.0.0/artifact.xml
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_stream/artifact.xml
@@ -17,7 +17,7 @@
~ under the License.
-->
-
+
org.wso2.iot.connectedcup_1.0.0.json
diff --git a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventStream_ConnectedCup_1.0.0/org.wso2.iot.connectedcup_1.0.0.json b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_stream/org.wso2.iot.connectedcup_1.0.0.json
similarity index 91%
rename from modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventStream_ConnectedCup_1.0.0/org.wso2.iot.connectedcup_1.0.0.json
rename to modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_stream/org.wso2.iot.connectedcup_1.0.0.json
index ebdc9f25..a93e29e0 100644
--- a/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/ConnectedCup/EventStream_ConnectedCup_1.0.0/org.wso2.iot.connectedcup_1.0.0.json
+++ b/modules/samples/connectedcup/component/analytics/src/main/resources/carbonapps/connected_cup/connected_cup_stream/org.wso2.iot.connectedcup_1.0.0.json
@@ -1,7 +1,7 @@
{
"name": "org.wso2.iot.connectedcup",
"version": "1.0.0",
- "nickName": "connectedcup stream",
+ "nickName": "connectedcup",
"description": "This hold the device type stream of connectedcup",
"metaData": [
{"name": "owner", "type": "STRING"},
diff --git a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupManagerService.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupManagerService.java
deleted file mode 100644
index 8b26345c..00000000
--- a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupManagerService.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.coffeeking.api;
-
-import org.wso2.carbon.apimgt.annotations.api.API;
-import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Path("enrollment")
-@API( name="connectedcup_mgt", version="1.0.0", context="/connectedcup_mgt", tags = {"connectedcup"})
-@DeviceType("connectedcup")
-public interface ConnectedCupManagerService {
-
- @Path("/devices/{device_id}")
- @DELETE
- Response removeDevice(@PathParam("device_id") String deviceId);
-
- @Path("/devices/{device_id}")
- @PUT
- Response updateDevice(@PathParam("device_id") String deviceId,
- @QueryParam("name") String name);
-
- @Path("/devices/{device_id}")
- @GET
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- Response getDevice(@PathParam("device_id") String deviceId);
-
- @Path("/devices")
- @POST
- boolean register(@QueryParam("name") String name);
-
-}
diff --git a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupManagerServiceImpl.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupManagerServiceImpl.java
deleted file mode 100644
index d7b2e678..00000000
--- a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupManagerServiceImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2015, 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.coffeeking.api;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.coffeeking.api.util.APIUtil;
-import org.coffeeking.connectedcup.plugin.constants.ConnectedCupConstants;
-import org.wso2.carbon.device.mgt.common.Device;
-import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
-import org.wso2.carbon.device.mgt.common.DeviceManagementException;
-import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
-import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
-import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
-import java.util.Date;
-import java.util.UUID;
-
-@Path("enrollment")
-public class ConnectedCupManagerServiceImpl implements ConnectedCupManagerService {
-
- private static Log log = LogFactory.getLog(ConnectedCupManagerServiceImpl.class);
-
- @Path("/devices/{device_id}")
- @DELETE
- public Response removeDevice(@PathParam("device_id") String deviceId) {
- try {
- DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
- deviceIdentifier.setId(deviceId);
- deviceIdentifier.setType(ConnectedCupConstants.DEVICE_TYPE);
- if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier, DeviceGroupConstants.
- Permissions.DEFAULT_ADMIN_PERMISSIONS)) {
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- boolean removed = APIUtil.getDeviceManagementService().disenrollDevice(
- deviceIdentifier);
- if (removed) {
- return Response.ok().build();
- } else {
- return Response.status(Response.Status.NOT_ACCEPTABLE.getStatusCode()).build();
- }
- } catch (DeviceManagementException e) {
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- }catch (DeviceAccessAuthorizationException e) {
- log.error(e.getErrorMessage(), e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- }
- }
-
- @Path("/devices/{device_id}")
- @PUT
- public Response updateDevice(@PathParam("device_id") String deviceId, @QueryParam("name") String name) {
- DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
- deviceIdentifier.setId(deviceId);
- deviceIdentifier.setType(ConnectedCupConstants.DEVICE_TYPE);
- try {
- if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier, DeviceGroupConstants.
- Permissions.DEFAULT_ADMIN_PERMISSIONS)) {
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
- device.setDeviceIdentifier(deviceId);
- device.getEnrolmentInfo().setDateOfLastUpdate(new Date().getTime());
- device.setName(name);
- device.setType(ConnectedCupConstants.DEVICE_TYPE);
- boolean updated = APIUtil.getDeviceManagementService().modifyEnrollment(device);
- if (updated) {
- return Response.ok().build();
- } else {
- return Response.status(Response.Status.NOT_ACCEPTABLE.getStatusCode()).build();
- }
- } catch (DeviceManagementException e) {
- log.error(e.getErrorMessage());
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- } catch (DeviceAccessAuthorizationException e) {
- log.error(e.getErrorMessage(), e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- }
- }
-
- @Path("/devices/{device_id}")
- @GET
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public Response getDevice(@PathParam("device_id") String deviceId) {
-
- DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
- deviceIdentifier.setId(deviceId);
- deviceIdentifier.setType(ConnectedCupConstants.DEVICE_TYPE);
- try {
- if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
- return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
- }
- Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
- return Response.ok().entity(device).build();
- } catch (DeviceManagementException ex) {
- log.error("Error occurred while retrieving device with Id " + deviceId + "\n" + ex);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- } catch (DeviceAccessAuthorizationException e) {
- log.error(e.getErrorMessage(), e);
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
- }
- }
-
- @Path("/devices")
- @POST
- public boolean register(@QueryParam("name") String name) {
- try {
- DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
- String deviceId = shortUUID();
- deviceIdentifier.setId(deviceId);
- deviceIdentifier.setType(ConnectedCupConstants.DEVICE_TYPE);
- if (APIUtil.getDeviceManagementService().isEnrolled(deviceIdentifier)) {
- return false;
- }
- Device device = new Device();
- device.setDeviceIdentifier(deviceId);
- EnrolmentInfo enrolmentInfo = new EnrolmentInfo();
- enrolmentInfo.setDateOfEnrolment(new Date().getTime());
- enrolmentInfo.setDateOfLastUpdate(new Date().getTime());
- enrolmentInfo.setStatus(EnrolmentInfo.Status.ACTIVE);
- enrolmentInfo.setOwnership(EnrolmentInfo.OwnerShip.BYOD);
- device.setName(name);
- device.setType(ConnectedCupConstants.DEVICE_TYPE);
- enrolmentInfo.setOwner(APIUtil.getAuthenticatedUser());
- device.setEnrolmentInfo(enrolmentInfo);
- return APIUtil.getDeviceManagementService().enrollDevice(device);
- } catch (DeviceManagementException e) {
- return false;
- }
- }
-
- private static String shortUUID() {
- UUID uuid = UUID.randomUUID();
- long l = ByteBuffer.wrap(uuid.toString().getBytes(StandardCharsets.UTF_8)).getLong();
- return Long.toString(l, Character.MAX_RADIX);
- }
-
-}
\ No newline at end of file
diff --git a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupControllerService.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupService.java
similarity index 75%
rename from modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupControllerService.java
rename to modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupService.java
index f89a405e..46db399f 100644
--- a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupControllerService.java
+++ b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupService.java
@@ -19,6 +19,7 @@
package org.coffeeking.api;
import org.wso2.carbon.apimgt.annotations.api.API;
+import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
@@ -35,12 +36,12 @@ import javax.ws.rs.core.Response;
@API(name = "connectedcup", version = "1.0.0", context = "/connectedcup", tags = {"connectedcup"})
@DeviceType(value = "connectedcup")
-public interface ConnectedCupControllerService {
+public interface ConnectedCupService {
@Path("device/ordercoffee")
@POST
- @Feature(code = "ordercoffee", name = "Order Coffee", type = "control",
- description = "Order coffee cup")
+ @Feature(code = "ordercoffee", name = "Order Coffee", description = "Order coffee cup")
+ @Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/operations"})
Response orderCoffee(@QueryParam("deviceId") String deviceId);
/**
@@ -50,7 +51,13 @@ public interface ConnectedCupControllerService {
@GET
@Consumes("application/json")
@Produces("application/json")
+ @Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/stats"})
Response getDeviceStats(@PathParam("deviceId") String deviceId, @PathParam("sensorName") String sensor,
@QueryParam("from") long from, @QueryParam("to") long to);
+ @Path("device/register")
+ @POST
+ @Permission(scope = "connectedcup_user", permissions = {"/permission/admin/device-mgt/user/devices"})
+ boolean register(@QueryParam("name") String name);
+
}
diff --git a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupControllerServiceImpl.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java
similarity index 72%
rename from modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupControllerServiceImpl.java
rename to modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java
index f41e77c4..ca23eaf9 100644
--- a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupControllerServiceImpl.java
+++ b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/ConnectedCupServiceImpl.java
@@ -23,7 +23,10 @@ import org.apache.commons.logging.LogFactory;
import org.coffeeking.api.util.APIUtil;
import org.coffeeking.api.util.SensorRecord;
import org.coffeeking.connectedcup.plugin.constants.ConnectedCupConstants;
+import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
+import org.wso2.carbon.device.mgt.common.DeviceManagementException;
+import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
import org.wso2.carbon.analytics.dataservice.commons.SORT;
import org.wso2.carbon.analytics.dataservice.commons.SortByField;
@@ -38,12 +41,16 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
+import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
+import java.util.UUID;
-public class ConnectedCupControllerServiceImpl implements ConnectedCupControllerService {
+public class ConnectedCupServiceImpl implements ConnectedCupService {
- private static Log log = LogFactory.getLog(ConnectedCupControllerServiceImpl.class);
+ private static Log log = LogFactory.getLog(ConnectedCupServiceImpl.class);
@Path("device/ordercoffee")
@POST
@@ -116,4 +123,38 @@ public class ConnectedCupControllerServiceImpl implements ConnectedCupController
return sensorEventTableName;
}
+ @Path("device/register")
+ @POST
+ public boolean register(@QueryParam("name") String name) {
+ try {
+ DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
+ String deviceId = shortUUID();
+ deviceIdentifier.setId(deviceId);
+ deviceIdentifier.setType(ConnectedCupConstants.DEVICE_TYPE);
+ if (APIUtil.getDeviceManagementService().isEnrolled(deviceIdentifier)) {
+ return false;
+ }
+ Device device = new Device();
+ device.setDeviceIdentifier(deviceId);
+ EnrolmentInfo enrolmentInfo = new EnrolmentInfo();
+ enrolmentInfo.setDateOfEnrolment(new Date().getTime());
+ enrolmentInfo.setDateOfLastUpdate(new Date().getTime());
+ enrolmentInfo.setStatus(EnrolmentInfo.Status.ACTIVE);
+ enrolmentInfo.setOwnership(EnrolmentInfo.OwnerShip.BYOD);
+ device.setName(name);
+ device.setType(ConnectedCupConstants.DEVICE_TYPE);
+ enrolmentInfo.setOwner(APIUtil.getAuthenticatedUser());
+ device.setEnrolmentInfo(enrolmentInfo);
+ return APIUtil.getDeviceManagementService().enrollDevice(device);
+ } catch (DeviceManagementException e) {
+ return false;
+ }
+ }
+
+ private static String shortUUID() {
+ UUID uuid = UUID.randomUUID();
+ long l = ByteBuffer.wrap(uuid.toString().getBytes(StandardCharsets.UTF_8)).getLong();
+ return Long.toString(l, Character.MAX_RADIX);
+ }
+
}
diff --git a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java
index d7091bfe..08a3bc94 100644
--- a/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java
+++ b/modules/samples/connectedcup/component/api/src/main/java/org/coffeeking/api/util/APIUtil.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
+
package org.coffeeking.api.util;
import org.apache.commons.logging.Log;
diff --git a/modules/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml b/modules/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml
index 9e9db10e..e216705b 100644
--- a/modules/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml
+++ b/modules/samples/connectedcup/component/api/src/main/webapp/META-INF/permissions.xml
@@ -29,31 +29,10 @@
-
- Get device
- /device-mgt/user/devices/list
- /enrollment/devices/*
- GET
- connectedcup_user
-
-
- Remove device
- /device-mgt/user/devices/remove
- /enrollment/devices/*
- DELETE
- connectedcup_user
-
-
- Update device
- /device-mgt/user/devices/update
- /enrollment/devices/*
- PUT
- connectedcup_user
-
Register a device
/device-mgt/user/devices
- /enrollment/devices
+ /device/register
POST
connectedcup_user
@@ -69,6 +48,6 @@
/device-mgt/user/stats
/stats/*/sensors/*
GET
- android_sense_device
+ connectedcup_user
\ No newline at end of file
diff --git a/modules/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml b/modules/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml
index b14eb4a0..5dfc1661 100644
--- a/modules/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml
+++ b/modules/samples/connectedcup/component/api/src/main/webapp/WEB-INF/cxf-servlet.xml
@@ -27,11 +27,8 @@
-
-
-
+
diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java
index ac179ebc..8cfe4f0f 100644
--- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java
+++ b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/constants/ConnectedCupConstants.java
@@ -1,8 +1,22 @@
+/*
+ * 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.
+ */
package org.coffeeking.connectedcup.plugin.constants;
-/**
- * Created by menaka on 1/11/16.
- */
public class ConnectedCupConstants {
public final static String DEVICE_TYPE = "connectedcup";
public final static String DEVICE_PLUGIN_DEVICE_NAME = "DEVICE_NAME";
diff --git a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/exception/ConnectedCupDeviceMgtPluginException.java b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/exception/ConnectedCupDeviceMgtPluginException.java
index 296ea59b..8428559d 100644
--- a/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/exception/ConnectedCupDeviceMgtPluginException.java
+++ b/modules/samples/connectedcup/component/plugin/src/main/java/org/coffeeking/connectedcup/plugin/exception/ConnectedCupDeviceMgtPluginException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ * 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
diff --git a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/public/js/devicetype-graph.js b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/public/js/devicetype-graph.js
index ae85f661..5b5b79e9 100644
--- a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/public/js/devicetype-graph.js
+++ b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.analytics-view/public/js/devicetype-graph.js
@@ -18,7 +18,7 @@
var palette = new Rickshaw.Color.Palette({scheme: "classic9"});
-function drawGraph(from, to) {
+function drawGraph_connectedcup(from, to) {
retrieveDataAndDrawLineGraph("temperature", from, to);
retrieveDataAndDrawLineGraph("coffeelevel", from, to);
}
diff --git a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view/private/config.json b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view/private/config.json
new file mode 100644
index 00000000..685ee7ff
--- /dev/null
+++ b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view/private/config.json
@@ -0,0 +1,6 @@
+{
+ "deviceType": {
+ "label": "Connected Cup",
+ "category": "virtual"
+ }
+}
\ No newline at end of file
diff --git a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view/public/js/download.js b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view/public/js/download.js
index 2a11e164..752690e3 100644
--- a/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view/public/js/download.js
+++ b/modules/samples/connectedcup/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.connectedcup.type-view/public/js/download.js
@@ -145,7 +145,7 @@ function downloadAgent() {
payload.name = $inputs[0].value;
payload.owner = $inputs[1].value;
- var connectedCupRegisterURL = "/connectedcup/enrollment/devices?name=" + encodeURI(payload.name);
+ var connectedCupRegisterURL = "/connectedcup/device/register?name=" + encodeURI(payload.name);
invokerUtil.post(
connectedCupRegisterURL,