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>
@ -109,62 +110,68 @@
</profile> </profile>
</profiles> </profiles>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId> <artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version> <version>${cxf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId> <artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version> <version>${cxf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId> <artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version> <version>${cxf.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
<version>${junit.version}</version> <version>${junit.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId> <artifactId>commons-httpclient</artifactId>
<version>3.1</version> <version>3.1</version>
</dependency> <scope>provided</scope>
<dependency> </dependency>
<groupId>javax.ws.rs</groupId> <dependency>
<artifactId>jsr311-api</artifactId> <groupId>javax.ws.rs</groupId>
<version>1.1.1</version> <artifactId>jsr311-api</artifactId>
</dependency> <version>1.1.1</version>
<dependency> <scope>provided</scope>
<groupId>com.google.code.gson</groupId> </dependency>
<artifactId>gson</artifactId> <dependency>
<version>2.2.4</version> <groupId>com.google.code.gson</groupId>
</dependency> <artifactId>gson</artifactId>
<dependency> <version>2.2.4</version>
<groupId>org.wso2.carbon</groupId> </dependency>
<artifactId>org.wso2.carbon.utils</artifactId> <dependency>
</dependency> <groupId>org.wso2.carbon</groupId>
<dependency> <artifactId>org.wso2.carbon.utils</artifactId>
<groupId>org.wso2.carbon</groupId> <scope>provided</scope>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId> </dependency>
<version>2.0.0-SNAPSHOT</version> <dependency>
</dependency> <groupId>org.wso2.carbon</groupId>
<dependency> <artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<groupId>org.wso2.carbon</groupId> <version>2.0.0-SNAPSHOT</version>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId> <scope>provided</scope>
<version>2.0.0-SNAPSHOT</version> </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.logging</artifactId> <version>2.0.0-SNAPSHOT</version>
</dependency> <scope>provided</scope>
</dependencies> </dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<properties> <properties>
<cxf.version>2.6.1</cxf.version> <cxf.version>2.6.1</cxf.version>
<junit.version>4.8.2</junit.version> <junit.version>4.8.2</junit.version>

@ -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