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> </context-param>
<!-- Below configuration is used to redirect http requests to https --> <!-- Below configuration is used to redirect http requests to https -->
<security-constraint> <!-- Below configuration is commented because artifact download API is accessed from the device -->
<web-resource-collection> <!-- <security-constraint>-->
<web-resource-name>ApplicationMgt-Admin</web-resource-name> <!-- <web-resource-collection>-->
<url-pattern>/*</url-pattern> <!-- <web-resource-name>ApplicationMgt-Admin</web-resource-name>-->
</web-resource-collection> <!-- <url-pattern>/*</url-pattern>-->
<user-data-constraint> <!-- </web-resource-collection>-->
<transport-guarantee>CONFIDENTIAL</transport-guarantee> <!-- <user-data-constraint>-->
</user-data-constraint> <!-- <transport-guarantee>CONFIDENTIAL</transport-guarantee>-->
</security-constraint> <!-- </user-data-constraint>-->
<!-- </security-constraint>-->
<!--publish to apim--> <!--publish to apim-->
<context-param> <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.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; 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.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.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.exceptions.UnknownApplicationTypeException; 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 //todo rethink and modify the {@link MobileApp} usage
MobileApp mobileApp = new MobileApp(); MobileApp mobileApp = new MobileApp();
MobileAppTypes mobileAppType = MobileAppTypes.valueOf(application.getType());
if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) { if (DeviceTypes.ANDROID.toString().equalsIgnoreCase(deviceType)) {
if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) { if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) {
mobileApp.setType(mobileAppType);
mobileApp.setLocation(application.getApplicationReleases().get(0).getInstallerPath());
return MDMAndroidOperationUtil.createInstallAppOperation(mobileApp); return MDMAndroidOperationUtil.createInstallAppOperation(mobileApp);
} else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) { } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) {
return MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp); return MDMAndroidOperationUtil.createAppUninstallOperation(mobileApp);

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

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

Loading…
Cancel
Save