diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java new file mode 100644 index 000000000..2e8af23a7 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +* +* WSO2 Inc. licenses this file to you under the Apache License, +* Version 2.0 (the "License"); you may not use this file except +* in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +package org.wso2.carbon.mdm.services.android.bean; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.wso2.carbon.mdm.services.android.bean.AndroidOperation; + +import java.io.Serializable; + +/** + * This class represents the information of file transfer operation payload. + */ +@ApiModel(value = "FileTransfer", + description = "This class carries all information related to file transfer operation.") +public class FileTransfer extends AndroidOperation implements Serializable { + + @ApiModelProperty(name = "fileURL", value = "File URL", required = true) + private String fileURL; + + @ApiModelProperty(name = "userName", value = "User Name", required = true) + private String userName; + + @ApiModelProperty(name = "ftpPassword", value = "FTP password", required = true) + private String ftpPassword; + + @ApiModelProperty(name = "fileLocation", value = "fileLocation", required = true) + private String fileLocation; + + public String getFileURL() { + return fileURL; + } + + public void setFileURL(String fileURL) { + this.fileURL = fileURL; + } + + public String getFtpPassword() { + return ftpPassword; + } + + public void setFtpPassword(String ftpPassword) { + this.ftpPassword = ftpPassword; + } + + public String getFileLocation() { + return fileLocation; + } + + public void setFileLocation(String fileLocation) { + this.fileLocation = fileLocation; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java new file mode 100644 index 000000000..d34b00e66 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +* +* WSO2 Inc. licenses this file to you under the Apache License, +* Version 2.0 (the "License"); you may not use this file except +* in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ +package org.wso2.carbon.mdm.services.android.bean.wrapper; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.wso2.carbon.mdm.services.android.bean.FileTransfer; + +import java.util.List; + +/** + * This class is used to wrap the File Transfer bean with devices. + */ +@ApiModel(value = "FileTransferBeanWrapper", + description = "FileTransfer related Information.") +public class FileTransferBeanWrapper { + + @ApiModelProperty(name = "deviceIDs", value = "Device id list of the operation to be executed.", required = true) + private List deviceIDs; + + @ApiModelProperty(name = "upload", value = "Upload / Download w.r.t device.", + notes = "upload = true , If file is to be uploaded to the device.", required = true) + private boolean upload; + + @ApiModelProperty(name = "operation", value = "Information of the File Transfer Operation.", required = true) + private FileTransfer operation; + + public List getDeviceIDs() { + return deviceIDs; + } + + public void setDeviceIDs(List deviceIDs) { + this.deviceIDs = deviceIDs; + } + + public FileTransfer getOperation() { + return operation; + } + + public void setOperation(FileTransfer operation) { + this.operation = operation; + } + + public boolean isUpload() { + return upload; + } + + public void setUpload(boolean upload) { + this.upload = upload; + } +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java index f3c3c72b1..c8bd68d9c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java @@ -216,11 +216,78 @@ import java.util.List; description = "Setting a Web Clip on Android Devices", key = "perm:android:set-webclip", permissions = {"/device-mgt/devices/owning-device/operations/android/webclip"} + ), + @Scope( + name = "File Transfer", + description = "Transferring a file to android devices", + key = "perm:android:file-transfer", + permissions = {"/device-mgt/devices/owning-device/operations/android/file-transfer"} ) } ) public interface DeviceManagementAdminService { + @POST + @Path("/file-transfer") + @ApiOperation( + consumes = MediaType.APPLICATION_JSON, + httpMethod = "POST", + value = "Transferring file to the device.", + notes = "Using this API you have the option to transfer a file from SFTP/FTP server or using an " + + "HTTP link to the device or retrieve file from the device to FTP/SFTP server .", + response = Activity.class, + tags = "Android Device Management Administrative Service", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = AndroidConstants.SCOPE, value = "perm:android:file-transfer") + }) + } + ) + @ApiResponses(value = { + @ApiResponse( + code = 201, + message = "File transferred.", + response = Activity.class, + responseHeaders = { + @ResponseHeader( + name = "Content-Location", + description = "URL of the activity instance that refers to the scheduled operation."), + @ResponseHeader( + name = "Content-Type", + description = "Content type of the body"), + @ResponseHeader( + name = "ETag", + description = "Entity Tag of the response resource.\n" + + "Used by caches, or in conditional requests."), + @ResponseHeader( + name = "Last-Modified", + description = "Date and time the resource was last modified. \n" + + "Used by caches, or in conditional requests.")}), + @ApiResponse( + code = 303, + message = "See Other. \n The source can be retrieved from the URL specified in the location header.", + responseHeaders = { + @ResponseHeader( + name = "Content-Location", + description = "The Source URL of the document.")}), + @ApiResponse( + code = 400, + message = "Bad Request. \n Invalid request or validation error."), + @ApiResponse( + code = 415, + message = "Unsupported media type. \n The format of the requested entity was not supported.\n"), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n " + + "Server error occurred while file transfer operation.") + }) + Response fileTransfer( + @ApiParam( + name = "fileTransfer", + value = "Provide the ID of the Android device. Multiple device IDs can be added by using " + + "comma separated values.", + required = true) FileTransferBeanWrapper fileTransferBeanWrapper); + @POST @Path("/lock-devices") @ApiOperation( @@ -343,7 +410,7 @@ public interface DeviceManagementAdminService { name = "deviceIDs", value = "Provide the ID of the Android device. Multiple device IDs can be added by using comma separated values. ", required = true) - List deviceIDs); + List deviceIDs); @POST @@ -405,7 +472,7 @@ public interface DeviceManagementAdminService { name = "deviceIDs", value = "Provide the ID of the Android device. Multiple device IDs can be added by using comma separated values. ", required = true) - List deviceIDs); + List deviceIDs); @POST @Path("/clear-password") @@ -463,7 +530,7 @@ public interface DeviceManagementAdminService { Response removePassword( @ApiParam(name = "deviceIDs", value = "Provide the ID of the Android device. Multiple device IDs can be added by using comma separated values. ", - required = true) List deviceIDs); + required = true) List deviceIDs); @POST @Path("/control-camera") @@ -478,7 +545,7 @@ public interface DeviceManagementAdminService { @Extension(properties = { @ExtensionProperty(name = AndroidConstants.SCOPE, value = "perm:android:control-camera") }) - } ) + }) @ApiResponses(value = { @ApiResponse( code = 201, @@ -525,7 +592,7 @@ public interface DeviceManagementAdminService { "camera on the device to function by defining false as the value and the ID of the Android device. " + "Multiple device IDs can be added by using comma separated values. ", required = true) - CameraBeanWrapper cameraBeanWrapper); + CameraBeanWrapper cameraBeanWrapper); @POST @Path("/info") @@ -588,7 +655,7 @@ public interface DeviceManagementAdminService { name = "deviceIds", value = "Provide the device ID of the Android device. Multiple device IDs can be added by using comma separated values.", required = true) - List deviceIDs); + List deviceIDs); @POST @Path("/logcat") @@ -623,11 +690,11 @@ public interface DeviceManagementAdminService { @ResponseHeader( name = "ETag", description = "Entity Tag of the response resource.\n" + - "Used by caches, or in conditional requests."), + "Used by caches, or in conditional requests."), @ResponseHeader( name = "Last-Modified", description = "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests.")}), + "Used by caches, or in conditional requests.")}), @ApiResponse( code = 303, message = "See Other. \n The source can be retrieved from the URL specified in the location header.", @@ -644,7 +711,7 @@ public interface DeviceManagementAdminService { @ApiResponse( code = 500, message = "Internal Server Error. \n " + - "Server error occurred while adding a new device logcat operation.") + "Server error occurred while adding a new device logcat operation.") }) Response getDeviceLogcat( @ApiParam( @@ -712,7 +779,7 @@ public interface DeviceManagementAdminService { name = "deviceIDs", value = "Provide the ID of the Android device. Multiple device IDs can be added by using comma separated values. ", required = true) - List deviceIDs); + List deviceIDs); @POST @Path("/wipe") @@ -773,7 +840,7 @@ public interface DeviceManagementAdminService { value = "Provide the the passcode, which is the passcode that the Android agent prompts the device owner to set at the time of device enrollment, " + "to enable the factory reset operation, and the ID of the Android device. Multiple device IDs can be added by using comma separated values. ", required = true) - WipeDataBeanWrapper wipeDataBeanWrapper); + WipeDataBeanWrapper wipeDataBeanWrapper); @POST @Path("/applications") @@ -835,9 +902,9 @@ public interface DeviceManagementAdminService { Response getApplications( @ApiParam( name = "deviceIDs", - value = "Provide the ID of the Android device. Multiple device IDs can be added using comma separated values." , + value = "Provide the ID of the Android device. Multiple device IDs can be added using comma separated values.", required = true) - List deviceIDs); + List deviceIDs); @POST @Path("/ring") @@ -897,7 +964,7 @@ public interface DeviceManagementAdminService { name = "deviceIDs", value = "Provide the ID of the Android device. Multiple device IDs can be added using comma separated values.", required = true) - List deviceIDs); + List deviceIDs); @POST @Path("/reboot") @@ -957,7 +1024,7 @@ public interface DeviceManagementAdminService { name = "deviceIDs", value = "Provide the ID of the Android device. Multiple device IDs can be added using comma separated values. ", required = true) - List deviceIDs); + List deviceIDs); @POST @Path("/mute") @@ -1017,7 +1084,7 @@ public interface DeviceManagementAdminService { name = "deviceIDs", value = "Provide the ID of the Android device. Multiple device IDs can be added using comma separated values. ", required = true) - List deviceIDs); + List deviceIDs); @POST @Path("/install-application") @@ -1081,7 +1148,7 @@ public interface DeviceManagementAdminService { " URL and name of the application, the date and time for the scheduled installation, and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", required = true) - ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); + ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); @POST @Path("/update-application") @@ -1146,7 +1213,7 @@ public interface DeviceManagementAdminService { "URL and name of the application, the date and time for the scheduled installation, and the ID of the" + "Android device. Multiple device IDs can be added by using comma separated values.", required = true) - ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); + ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); @POST @Path("/uninstall-application") @@ -1208,7 +1275,7 @@ public interface DeviceManagementAdminService { "URL and name of the application, the date and time for the scheduled installation, and the ID of the" + "Android device. Multiple device IDs can be added by using comma separated values.", required = true) - ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper); + ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper); @POST @Path("/blacklist-applications") @@ -1337,7 +1404,7 @@ public interface DeviceManagementAdminService { "(example: http//abc.com, http://abc.com/ota), " + "and the ID of the Android device. Multiple device IDs can be added by using comma separated values.", required = true) - UpgradeFirmwareBeanWrapper upgradeFirmwareBeanWrapper); + UpgradeFirmwareBeanWrapper upgradeFirmwareBeanWrapper); @POST @Path("/configure-vpn") @@ -1398,7 +1465,7 @@ public interface DeviceManagementAdminService { name = "vpnBean", value = "VPN configuration and DeviceIds", required = true) - VpnBeanWrapper vpnBeanWrapper); + VpnBeanWrapper vpnBeanWrapper); @POST @Path("/send-notification") @@ -1459,7 +1526,7 @@ public interface DeviceManagementAdminService { value = "The properties required to send a notification. Provide the message you wish to send and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", required = true) - NotificationBeanWrapper notificationBeanWrapper); + NotificationBeanWrapper notificationBeanWrapper); @POST @Path("/configure-wifi") @@ -1521,7 +1588,7 @@ public interface DeviceManagementAdminService { "the ssid or the name of the Wi-Fi network that you wish to configure and the ID of the Android device." + " Multiple device IDs can be added by using comma separated values.", required = true) - WifiBeanWrapper wifiBeanWrapper); + WifiBeanWrapper wifiBeanWrapper); @POST @Path("/encrypt-storage") @@ -1583,7 +1650,7 @@ public interface DeviceManagementAdminService { "true as the value or do not encrypt the storage on the device by assigning false as the value and " + "provide the ID of the Android device. Multiple device IDs can be added by using comma separated values.", required = true) - EncryptionBeanWrapper encryptionBeanWrapper); + EncryptionBeanWrapper encryptionBeanWrapper); @POST @Path("/change-lock-code") @@ -1645,7 +1712,7 @@ public interface DeviceManagementAdminService { "the ID of the Android device. Multiple device IDs can be added by using comma separated values. " + "If a passcode policy has been set in EMM, the lock code should comply to the passcode policy.\t", required = true) - LockCodeBeanWrapper lockCodeBeanWrapper); + LockCodeBeanWrapper lockCodeBeanWrapper); @POST @Path("/set-password-policy") @@ -1705,7 +1772,7 @@ public interface DeviceManagementAdminService { name = "passwordPolicy", value = "The properties required to set a password policy.", required = true) - PasswordPolicyBeanWrapper passwordPolicyBeanWrapper); + PasswordPolicyBeanWrapper passwordPolicyBeanWrapper); @POST @Path("/set-webclip") @@ -1765,7 +1832,7 @@ public interface DeviceManagementAdminService { name = "webClip", value = "The properties to set the web clip.", required = true) - WebClipBeanWrapper webClipBeanWrapper); + WebClipBeanWrapper webClipBeanWrapper); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java index f3beca09d..b50e4b4ad 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java @@ -36,6 +36,7 @@ import org.wso2.carbon.mdm.services.android.bean.Camera; import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; import org.wso2.carbon.mdm.services.android.bean.DeviceLock; import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; +import org.wso2.carbon.mdm.services.android.bean.FileTransfer; import org.wso2.carbon.mdm.services.android.bean.LockCode; import org.wso2.carbon.mdm.services.android.bean.Notification; import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; @@ -51,6 +52,7 @@ import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBe import org.wso2.carbon.mdm.services.android.bean.wrapper.CameraBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.DeviceLockBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.mdm.services.android.bean.wrapper.FileTransferBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.LockCodeBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.NotificationBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.PasswordPolicyBeanWrapper; @@ -89,6 +91,46 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe private static final Log log = LogFactory.getLog(DeviceManagementAdminServiceImpl.class); private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ"; + @POST + @Path("/file-transfer") + @Override + public Response fileTransfer(FileTransferBeanWrapper fileTransferBeanWrapper) { + try { + if (fileTransferBeanWrapper == null || fileTransferBeanWrapper.getOperation() == null + || fileTransferBeanWrapper.getDeviceIDs() == null) { + String errorMessage = "The payload of the file transfer operation is incorrect."; + log.error(errorMessage); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + if (log.isDebugEnabled()) { + log.debug("Invoking Android file transfer operation for " + fileTransferBeanWrapper.getDeviceIDs()); + } + FileTransfer file = fileTransferBeanWrapper.getOperation(); + ProfileOperation operation = new ProfileOperation(); + if (fileTransferBeanWrapper.isUpload()) { + operation.setCode(AndroidConstants.OperationCodes.FILE_DOWNLOAD); + } else { + operation.setCode(AndroidConstants.OperationCodes.FILE_UPLOAD); + } + operation.setType(Operation.Type.PROFILE); + operation.setEnabled(true); + operation.setPayLoad(file.toJSON()); + Activity activity = AndroidDeviceUtils.getOperationResponse(fileTransferBeanWrapper.getDeviceIDs(), operation); + return Response.status(Response.Status.CREATED).entity(activity).build(); + } catch (InvalidDeviceException e) { + String errorMessage = "Invalid Device Identifiers ( " + fileTransferBeanWrapper.getDeviceIDs() + " ) found."; + log.error(errorMessage, e); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } catch (OperationManagementException e) { + String errorMessage = "Issue in retrieving operation management service instance for file transfer operation"; + log.error(errorMessage, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(errorMessage).build()); + } + } + @POST @Path("/lock-devices") @Override @@ -113,10 +155,10 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe Activity activity = AndroidDeviceUtils.getOperationResponse(deviceLockBeanWrapper.getDeviceIDs(), operation); return Response.status(Response.Status.CREATED).entity(activity).build(); } catch (InvalidDeviceException e) { - String errorMessage = "Invalid Device Identifiers found."; - log.error(errorMessage, e); - throw new BadRequestException( - new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + String errorMessage = "Invalid Device Identifiers found."; + log.error(errorMessage, e); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } catch (OperationManagementException e) { String errorMessage = "Issue in retrieving operation management service instance"; log.error(errorMessage, e); @@ -475,7 +517,7 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe try { if (applicationInstallationBeanWrapper == null || applicationInstallationBeanWrapper.getOperation() == - null) { + null) { String errorMessage = "The payload of the application installing operation is incorrect"; log.error(errorMessage); throw new BadRequestException( @@ -920,7 +962,7 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe try { URL url = new URL(apkUrl); URLConnection conn = url.openConnection(); - if(((HttpURLConnection) conn).getResponseCode() != HttpURLConnection.HTTP_OK) { + if (((HttpURLConnection) conn).getResponseCode() != HttpURLConnection.HTTP_OK) { String errorMessage = "URL is not pointed to a downloadable file."; log.error(errorMessage); throw new BadRequestException( @@ -942,8 +984,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe private static void validateApplicationType(String type) { if (type != null) { if (!"enterprise".equalsIgnoreCase(type) - && !"public".equalsIgnoreCase(type) - && !"webapp".equalsIgnoreCase(type)) { + && !"public".equalsIgnoreCase(type) + && !"webapp".equalsIgnoreCase(type)) { String errorMessage = "Invalid application type."; log.error(errorMessage); throw new BadRequestException( @@ -957,7 +999,7 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe } } - private static void validateScheduleDate(String dateString){ + private static void validateScheduleDate(String dateString) { try { if (dateString != null && !dateString.isEmpty()) { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java index c1e09b4c0..3a93305bd 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java @@ -74,6 +74,8 @@ public final class AndroidConstants { } public static final String DEVICE_LOCK = "DEVICE_LOCK"; + public static final String FILE_DOWNLOAD = "FILE_UPLOAD_TO_THE_DEVICE"; + public static final String FILE_UPLOAD = "FILE_DOWNLOAD_FROM_THE_DEVICE"; public static final String DEVICE_UNLOCK = "DEVICE_UNLOCK"; public static final String DEVICE_LOCATION = "DEVICE_LOCATION"; public static final String WIFI = "WIFI"; 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/operation-bar.hbs 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/operation-bar.hbs index 2581776dd..d61c6331e 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/operation-bar.hbs +++ 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/operation-bar.hbs @@ -71,6 +71,10 @@ + +
{{/each}} {{#each uiParams}} + {{#equal this.type "select"}} +
+ +
+ {{/equal}} + {{#equal this.type "radio"}} + + {{this.value}} + {{/equal}} {{#equal this.type "checkbox"}} {{/equal}} + {{#equal this.type "password"}} + +
+ {{/equal}} {{#equal this.type "text"}}
{{/equal}} + {{#equal this.type "info"}} +
+ + + {{this.value}} + +
+ {{/equal}} {{/each}}