From d9f48423e3ed0a10d1de3088736ee369ccc6e24d Mon Sep 17 00:00:00 2001 From: GPrathap Date: Thu, 25 Feb 2016 19:25:06 +0530 Subject: [PATCH] Fix for JIRA IOTS-79 --- .../resources/META-INF/maven/archetype-metadata.xml | 4 ++-- .../archetype-resources/component/analytics/pom.xml | 2 +- .../archetype-resources/component/controller/pom.xml | 2 +- .../controller/api/ControllerService.java | 12 +++--------- .../archetype-resources/component/manager/pom.xml | 2 +- .../archetype-resources/component/plugin/pom.xml | 8 ++++---- .../resources/archetype-resources/component/pom.xml | 2 +- .../archetype-resources/component/ui/pom.xml | 2 +- .../archetype-resources/feature/feature/pom.xml | 2 +- .../resources/archetype-resources/feature/pom.xml | 2 +- 10 files changed, 16 insertions(+), 22 deletions(-) diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index df8c0a31..d2cff1cb 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -21,7 +21,7 @@ - + @@ -149,7 +149,7 @@ - + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/analytics/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/analytics/pom.xml index 58302f07..c15ef204 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/analytics/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/analytics/pom.xml @@ -19,7 +19,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${groupId} - component + ${rootArtifactId}-component ${version} ../pom.xml diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/pom.xml index ae62e9cc..28698904 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/pom.xml @@ -19,7 +19,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${groupId} - component + ${rootArtifactId}-component ${version} ../pom.xml diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/java/__groupId__/__rootArtifactId__/controller/api/ControllerService.java b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/java/__groupId__/__rootArtifactId__/controller/api/ControllerService.java index 5238f257..52e657cd 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/java/__groupId__/__rootArtifactId__/controller/api/ControllerService.java +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/java/__groupId__/__rootArtifactId__/controller/api/ControllerService.java @@ -142,15 +142,10 @@ public class ControllerService { @POST @Consumes(MediaType.APPLICATION_JSON) public void pushData(final DeviceJSON agentInfo, @Context HttpServletResponse response) { - String owner = agentInfo.owner; - String deviceId = agentInfo.deviceId; - float pinData = agentInfo.sensorValue; - log.warn(pinData); - log.warn(String.valueOf(pinData)); - if (!ServiceUtils.publishToDASSensorValue(agentInfo.owner, agentInfo.deviceId, pinData)) { + if (!ServiceUtils.publishToDASSensorValue(agentInfo.owner, agentInfo.deviceId, agentInfo.sensorValue)) { response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); - log.warn("An error occurred whilst trying to publish pin data of go Data with ID [" + deviceId + - "] of owner [" + owner + "]"); + log.warn("An error occurred whilst trying to publish pin data of go Data with ID [" + agentInfo.deviceId + + "] of owner [" + agentInfo.owner + "]"); } } @@ -170,7 +165,6 @@ public class ControllerService { @Context HttpServletResponse response) { try { mqttConnector.sendCommandViaMQTT(owner, deviceId, "Sensor:", state.toUpperCase()); - response.setStatus(Response.Status.OK.getStatusCode()); } catch (DeviceManagementException e) { log.error(e); diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/pom.xml index ee3bdf1d..8a137283 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/pom.xml @@ -19,7 +19,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${groupId} - component + ${rootArtifactId}-component ${version} ../pom.xml diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/pom.xml index d1c942c9..145a5dd2 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/pom.xml @@ -19,7 +19,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${groupId} - component + ${rootArtifactId}-component ${version} ../pom.xml @@ -56,7 +56,7 @@ ${artifactId} ${version} IoT Server Impl Bundle - ${groupId}.${rootArtifactId}.plugin.internal + ${project-base-package}.plugin.internal org.osgi.framework, org.osgi.service.component, @@ -73,8 +73,8 @@ org.wso2.carbon.device.mgt.iot.*, - !${groupId}.${rootArtifactId}.plugin.internal, - ${groupId}.${rootArtifactId}.plugin.* + !${project-base-package}.plugin.internal, + ${project-base-package}.plugin.* diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/pom.xml index 966cc1d2..020ee93d 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/pom.xml @@ -25,7 +25,7 @@ 4.0.0 ${version} - ${artifactId} + ${rootArtifactId}-component pom diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/ui/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/ui/pom.xml index 8179af4e..405b95ba 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/ui/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/ui/pom.xml @@ -21,7 +21,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> ${groupId} - component + ${rootArtifactId}-component ${version} ../pom.xml diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml index e67eab67..4f97d376 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml @@ -19,7 +19,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${groupId} - feature + ${rootArtifactId}-feature ${version} ../pom.xml diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/pom.xml index 530e9007..cf0b704c 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/pom.xml +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/pom.xml @@ -23,7 +23,7 @@ ${version} ../pom.xml - ${artifactId} + ${rootArtifactId}-feature 4.0.0 pom ${version}