From b9e1c6496a07ca468fa7dc632d61e7b030c42c84 Mon Sep 17 00:00:00 2001 From: Dakshika Jayathilaka Date: Mon, 21 Dec 2015 17:41:00 +0530 Subject: [PATCH 1/3] remove unused handlebar template files --- .../public/templates/listing.hbs | 19 ------------------- .../public/templates/listing.hbs | 19 ------------------- 2 files changed, 38 deletions(-) delete mode 100644 features/device-mgt-mdm-android-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/templates/listing.hbs delete mode 100644 features/device-mgt-mdm-windows-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/templates/listing.hbs diff --git a/features/device-mgt-mdm-android-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/templates/listing.hbs b/features/device-mgt-mdm-android-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/templates/listing.hbs deleted file mode 100644 index 2563f03ced..0000000000 --- a/features/device-mgt-mdm-android-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/templates/listing.hbs +++ /dev/null @@ -1,19 +0,0 @@ - - -
- -
- - {{deviceTypeLabel}} - - - - - - - Select - - - \ No newline at end of file diff --git a/features/device-mgt-mdm-windows-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/templates/listing.hbs b/features/device-mgt-mdm-windows-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/templates/listing.hbs deleted file mode 100644 index c50b827052..0000000000 --- a/features/device-mgt-mdm-windows-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view/public/templates/listing.hbs +++ /dev/null @@ -1,19 +0,0 @@ - - -
- -
- - {{deviceTypeLabel}} - - - - - - - Select - - - \ No newline at end of file From e2b43822ced66b2ad3fb5f41ca324de79109acf8 Mon Sep 17 00:00:00 2001 From: Ace Date: Mon, 21 Dec 2015 17:55:25 +0530 Subject: [PATCH 2/3] Automating key generation capability for virtual_firealarm --- .../pom.xml | 5 +++++ .../virtualfirealarm/service/VirtualFireAlarmService.java | 3 +++ pom.xml | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml index 5ef39018fd..89ab6e7024 100644 --- a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml +++ b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml @@ -231,6 +231,11 @@ smackx provided + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.webapp.publisher + provided + diff --git a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java index 82ffcd49ee..8762c1cbaa 100644 --- a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java +++ b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java @@ -24,6 +24,7 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.device.DeviceType; import org.wso2.carbon.apimgt.annotations.device.feature.Feature; +import org.wso2.carbon.apimgt.webapp.publisher.KeyGenerationUtil; import org.wso2.carbon.certificate.mgt.core.dto.SCEPResponse; import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException; import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService; @@ -456,6 +457,8 @@ public class VirtualFireAlarmService { //create new device id String deviceId = shortUUID(); + KeyGenerationUtil.createApplicationKeys("virtual_firealarm"); + TokenClient accessTokenClient = new TokenClient(VirtualFireAlarmConstants.DEVICE_TYPE); AccessTokenInfo accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId); diff --git a/pom.xml b/pom.xml index 83918ea7c2..cf5971b704 100644 --- a/pom.xml +++ b/pom.xml @@ -687,6 +687,11 @@ + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.webapp.publisher + ${carbon.device.mgt.version} + org.wso2.carbon.apimgt org.wso2.carbon.apimgt.impl From b27bb1da71e8bcd8d923ec826714ea4d287933fd Mon Sep 17 00:00:00 2001 From: Ace Date: Mon, 21 Dec 2015 20:03:14 +0530 Subject: [PATCH 3/3] Adding key generation capability when agent download is triggered --- .../pom.xml | 5 +++++ .../device/mgt/iot/arduino/service/ArduinoService.java | 3 +++ .../pom.xml | 6 ++++++ .../device/mgt/iot/droneanalyzer/service/DroneService.java | 4 ++++ .../pom.xml | 6 ++++++ .../mgt/iot/raspberrypi/service/RaspberryPiService.java | 3 +++ 6 files changed, 27 insertions(+) diff --git a/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/pom.xml b/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/pom.xml index 245066e88c..bc5ca940d3 100644 --- a/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/pom.xml +++ b/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/pom.xml @@ -141,6 +141,11 @@ org.wso2.carbon.apimgt.annotations provided + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.webapp.publisher + provided + diff --git a/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/ArduinoService.java b/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/ArduinoService.java index 903fc8af49..dbf5a1904c 100644 --- a/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/ArduinoService.java +++ b/components/device-mgt-iot-arduino/org.wso2.carbon.device.mgt.iot.arduino.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/ArduinoService.java @@ -24,6 +24,7 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.device.DeviceType; import org.wso2.carbon.apimgt.annotations.device.feature.Feature; +import org.wso2.carbon.apimgt.webapp.publisher.KeyGenerationUtil; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; @@ -399,6 +400,8 @@ public class ArduinoService { //create new device id String deviceId = shortUUID(); + KeyGenerationUtil.createApplicationKeys("arduino"); + TokenClient accessTokenClient = new TokenClient(ArduinoConstants.DEVICE_TYPE); AccessTokenInfo accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId); diff --git a/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/pom.xml b/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/pom.xml index 7cf239bf48..980599638a 100644 --- a/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/pom.xml +++ b/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/pom.xml @@ -194,6 +194,12 @@ + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.webapp.publisher + provided + + commons-codec commons-codec diff --git a/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/src/main/java/org/wso2/carbon/device/mgt/iot/droneanalyzer/service/DroneService.java b/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/src/main/java/org/wso2/carbon/device/mgt/iot/droneanalyzer/service/DroneService.java index 55218fe0a8..1d2330a76c 100644 --- a/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/src/main/java/org/wso2/carbon/device/mgt/iot/droneanalyzer/service/DroneService.java +++ b/components/device-mgt-iot-droneanalyzer/org.wso2.carbon.device.mgt.iot.droneanalyzer.api/src/main/java/org/wso2/carbon/device/mgt/iot/droneanalyzer/service/DroneService.java @@ -21,6 +21,7 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.device.DeviceType; import org.wso2.carbon.apimgt.annotations.device.feature.Feature; +import org.wso2.carbon.apimgt.webapp.publisher.KeyGenerationUtil; import org.wso2.carbon.certificate.mgt.core.dto.SCEPResponse; import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException; import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService; @@ -299,6 +300,9 @@ public class DroneService { if (owner == null) { throw new IllegalArgumentException("Error on createDownloadFile() Owner is null!"); } + + KeyGenerationUtil.createApplicationKeys("drone"); + //create new device id String deviceId = shortUUID(); TokenClient accessTokenClient = new TokenClient(DroneConstants.DEVICE_TYPE); diff --git a/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/pom.xml b/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/pom.xml index 40115bc360..8034dfefb4 100644 --- a/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/pom.xml +++ b/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/pom.xml @@ -128,6 +128,12 @@ provided + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.webapp.publisher + provided + + diff --git a/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/RaspberryPiService.java b/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/RaspberryPiService.java index 8ae704a984..c9643e851a 100644 --- a/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/RaspberryPiService.java +++ b/components/device-mgt-iot-raspberrypi/org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/RaspberryPiService.java @@ -23,6 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.device.DeviceType; +import org.wso2.carbon.apimgt.webapp.publisher.KeyGenerationUtil; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementException; @@ -336,6 +337,8 @@ public class RaspberryPiService { //create new device id String deviceId = shortUUID(); + KeyGenerationUtil.createApplicationKeys("raspberry"); + TokenClient accessTokenClient = new TokenClient(RaspberrypiConstants.DEVICE_TYPE); AccessTokenInfo accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId);