diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/MDMConfig.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/MDMConfig.java new file mode 100644 index 0000000000..1f478f8481 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/MDMConfig.java @@ -0,0 +1,40 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. 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.device.application.mgt.common.config; + +import javax.xml.bind.annotation.XmlElement; + +public class MDMConfig { + + private String artifactDownloadProtocol; + private String artifactDownloadEndpoint; + + @XmlElement(name = "ArtifactDownloadProtocol", required=true) + public String getArtifactDownloadProtocol() { return artifactDownloadProtocol; } + + public void setArtifactDownloadProtocol(String artifactDownloadProtocol) { + this.artifactDownloadProtocol = artifactDownloadProtocol; + } + + @XmlElement(name = "ArtifactDownloadEndpoint", required=true) + public String getArtifactDownloadEndpoint() { return artifactDownloadEndpoint; } + + public void setArtifactDownloadEndpoint(String artifactDownloadEndpoint) { + this.artifactDownloadEndpoint = artifactDownloadEndpoint; + } +} diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/app/Test Android App b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/app/Test Android App new file mode 100644 index 0000000000..10dfe26209 Binary files /dev/null and b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/app/Test Android App differ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/banner/My First Banner b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/banner/My First Banner new file mode 100644 index 0000000000..e8c57421c2 Binary files /dev/null and b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/banner/My First Banner differ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/icon/My First Icon b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/icon/My First Icon new file mode 100644 index 0000000000..df25ec4e45 Binary files /dev/null and b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/icon/My First Icon differ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot1/shot1 b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot1/shot1 new file mode 100644 index 0000000000..df25ec4e45 Binary files /dev/null and b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot1/shot1 differ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot2/shot3 b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot2/shot3 new file mode 100644 index 0000000000..df25ec4e45 Binary files /dev/null and b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot2/shot3 differ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot3/shot2 b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot3/shot2 new file mode 100644 index 0000000000..df25ec4e45 Binary files /dev/null and b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/repository/resources/apps/d46b34e7ba08f0d45056e77b9c70f528/screenshot3/shot2 differ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Configuration.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Configuration.java index bc4b706fed..9b395b1a8c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Configuration.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Configuration.java @@ -18,6 +18,7 @@ */ package org.wso2.carbon.device.application.mgt.core.config; +import org.wso2.carbon.device.application.mgt.common.config.MDMConfig; import org.wso2.carbon.device.application.mgt.common.config.RatingConfiguration; import org.wso2.carbon.device.application.mgt.common.config.UIConfiguration; import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; @@ -37,20 +38,16 @@ public class Configuration { private List extensions; - private Artifacts artifacts; - - private PaginationConfiguration paginationConfiguration; - private List lifecycleStates; private UIConfiguration uiConfiguration; private List appCategories; - private String artifactDownloadEndpoint; - private RatingConfiguration ratingConfiguration; + private MDMConfig mdmConfig; + @XmlElement(name = "DatasourceName", required = true) public String getDatasourceName() { return datasourceName; @@ -70,11 +67,6 @@ public class Configuration { this.extensions = extensions; } - @XmlElement(name = "PaginationConfiguration", required = true) - public PaginationConfiguration getPaginationConfiguration() { - return paginationConfiguration; - } - @XmlElementWrapper(name = "LifecycleStates") @XmlElement(name = "LifecycleState") public List getLifecycleStates() { @@ -100,15 +92,6 @@ public class Configuration { public void setRatingConfiguration( RatingConfiguration ratingConfiguration) { this.ratingConfiguration = ratingConfiguration; } - @XmlElement(name = "ArtifactDownloadEndpoint", required = true) - public String getArtifactDownloadEndpoint() { - return artifactDownloadEndpoint; - } - - public void setArtifactDownloadEndpoint(String artifactDownloadEndpoint) { - this.artifactDownloadEndpoint = artifactDownloadEndpoint; - } - @XmlElementWrapper(name = "AppCategories") @XmlElement(name = "Category") public List getAppCategories() { @@ -118,5 +101,12 @@ public class Configuration { public void setAppCategories(List appCategories) { this.appCategories = appCategories; } + + @XmlElement(name = "MDMConfig", required = true) + public MDMConfig getMdmConfig() { return mdmConfig; } + + public void setMdmConfig(MDMConfig mdmConfig) { + this.mdmConfig = mdmConfig; + } } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index 6ea15fcf97..783438564c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -32,6 +32,7 @@ import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller; import org.wso2.carbon.device.application.mgt.common.DeviceTypes; import org.wso2.carbon.device.application.mgt.common.LifecycleChanger; import org.wso2.carbon.device.application.mgt.common.Pagination; +import org.wso2.carbon.device.application.mgt.common.config.MDMConfig; import org.wso2.carbon.device.application.mgt.common.config.RatingConfiguration; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.ApplicationList; @@ -2868,14 +2869,8 @@ public class ApplicationManagerImpl implements ApplicationManager { throw new NotFoundException(msg); } ApplicationReleaseDTO applicationReleaseDTO = applicationDTO.getApplicationReleaseDTOs().get(0); - String host = System.getProperty(Constants.IOT_HOST_PROPERTY); - String port = System.getProperty(Constants.IOT_PORT_PROPERTY); - String artifactDownloadEndpoint = ConfigurationManager.getInstance().getConfiguration() - .getArtifactDownloadEndpoint(); - String artifactDownloadURL = - Constants.ARTIFACT_DOWNLOAD_PROTOCOL + "://" + host + ":" + port + artifactDownloadEndpoint - + Constants.FORWARD_SLASH + applicationReleaseDTO.getUuid() + Constants.FORWARD_SLASH - + applicationReleaseDTO.getInstallerName(); + String artifactDownloadURL = APIUtil.getArtifactDownloadBaseURL() + applicationReleaseDTO.getUuid() + + Constants.FORWARD_SLASH + applicationReleaseDTO.getInstallerName(); String plistContent = "<!DOCTYPE plist PUBLIC "-//Apple//DTDPLIST1.0//EN" "" + "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="" + "1.0"><dict><key>items</key><array><dict><" + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java index c49167f90b..141fd576e2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -27,6 +27,7 @@ import org.wso2.carbon.device.application.mgt.common.DeviceTypes; import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubsciptionType; import org.wso2.carbon.device.application.mgt.common.SubscribingDeviceIdHolder; +import org.wso2.carbon.device.application.mgt.common.config.MDMConfig; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; @@ -480,14 +481,9 @@ public class SubscriptionManagerImpl implements SubscriptionManager { } } else if (DeviceTypes.IOS.toString().equalsIgnoreCase(deviceType)) { if (SubAction.INSTALL.toString().equalsIgnoreCase(action)) { - String host = System.getProperty(Constants.IOT_HOST_PROPERTY); - String port = System.getProperty(Constants.IOT_PORT_PROPERTY); - String artifactDownloadEndpoint = ConfigurationManager.getInstance().getConfiguration() - .getArtifactDownloadEndpoint(); - String plistDownloadEndpoint = - Constants.ARTIFACT_DOWNLOAD_PROTOCOL + "://" + host + ":" + port + artifactDownloadEndpoint - + Constants.FORWARD_SLASH + MDMAppConstants.IOSConstants.PLIST - + Constants.FORWARD_SLASH + application.getApplicationReleases().get(0).getUuid(); + String plistDownloadEndpoint = APIUtil.getArtifactDownloadBaseURL() + + MDMAppConstants.IOSConstants.PLIST + Constants.FORWARD_SLASH + + application.getApplicationReleases().get(0).getUuid(); mobileApp.setType(mobileAppType); mobileApp.setLocation(plistDownloadEndpoint); Properties properties = new Properties(); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java index cac7a34013..ff74bda97a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java @@ -24,8 +24,10 @@ import org.apache.commons.logging.LogFactory; import org.apache.commons.validator.routines.UrlValidator; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.ApplicationType; +import org.wso2.carbon.device.application.mgt.common.config.MDMConfig; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; +import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.response.Application; import org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease; import org.wso2.carbon.device.application.mgt.common.services.*; @@ -306,8 +308,7 @@ public class APIUtil { return applicationReleaseDTO; } - public static Application appDtoToAppResponse(ApplicationDTO applicationDTO) - throws BadRequestException, UnexpectedServerErrorException { + public static Application appDtoToAppResponse(ApplicationDTO applicationDTO) throws ApplicationManagementException { Application application = new Application(); if (!ApplicationType.WEB_CLIP.toString().equals(applicationDTO.getType())) { @@ -326,19 +327,19 @@ public class APIUtil { application.setTags(applicationDTO.getTags()); application.setUnrestrictedRoles(applicationDTO.getUnrestrictedRoles()); application.setRating(applicationDTO.getAppRating()); - List applicationReleases = applicationDTO.getApplicationReleaseDTOs() - .stream().map(APIUtil::releaseDtoToRelease).collect(Collectors.toList()); + List applicationReleases = new ArrayList<>(); + for (ApplicationReleaseDTO applicationReleaseDTO : applicationDTO.getApplicationReleaseDTOs()) { + ApplicationRelease applicationRelease = releaseDtoToRelease(applicationReleaseDTO); + applicationReleases.add(applicationRelease); + } application.setApplicationReleases(applicationReleases); return application; } - public static ApplicationRelease releaseDtoToRelease(ApplicationReleaseDTO applicationReleaseDTO){ - String host = System.getProperty(Constants.IOT_HOST_PROPERTY); - String port = System.getProperty(Constants.IOT_PORT_PROPERTY); - String artifactDownloadEndpoint = ConfigurationManager.getInstance().getConfiguration() - .getArtifactDownloadEndpoint(); - String basePath = Constants.ARTIFACT_DOWNLOAD_PROTOCOL + "://" + host + ":" + port + artifactDownloadEndpoint - + Constants.FORWARD_SLASH + applicationReleaseDTO.getUuid() + Constants.FORWARD_SLASH; + public static ApplicationRelease releaseDtoToRelease(ApplicationReleaseDTO applicationReleaseDTO) + throws ApplicationManagementException { + String basePath = getArtifactDownloadBaseURL() + applicationReleaseDTO.getUuid() + + Constants.FORWARD_SLASH; List screenshotPaths = new ArrayList<>(); ApplicationRelease applicationRelease = new ApplicationRelease(); @@ -391,4 +392,22 @@ public class APIUtil { return applicationRelease; } + public static String getArtifactDownloadBaseURL() throws ApplicationManagementException { + String host = System.getProperty(Constants.IOT_HOST_PROPERTY); + MDMConfig mdmConfig = ConfigurationManager.getInstance().getConfiguration().getMdmConfig(); + String port; + if (Constants.HTTP_PROTOCOL.equals(mdmConfig.getArtifactDownloadProtocol())){ + port = System.getProperty(Constants.IOT_HTTP_PORT_PROPERTY); + } else if( Constants.HTTPS_PROTOCOL.equals(mdmConfig.getArtifactDownloadProtocol())){ + port = System.getProperty(Constants.IOT_HTTPS_PORT_PROPERTY); + } else { + String msg = "In order to download application artifacts invalid protocols are defined."; + log.error(msg); + throw new ApplicationManagementException(msg); + } + String artifactDownloadEndpoint = mdmConfig.getArtifactDownloadEndpoint(); + return mdmConfig.getArtifactDownloadProtocol() + "://" + host + ":" + port + + artifactDownloadEndpoint + Constants.FORWARD_SLASH; + } + } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/Constants.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/Constants.java index 1e05e2df74..3de99585db 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/Constants.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/Constants.java @@ -37,8 +37,10 @@ public class Constants { public static final String CF_BUNDLE_VERSION = "CFBundleVersion"; public static final String APP_EXTENSION = ".app"; public static final String IOT_HOST_PROPERTY = "iot.core.host"; - public static final String IOT_PORT_PROPERTY = "iot.core.http.port"; - public static final String ARTIFACT_DOWNLOAD_PROTOCOL = "http"; + public static final String IOT_HTTP_PORT_PROPERTY = "iot.core.http.port"; + public static final String IOT_HTTPS_PORT_PROPERTY = "iot.core.https.port"; + public static final String HTTPS_PROTOCOL = "https"; + public static final String HTTP_PROTOCOL = "http"; public static final String FORWARD_SLASH = "/"; public static final String ANY = "ANY"; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/DAOUtil.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/DAOUtil.java index a9de4b1922..25dbacd6c2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/DAOUtil.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/DAOUtil.java @@ -23,17 +23,13 @@ import org.apache.commons.logging.LogFactory; import org.json.JSONException; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.config.Configuration; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl; @@ -264,21 +260,6 @@ public class DAOUtil { } } - public static PaginationRequest validateCommentListPageSize(PaginationRequest paginationRequest) throws - ReviewManagementException { - if (paginationRequest.getLimit() == 0) { - Configuration commentManagementConfig = ConfigurationManager.getInstance().getConfiguration(); - if (commentManagementConfig != null) { - paginationRequest.setLimit( - commentManagementConfig.getPaginationConfiguration().getCommentListPageSize()); - } else { - throw new ReviewManagementException( - "ApplicationDTO Management configuration has not initialized. Please check the application-mgt.xml file."); - } - } - return paginationRequest; - } - private static ApplicationManager applicationManager; private static ApplicationStorageManager applicationStorageManager; private static SubscriptionManager subscriptionManager; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dao/ApplicationManagementDAOTest.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dao/ApplicationManagementDAOTest.java index 6d07b0c688..fc2cfc8606 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dao/ApplicationManagementDAOTest.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dao/ApplicationManagementDAOTest.java @@ -6,6 +6,7 @@ import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.device.application.mgt.core.BaseTestCase; +import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; import org.wso2.carbon.device.application.mgt.core.dto.ApplicationsDTO; import org.wso2.carbon.device.application.mgt.core.dto.DeviceTypeCreator; @@ -22,12 +23,12 @@ public class ApplicationManagementDAOTest extends BaseTestCase { @BeforeClass public void initialize() throws Exception { log.info("Initializing ApplicationManagementDAOTest tests"); + ConfigurationManager configurationManager = ConfigurationManager.getInstance(); // super.initializeServices(); } @Test public void testAddApplication() throws Exception { - ApplicationDAO applicationDAO = ApplicationManagementDAOFactory.getApplicationDAO(); ConnectionManagerUtil.beginDBTransaction(); applicationDAO.createApplication(ApplicationsDTO.getApp1(), -1234); @@ -52,6 +53,4 @@ public class ApplicationManagementDAOTest extends BaseTestCase { DeviceManagementDAOFactory.closeConnection(); } } - - } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/application-mgt.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/application-mgt.xml index 5af3ccc567..203e987a3c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/application-mgt.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/application-mgt.xml @@ -18,7 +18,7 @@ --> - + jdbc/APPM_DS @@ -135,7 +135,6 @@ true false - false application_management @@ -150,23 +149,42 @@ perm:app:review:update perm:app:publisher:view perm:app:publisher:update + perm:app:store:view + perm:app:subscription:install + perm:app:subscription:uninstall + perm:admin:app:review:update + perm:admin:app:review:view + perm:admin:app:publisher:update + perm:admin:app:review:update app-mgt - - /application-mgt - - /pages/error/client-errors/400 - /pages/error/client-errors/401 - /pages/error/client-errors/403 - /pages/error/client-errors/404 - /pages/error/client-errors/405 - /pages/error/client-errors/406 - /pages/error/client-errors/415 - /pages/error/server-errors/500 - /pages/error/default - - + + /pages/error/client-errors/400 + /pages/error/client-errors/401 + /pages/error/client-errors/403 + /pages/error/client-errors/404 + /pages/error/client-errors/405 + /pages/error/client-errors/406 + /pages/error/client-errors/415 + /pages/error/server-errors/500 + /pages/error/default + + + + EMM + IoT + + + + 1 + 10 + + + + https + /api/application-mgt/v1.0/artifact + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml index fa7c40bbc5..203e987a3c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml @@ -37,7 +37,7 @@ org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl - /tmp/apps/ + repository/resources/apps/ 6 @@ -135,7 +135,6 @@ true false - false application_management @@ -151,27 +150,29 @@ perm:app:publisher:view perm:app:publisher:update perm:app:store:view + perm:app:subscription:install + perm:app:subscription:uninstall + perm:admin:app:review:update + perm:admin:app:review:view + perm:admin:app:publisher:update + perm:admin:app:review:update app-mgt - - /apps - - /pages/error/client-errors/400 - /pages/error/client-errors/401 - /pages/error/client-errors/403 - /pages/error/client-errors/404 - /pages/error/client-errors/405 - /pages/error/client-errors/406 - /pages/error/client-errors/415 - /pages/error/server-errors/500 - /pages/error/default - - + + /pages/error/client-errors/400 + /pages/error/client-errors/401 + /pages/error/client-errors/403 + /pages/error/client-errors/404 + /pages/error/client-errors/405 + /pages/error/client-errors/406 + /pages/error/client-errors/415 + /pages/error/server-errors/500 + /pages/error/default + - https://localhost:9443/api/application-mgt/v1.0/artifact EMM IoT @@ -181,4 +182,9 @@ 1 10 + + + https + /api/application-mgt/v1.0/artifact + diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml index f844cb9195..203e987a3c 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml @@ -173,7 +173,6 @@ - /api/application-mgt/v1.0/artifact EMM IoT @@ -185,6 +184,7 @@ - https + https + /api/application-mgt/v1.0/artifact