From 3f0f4ffeaeee7f1653b09a2ab7cbf76e91c9bf5b Mon Sep 17 00:00:00 2001 From: harshanL Date: Wed, 10 Dec 2014 14:10:04 +0530 Subject: [PATCH] Fixed issues in pom file & enrollment --- product/modules/agents/android/jax-rs/pom.xml | 129 +++++++++--------- .../main/java/cdm/api/android/Enrollment.java | 16 ++- product/modules/p2-profile-gen/pom.xml | 14 +- 3 files changed, 85 insertions(+), 74 deletions(-) diff --git a/product/modules/agents/android/jax-rs/pom.xml b/product/modules/agents/android/jax-rs/pom.xml index 306d7c24dc..190d08ff6b 100644 --- a/product/modules/agents/android/jax-rs/pom.xml +++ b/product/modules/agents/android/jax-rs/pom.xml @@ -19,10 +19,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - org.wso2.cdmserver - wso2cdmserver-parent + org.wso2.carbon + wso2cdm-parent 2.0.0-SNAPSHOT - ../../../../pom.xml + ../../../../../pom.xml 4.0.0 @@ -47,7 +47,7 @@ maven-war-plugin 2.2 - WEB-INF/lib/*.jar + ${project.artifactId} @@ -72,7 +72,8 @@ - + @@ -109,62 +110,68 @@ - - - org.apache.cxf - cxf-rt-frontend-jaxws - ${cxf.version} - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf.version} - - - org.apache.cxf - cxf-rt-transports-http - ${cxf.version} - - - junit - junit - test - ${junit.version} - - - commons-httpclient - commons-httpclient - 3.1 - - - javax.ws.rs - jsr311-api - 1.1.1 - - - com.google.code.gson - gson - 2.2.4 - - - org.wso2.carbon - org.wso2.carbon.utils - - - org.wso2.carbon - org.wso2.carbon.device.mgt.common - 2.0.0-SNAPSHOT - - - org.wso2.carbon - org.wso2.carbon.device.mgt.core - 2.0.0-SNAPSHOT - - - org.wso2.carbon - org.wso2.carbon.logging - - + + + org.apache.cxf + cxf-rt-frontend-jaxws + ${cxf.version} + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + org.apache.cxf + cxf-rt-transports-http + ${cxf.version} + + + junit + junit + test + ${junit.version} + + + commons-httpclient + commons-httpclient + 3.1 + provided + + + javax.ws.rs + jsr311-api + 1.1.1 + provided + + + com.google.code.gson + gson + 2.2.4 + + + org.wso2.carbon + org.wso2.carbon.utils + provided + + + org.wso2.carbon + org.wso2.carbon.device.mgt.common + 2.0.0-SNAPSHOT + provided + + + org.wso2.carbon + org.wso2.carbon.device.mgt.core + 2.0.0-SNAPSHOT + provided + + + org.wso2.carbon + org.wso2.carbon.logging + provided + + 2.6.1 4.8.2 diff --git a/product/modules/agents/android/jax-rs/src/main/java/cdm/api/android/Enrollment.java b/product/modules/agents/android/jax-rs/src/main/java/cdm/api/android/Enrollment.java index 141b76f0e1..a78f8051c4 100644 --- a/product/modules/agents/android/jax-rs/src/main/java/cdm/api/android/Enrollment.java +++ b/product/modules/agents/android/jax-rs/src/main/java/cdm/api/android/Enrollment.java @@ -72,26 +72,30 @@ public class Enrollment { @Consumes("application/json") @Path("{id}") public Response modifyEnrollment(@PathParam("id") String id) { + boolean status = false; CarbonContext context = CarbonContext.getThreadLocalCarbonContext(); DeviceManagementService dmService = (DeviceManagementService) context.getOSGiService(DeviceManagementService.class,null); try { - dmService.isRegistered(null); + status = dmService.isRegistered(null); } catch (DeviceManagementException e) { - e.printStackTrace(); + String msg = "Error occurred while modifying enrollment of the device"; + log.error(msg, e); } - return Response.status(201).entity("Registration Successful").build(); + return Response.status(201).entity(status).build(); } @DELETE @Path("{id}") public Response disenrollDevice(@PathParam("id") String id) { + boolean status = false; CarbonContext context = CarbonContext.getThreadLocalCarbonContext(); DeviceManagementService dmService = (DeviceManagementService) context.getOSGiService(DeviceManagementService.class,null); try { - dmService.isRegistered(null); + status = dmService.isRegistered(null); } catch (DeviceManagementException e) { - e.printStackTrace(); + String msg = "Error occurred while disenrolling the device"; + log.error(msg, e); } - return Response.status(201).entity("Registration Successful").build(); + return Response.status(201).entity(status).build(); } } diff --git a/product/modules/p2-profile-gen/pom.xml b/product/modules/p2-profile-gen/pom.xml index 2fece93e22..640e71117e 100644 --- a/product/modules/p2-profile-gen/pom.xml +++ b/product/modules/p2-profile-gen/pom.xml @@ -104,9 +104,9 @@ org.wso2.carbon:org.wso2.carbon.ndatasource.feature:${carbon.kernel.version} - - org.wso2.carbon:org.wso2.carbon.device.mgt.server.feature:${project.version} - + + + org.wso2.carbon:org.wso2.carbon.webapp.mgt.feature:${carbon.platform.version} @@ -157,10 +157,10 @@ org.wso2.carbon.ndatasource.ui.feature.group ${carbon.kernel.version} - - org.wso2.carbon.device.mgt.server.feature.group - ${project.version} - + + + + org.wso2.carbon.webapp.mgt.feature.group ${carbon.platform.version}