Fixed issues in pom file & enrollment

revert-70aa11f8
harshanL 10 years ago
parent 267d27745d
commit 3f0f4ffeae

@ -19,10 +19,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<groupId>org.wso2.cdmserver</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>wso2cdmserver-parent</artifactId> <artifactId>wso2cdm-parent</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath> <relativePath>../../../../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -47,7 +47,7 @@
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<version>2.2</version> <version>2.2</version>
<configuration> <configuration>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> <!--<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>-->
<warName>${project.artifactId}</warName> <warName>${project.artifactId}</warName>
</configuration> </configuration>
</plugin> </plugin>
@ -72,7 +72,8 @@
</goals> </goals>
<configuration> <configuration>
<tasks> <tasks>
<copy todir="${basedir}/../../../repository/deployment/server/webapps" overwrite="true"> <copy todir="${basedir}/../../../repository/deployment/server/webapps"
overwrite="true">
<fileset dir="${basedir}/target"> <fileset dir="${basedir}/target">
<include name="${project.artifactId}.war"/> <include name="${project.artifactId}.war"/>
</fileset> </fileset>
@ -135,11 +136,13 @@
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId> <artifactId>commons-httpclient</artifactId>
<version>3.1</version> <version>3.1</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.ws.rs</groupId> <groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId> <artifactId>jsr311-api</artifactId>
<version>1.1.1</version> <version>1.1.1</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
@ -149,20 +152,24 @@
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId> <artifactId>org.wso2.carbon.utils</artifactId>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId> <artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId> <artifactId>org.wso2.carbon.device.mgt.core</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId> <artifactId>org.wso2.carbon.logging</artifactId>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<properties> <properties>

@ -72,26 +72,30 @@ public class Enrollment {
@Consumes("application/json") @Consumes("application/json")
@Path("{id}") @Path("{id}")
public Response modifyEnrollment(@PathParam("id") String id) { public Response modifyEnrollment(@PathParam("id") String id) {
boolean status = false;
CarbonContext context = CarbonContext.getThreadLocalCarbonContext(); CarbonContext context = CarbonContext.getThreadLocalCarbonContext();
DeviceManagementService dmService = (DeviceManagementService) context.getOSGiService(DeviceManagementService.class,null); DeviceManagementService dmService = (DeviceManagementService) context.getOSGiService(DeviceManagementService.class,null);
try { try {
dmService.isRegistered(null); status = dmService.isRegistered(null);
} catch (DeviceManagementException e) { } 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 @DELETE
@Path("{id}") @Path("{id}")
public Response disenrollDevice(@PathParam("id") String id) { public Response disenrollDevice(@PathParam("id") String id) {
boolean status = false;
CarbonContext context = CarbonContext.getThreadLocalCarbonContext(); CarbonContext context = CarbonContext.getThreadLocalCarbonContext();
DeviceManagementService dmService = (DeviceManagementService) context.getOSGiService(DeviceManagementService.class,null); DeviceManagementService dmService = (DeviceManagementService) context.getOSGiService(DeviceManagementService.class,null);
try { try {
dmService.isRegistered(null); status = dmService.isRegistered(null);
} catch (DeviceManagementException e) { } 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();
} }
} }

@ -104,9 +104,9 @@
<featureArtifactDef> <featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.ndatasource.feature:${carbon.kernel.version} org.wso2.carbon:org.wso2.carbon.ndatasource.feature:${carbon.kernel.version}
</featureArtifactDef> </featureArtifactDef>
<featureArtifactDef> <!--<featureArtifactDef>-->
org.wso2.carbon:org.wso2.carbon.device.mgt.server.feature:${project.version} <!--org.wso2.carbon:org.wso2.carbon.device.mgt.server.feature:${project.version}-->
</featureArtifactDef> <!--</featureArtifactDef>-->
<featureArtifactDef> <featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.webapp.mgt.feature:${carbon.platform.version} org.wso2.carbon:org.wso2.carbon.webapp.mgt.feature:${carbon.platform.version}
</featureArtifactDef> </featureArtifactDef>
@ -157,10 +157,10 @@
<id>org.wso2.carbon.ndatasource.ui.feature.group</id> <id>org.wso2.carbon.ndatasource.ui.feature.group</id>
<version>${carbon.kernel.version}</version> <version>${carbon.kernel.version}</version>
</feature> </feature>
<feature> <!--<feature>-->
<id>org.wso2.carbon.device.mgt.server.feature.group</id> <!--<id>org.wso2.carbon.device.mgt.server.feature.group</id>-->
<version>${project.version}</version> <!--<version>${project.version}</version>-->
</feature> <!--</feature>-->
<feature> <feature>
<id>org.wso2.carbon.webapp.mgt.feature.group</id> <id>org.wso2.carbon.webapp.mgt.feature.group</id>
<version>${carbon.platform.version}</version> <version>${carbon.platform.version}</version>

Loading…
Cancel
Save