From c199f6fe69e408ee77919656ae3956ebac27501d Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 10 Dec 2014 17:53:54 +0530 Subject: [PATCH 1/5] Renaming MobileDeviceManagementServiceComponent.java as MobileDeviceManagementBundleActivator.java and adding missing Bundle-Activator header in org.wso2.carbon.device.mgt.mobile.impl pom --- .../device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml | 1 + ...ponent.java => MobileDeviceManagementBundleActivator.java} | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/{MobileDeviceManagementServiceComponent.java => MobileDeviceManagementBundleActivator.java} (96%) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml index 043e0dd60e..8dd8ef138c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml @@ -35,6 +35,7 @@ ${project.artifactId} ${project.version} Device Management Mobile Impl Bundle + org.wso2.carbon.device.mgt.mobile.impl.internal.MobileDeviceManagementBundleActivator org.wso2.carbon.device.mgt.mobile.impl.internal org.osgi.framework, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementBundleActivator.java similarity index 96% rename from components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementServiceComponent.java rename to components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementBundleActivator.java index 7978214969..e614119492 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/internal/MobileDeviceManagementBundleActivator.java @@ -26,9 +26,9 @@ import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManagerServic import org.wso2.carbon.device.mgt.mobile.impl.ios.IOSDeviceManagerService; import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManagerService; -public class MobileDeviceManagementServiceComponent implements BundleActivator { +public class MobileDeviceManagementBundleActivator implements BundleActivator { - private static final Log log = LogFactory.getLog(MobileDeviceManagementServiceComponent.class); + private static final Log log = LogFactory.getLog(MobileDeviceManagementBundleActivator.class); private ServiceRegistration androidServiceRegRef; private ServiceRegistration iOSServiceRegRef; private ServiceRegistration windowsServiceRegRef; From 14a3429a19d8a7a58783c78c9e7351aee0b1b976 Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Wed, 10 Dec 2014 18:04:29 +0530 Subject: [PATCH 2/5] Fixing cdm-config file adding --- .../src/main/resources/p2.inf | 3 +++ product/modules/distribution/src/assembly/bin.xml | 12 +++++++++++- product/modules/p2-profile-gen/pom.xml | 4 ++-- product/pom.xml | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf index e69de29bb2..b5222094b3 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf @@ -0,0 +1,3 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/cdm-config.xml,target:${installFolder}/../../conf/cdm-config.xml,overwrite:true);\ + diff --git a/product/modules/distribution/src/assembly/bin.xml b/product/modules/distribution/src/assembly/bin.xml index eee52239eb..cb4ffc670f 100644 --- a/product/modules/distribution/src/assembly/bin.xml +++ b/product/modules/distribution/src/assembly/bin.xml @@ -153,7 +153,7 @@ **/api-manager.xml **/sso-idp-config.xml - **/emm-config.xml + @@ -358,6 +358,16 @@ true 644 + + + + ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/cdm-config.xml + ${pom.artifactId}-${pom.version}/repository/conf + true + 644 + + + ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading-environments.xml ${pom.artifactId}-${pom.version}/repository/conf/tomcat diff --git a/product/modules/p2-profile-gen/pom.xml b/product/modules/p2-profile-gen/pom.xml index 97d4a18cdd..5418904a50 100644 --- a/product/modules/p2-profile-gen/pom.xml +++ b/product/modules/p2-profile-gen/pom.xml @@ -107,7 +107,7 @@ org.wso2.carbon:org.wso2.carbon.device.mgt.server.feature:${project.version} - + org.wso2.carbon:org.wso2.carbon.device.mgt.mobile.feature:${project.version} @@ -164,7 +164,7 @@ org.wso2.carbon.device.mgt.server.feature.group ${project.version} - + org.wso2.carbon.device.mgt.mobile.feature.group ${project.version} diff --git a/product/pom.xml b/product/pom.xml index c9fbafc3d0..3c38159663 100644 --- a/product/pom.xml +++ b/product/pom.xml @@ -34,7 +34,7 @@ WSO2 Connected Device Manager (CDM) - Parent - + modules/agents/android/jax-rs modules/p2-profile-gen modules/distribution modules/integration From f50e9cebdbee284d04ae2406e91266d7f68549f9 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 10 Dec 2014 18:07:01 +0530 Subject: [PATCH 3/5] Fixing issues in reading the SQL script associated with CDM related functionalities --- .../mgt/core/util/DeviceManagementSchemaInitializer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java index 4ed4e8ad5d..448ae42007 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java @@ -27,18 +27,19 @@ import java.io.File; public final class DeviceManagementSchemaInitializer extends DatabaseCreator { private static final Log log = LogFactory.getLog(DeviceManagementSchemaInitializer.class); - private static final String setupSQLScriptLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts" ; + private static final String setupSQLScriptBaseLocation = + CarbonUtils.getCarbonHome() + File.separator + "dbscripts" + File.separator + "cdm" + File.separator; public DeviceManagementSchemaInitializer(DataSourceConfig config) { super(DeviceManagerUtil.resolveDataSource(config)); } protected String getDbScriptLocation(String databaseType) { - String scriptName = "wso2_cdm_" + databaseType + ".sql"; + String scriptName = databaseType + ".sql"; if (log.isDebugEnabled()) { log.debug("Loading database script from :" + scriptName); } - return setupSQLScriptLocation.replaceFirst("DBTYPE", databaseType) + scriptName; + return setupSQLScriptBaseLocation.replaceFirst("DBTYPE", databaseType) + scriptName; } } From e1c9856e1e7cf1d45020fd027c32b4b89cf69004 Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Wed, 10 Dec 2014 18:46:02 +0530 Subject: [PATCH 4/5] Adding cdm-datasources.xml --- .../conf/datasources/cdm-datasources.xml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 product/modules/distribution/src/repository/conf/datasources/cdm-datasources.xml diff --git a/product/modules/distribution/src/repository/conf/datasources/cdm-datasources.xml b/product/modules/distribution/src/repository/conf/datasources/cdm-datasources.xml new file mode 100755 index 0000000000..e24759f81b --- /dev/null +++ b/product/modules/distribution/src/repository/conf/datasources/cdm-datasources.xml @@ -0,0 +1,28 @@ + + + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader + + + + + WSO2DEVICE_DB + The datasource used for EMM + + jdbc/WSO2DEVICE_DB + + + + jdbc:h2:repository/database/WSO2DEVICE_DB;DB_CLOSE_ON_EXIT=FALSE + wso2carbon + wso2carbon + org.h2.Driver + 50 + 60000 + true + SELECT 1 + 30000 + + + + + From 3b79c983355c305520e416feb486c8031ab4506d Mon Sep 17 00:00:00 2001 From: Geeth Munasinghe Date: Wed, 10 Dec 2014 18:47:50 +0530 Subject: [PATCH 5/5] Adding the cdm-datasources.xml to bin xml --- product/modules/distribution/src/assembly/bin.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/product/modules/distribution/src/assembly/bin.xml b/product/modules/distribution/src/assembly/bin.xml index cb4ffc670f..6b06f312f5 100644 --- a/product/modules/distribution/src/assembly/bin.xml +++ b/product/modules/distribution/src/assembly/bin.xml @@ -170,6 +170,7 @@ wso2cdm-${project.version}/repository/conf/datasources **/master-datasources.xml + **/cdm-datasources.xml