From 5049f17b6dbb18d0739b0dcf839c81852cd5cdae Mon Sep 17 00:00:00 2001 From: Nirothipan Date: Mon, 28 Aug 2017 13:33:10 +0530 Subject: [PATCH] androif file transfer feature --- .../public/js/operation-bar.js | 13 ++++++++++++- .../private/config.json | 3 ++- .../src/main/resources/devicetypes/android.xml | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index 6e59ead6a..877e066fa 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -53,7 +53,7 @@ function submitForm(formId) { } else if (input.data("param-type") == "form") { var prefix = (uriencodedFormStr == "") ? "" : "&"; uriencodedFormStr += prefix + input.attr("id") + "=" + input.val(); - if (input.attr("type") == "text") { + if (input.attr("type") == "text" || input.attr("type") == "password") { payload[input.attr("id")] = input.val(); } else if (input.attr("type") == "checkbox") { payload[input.attr("id")] = input.is(":checked"); @@ -179,6 +179,17 @@ function validatePayload(operationCode, payload) { returnVal = "Message Body Can't be empty !"; } break; + case "FILE_TRANSFER": + if (!payload.ftpServerAddress) { + returnVal = "Please enter FTP server address"; + }else if(!payload.ftpUserName){ + returnVal = "Please enter FTP user name"; + }else if(!payload.ftpPassword){ + returnVal = "Please enter FTP password"; + }else if(!payload.fileName){ + returnVal = "Please enter the name of the file you want to transfer"; + } + break; default: break; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json index 9ea5c964a..cf4370731 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/private/config.json @@ -6,6 +6,7 @@ "analyticsEnabled": "false", "groupingEnabled": "false", "scopes" : [ + "perm:android:file-transfer", "perm:android:enroll", "perm:android:wipe", "perm:android:ring", @@ -136,7 +137,7 @@ "permission": "/device-mgt/devices/owning-device/operations/android/enterprise-wipe" }, "FILE_TRANSFER": { - "icon": "fw-block", + "icon": "fw-save", "formParams": [ { "type": "text", diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml index 00084f14f..a60016378 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml @@ -87,6 +87,12 @@ + + File Transfer + Transfer file to the device + + + Ring Ring the device @@ -380,4 +386,4 @@ 900 600 - \ No newline at end of file +