diff --git a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/DevicesManagerService.java b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/DevicesManagerService.java index cd126d6214..58841062b0 100644 --- a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/DevicesManagerService.java +++ b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/DevicesManagerService.java @@ -280,22 +280,6 @@ import java.util.List; } } - @Path("/device/group/{groupId}/{limit}") - @GET - @Consumes("application/json") - @Produces("application/json") - public Device[] getDevices(@PathParam("groupId") int groupId, @PathParam("limit") int limit){ - try{ - List devices = this.getServiceProvider().getDevices(groupId,limit); - return this.getActiveDevices(devices); - } catch (DeviceManagementException e) { - response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); - return null; - } finally { - this.endTenantFlow(); - } - } - @Path("/device/role/{role}/all") @GET @Consumes("application/json") diff --git a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/GroupManagerService.java b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/GroupManagerService.java index dddcd94027..2f3eec377d 100644 --- a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/GroupManagerService.java +++ b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot.api/src/main/java/org/wso2/carbon/device/mgt/iot/api/GroupManagerService.java @@ -24,6 +24,7 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.group.common.DeviceGroup; import org.wso2.carbon.device.mgt.group.common.GroupManagementException; import org.wso2.carbon.device.mgt.group.common.GroupUser; @@ -407,14 +408,14 @@ public class GroupManagerService { return usersArray; } - @Path("/group/id/{groupId}/device/{limit}") + @Path("/group/id/{groupId}/device/all") @GET @Consumes("application/json") @Produces("application/json") - public Device[] getDevices(@PathParam("groupId") int groupId,@PathParam("limit") int limit) { + public Device[] getDevices(@PathParam("groupId") int groupId) { Device[] deviceArray = null; try { - List devices = this.getServiceProvider().getDevices(groupId,limit); + List devices = this.getServiceProvider().getDevices(groupId); deviceArray = new Device[devices.size()]; response.setStatus(Response.Status.OK.getStatusCode()); devices.toArray(deviceArray); @@ -427,6 +428,40 @@ public class GroupManagerService { return deviceArray; } + @Path("/group/id/{groupId}/device/count") + @GET + @Consumes("application/json") + @Produces("application/json") + public int getDeviceCount(@PathParam("groupId") int groupId) { + try { + return this.getServiceProvider().getDeviceCount(groupId); + } catch (GroupManagementException e) { + response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); + log.error(e.getErrorMessage(), e); + return -1; + } finally { + this.endTenantFlow(); + } + } + + @Path("/group/id/{groupId}/device") + @GET + @Consumes("application/json") + @Produces("application/json") + public PaginationResult getDevices(@PathParam("groupId") int groupId, + @QueryParam("index") int index, + @QueryParam("limit") int limit) { + try { + return this.getServiceProvider().getDevices(groupId, index, limit); + } catch (GroupManagementException e) { + response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); + log.error(e.getErrorMessage(), e); + return null; + } finally { + this.endTenantFlow(); + } + } + @Path("/group/id/{groupId}/device/assign") @PUT @Consumes("application/json") diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs index f45e9d7842..3057bdd7f4 100644 --- a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.type-view/type-view.hbs @@ -1,4 +1,4 @@ -
+

Digital Display


Connect your Digital Display @@ -37,35 +37,30 @@

Name your device and download the agent from following link.


-
-
- -
- - -
- +
+
+ +
+ +
-
-
- - - +
+ +
@@ -202,7 +197,7 @@

    01 Click on the 'Create DEB' button above to get the download link for the Digital Display setup files

    -

    02 (The following commands can be issued by directly typing into the terminal of the device or by an 'ssh' login from a remote PC)

    +

    02 (The following commands can be issued by directly typing into the terminal of the device or by an 'ssh' login from a remote PC)

    03 Download the Digital Display setup files using the following command: 'curl -k < url_link_received_from_the_above_step >> Agent.zip'
    This will download a zip file named 'Agent.zip'


diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.hbs b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.hbs index 347cf1af21..1e307afadf 100644 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.hbs +++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.hbs @@ -33,7 +33,7 @@ - + diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.js b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.js index 3f259272cf..95db4155c0 100644 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.js +++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.stats/stats.js @@ -1,6 +1,6 @@ function onRequest(context) { var log = new Log("stats.js"); - var operationModule = require("/modules/operation.js").operationModule; + var operationModule = require("/app/modules/operation.js").operationModule; var device = context.unit.params.device; log.info(device); var monitor_operations = JSON.stringify(operationModule.getMonitorOperations(device.type));