diff --git a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeService.java b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeService.java index 438f4453..9f15b66c 100644 --- a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeService.java +++ b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeService.java @@ -80,5 +80,5 @@ public interface DeviceTypeService { @GET @Produces("application/zip") @Permission(scope = "CONNECTEDLAP_user", permissions = {"/permission/admin/device-mgt/download"}) - Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketchType") String sketchType); + Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketchType") String sketchType,@QueryParam("osType") String osType); } \ No newline at end of file diff --git a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java index 8ed7de14..3d6d35a3 100644 --- a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java +++ b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/DeviceTypeServiceImpl.java @@ -24,7 +24,7 @@ import org.wso2.connectedlap.api.util.APIUtil; import org.wso2.connectedlap.api.util.ZipUtil; import org.wso2.connectedlap.plugin.constants.DeviceTypeConstants; import org.wso2.connectedlap.api.DeviceTypeService; -import org.wso2.connectedlap.plugin.impl.uti.ConnectedLapResponse; +import org.wso2.connectedlap.plugin.impl.util.ConnectedLapResponse; import org.wso2.connectedlap.plugin.impl.util.ConnectedLapDevice; import org.apache.commons.io.FileUtils; @@ -265,9 +265,9 @@ public class DeviceTypeServiceImpl implements DeviceTypeService { @GET @Produces("application/zip") public Response downloadSketch(@QueryParam("deviceName") String deviceName, - @QueryParam("sketchType") String sketchType) { + @QueryParam("sketchType") String sketchType, @QueryParam("osType") String osType) { try { - ZipArchive zipFile = createDownloadFile(APIUtil.getAuthenticatedUser(), deviceName, sketchType); + ZipArchive zipFile = createDownloadFile(APIUtil.getAuthenticatedUser(), deviceName, sketchType ,osType); Response.ResponseBuilder response = Response.ok(FileUtils.readFileToByteArray(zipFile.getZipFile())); response.status(Response.Status.OK); response.type("application/zip"); @@ -301,7 +301,7 @@ public class DeviceTypeServiceImpl implements DeviceTypeService { return Long.toString(l, Character.MAX_RADIX); } - private ZipArchive createDownloadFile(String owner, String deviceName, String sketchType) + private ZipArchive createDownloadFile(String owner, String deviceName, String sketchType , String osType) throws DeviceManagementException, JWTClientException, APIManagerException, UserStoreException { @@ -329,7 +329,7 @@ public class DeviceTypeServiceImpl implements DeviceTypeService { ZipUtil ziputil = new ZipUtil(); ZipArchive zipFile = ziputil.createZipFile(owner, APIUtil.getTenantDomainOftheUser(), sketchType, - deviceId, deviceName, accessToken, refreshToken); + deviceId, deviceName, accessToken, refreshToken,osType); return zipFile; } diff --git a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/util/ZipUtil.java b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/util/ZipUtil.java index 4a747fa7..c40a9d23 100644 --- a/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/util/ZipUtil.java +++ b/modules/samples/connectedlap/component/api/src/main/java/org.wso2/connectedlap/api/util/ZipUtil.java @@ -44,7 +44,7 @@ public class ZipUtil { public ZipArchive createZipFile(String owner, String tenantDomain, String deviceType, String deviceId, String deviceName, String token, - String refreshToken) throws DeviceManagementException { + String refreshToken,String osType) throws DeviceManagementException { String sketchFolder = "repository" + File.separator + "resources" + File.separator + "sketches"; String archivesPath = CarbonUtils.getCarbonHome() + File.separator + sketchFolder + File.separator + "archives" + @@ -75,6 +75,7 @@ public class ZipUtil { contextParams.put("MQTT_EP", mqttEndpoint); contextParams.put("DEVICE_TOKEN", token); contextParams.put("DEVICE_REFRESH_TOKEN", refreshToken); + contextParams.put("OS_TYPE", osType); ZipArchive zipFile; zipFile = Utils.getSketchArchive(archivesPath, templateSketchPath, contextParams, deviceName); diff --git a/modules/samples/connectedlap/component/plugin/src/main/java/org.wso2/connectedlap/plugin/impl/util/ConnectedLapResponse.java b/modules/samples/connectedlap/component/plugin/src/main/java/org.wso2/connectedlap/plugin/impl/util/ConnectedLapResponse.java index 1a60033d..4694e6ce 100644 --- a/modules/samples/connectedlap/component/plugin/src/main/java/org.wso2/connectedlap/plugin/impl/util/ConnectedLapResponse.java +++ b/modules/samples/connectedlap/component/plugin/src/main/java/org.wso2/connectedlap/plugin/impl/util/ConnectedLapResponse.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.connectedlap.plugin.impl.uti; +package org.wso2.connectedlap.plugin.impl.util; public class ConnectedLapResponse { diff --git a/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.type-view/public/images/deviceview.png b/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.type-view/public/images/deviceview.png new file mode 100644 index 00000000..7554275b Binary files /dev/null and b/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.type-view/public/images/deviceview.png differ diff --git a/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.type-view/type-view.hbs b/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.type-view/type-view.hbs index 31b5d9a6..80ca79b0 100644 --- a/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.type-view/type-view.hbs +++ b/modules/samples/connectedlap/component/ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.CONNECTEDLAP.type-view/type-view.hbs @@ -14,12 +14,25 @@

What it Does


-

Connect a CONNECTEDLAP to WSO2 IoT Server and manage it.

-

Add brief description what this device type does

+

Connect a computer with this application to WSO2 IoT Server and visualize usage data.

+

What You Need

-

Add hardware requirement which will be required to make this device type

-

+

You should have an Android Device to get started.

+
+ + Prepare
    -
  • 01   Add how you are goining to - prepare your device +
  • 01   Download your Connectedlap using [Download Agent] button above. +
  • +
  • 02   Unzip the downloaded Agent. +
  • +
  • 03   Move into the unzipped Agent folder. +
  • +
  • 04   On terminal to run this command: [sudo sh startagent.sh]. +
  • +
  • 05   Give the Super-Admin password.


-

Try Out


  • 01 -    You can view all your connected devices at +    You can view all your connected devices at [Device Management] page. [Device Management] page.
  • 02 -    Select one of connected devices and check for available control - operations and monitor Real-Time data. +    Select one of connected devices and monitor Real-Time data.
  • 03 -    You can also view analytics of the data published to IoT-Server by - navigating to Device Analytics page. +    You can also view analytics of the data published to IoT-Server by navigating to Device Analytics page.

+
+

+
+
+

Click on the image to zoom

+
+ + + +
+
+
{{#zone "topCss"}}