Merge branch 'application-mgt-new' into 'application-mgt-new'

Create android enterprise app

See merge request entgra/carbon-device-mgt!120
feature/appm-store/pbac
Dharmakeerthi Lasantha 6 years ago
commit efc660adeb

@ -47,15 +47,16 @@
</context-param>
<!-- Below configuration is used to redirect http requests to https -->
<security-constraint>
<web-resource-collection>
<web-resource-name>ApplicationMgt-Admin</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<!-- Below configuration is commented because artifact download API is accessed from the device -->
<!-- <security-constraint>-->
<!-- <web-resource-collection>-->
<!-- <web-resource-name>ApplicationMgt-Admin</web-resource-name>-->
<!-- <url-pattern>/*</url-pattern>-->
<!-- </web-resource-collection>-->
<!-- <user-data-constraint>-->
<!-- <transport-guarantee>CONFIDENTIAL</transport-guarantee>-->
<!-- </user-data-constraint>-->
<!-- </security-constraint>-->
<!--publish to apim-->
<context-param>

@ -50,6 +50,7 @@ import org.wso2.carbon.device.application.mgt.core.util.HelperUtil;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.app.mgt.MobileApp;
import org.wso2.carbon.device.mgt.common.app.mgt.MobileAppTypes;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.exceptions.UnknownApplicationTypeException;
@ -458,8 +459,11 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
//todo rethink and modify the {@link MobileApp} usage
MobileApp mobileApp = new MobileApp();
MobileAppTypes mobileAppType = MobileAppTypes.valueOf(application.getType());
if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) {
if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
mobileApp.setType(mobileAppType);
mobileApp.setLocation(application.getApplicationReleases().get(0).getInstallerPath());
return MDMAndroidOperationUtil.createInstallAppOperation(mobileApp);
} else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
return MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp);

@ -51,7 +51,8 @@
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
com.fasterxml.jackson.annotation;version="${jackson-annotations.version}",
org.wso2.carbon.analytics.datasource.commons;version="${carbon.analytics.version.range}",
io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional
io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional,
com.google.gson
</Import-Package>
</instructions>
</configuration>
@ -103,6 +104,10 @@
<groupId>org.wso2.carbon.analytics</groupId>
<artifactId>org.wso2.carbon.analytics.datasource.commons</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
</project>

@ -48,8 +48,7 @@ public class MDMAndroidOperationUtil {
switch (application.getType()) {
case ENTERPRISE:
EnterpriseApplication enterpriseApplication =
new EnterpriseApplication();
EnterpriseApplication enterpriseApplication = new EnterpriseApplication();
enterpriseApplication.setType(application.getType().toString());
enterpriseApplication.setUrl(application.getLocation());
operation.setPayLoad(enterpriseApplication.toJSON());

Loading…
Cancel
Save