mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Merging the latest changes introduced to master
This commit is contained in:
commit
8f3a2eec5d
@ -67,7 +67,8 @@
|
|||||||
org.wso2.carbon.core,
|
org.wso2.carbon.core,
|
||||||
org.wso2.carbon.core.util,
|
org.wso2.carbon.core.util,
|
||||||
org.wso2.carbon.event.output.adapter.core,
|
org.wso2.carbon.event.output.adapter.core,
|
||||||
org.wso2.carbon.event.output.adapter.core.exception
|
org.wso2.carbon.event.output.adapter.core.exception,
|
||||||
|
org.wso2.carbon.ndatasource.core
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
!org.wso2.carbon.device.mgt.iot.androidsense.plugin.internal,
|
!org.wso2.carbon.device.mgt.iot.androidsense.plugin.internal,
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.exception.AndroidSenseDeviceMgtPluginException;
|
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.exception.AndroidSenseDeviceMgtPluginException;
|
||||||
@ -49,14 +49,14 @@ public class AndroidSenseManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
|
public boolean saveConfiguration(PlatformConfiguration PlatformConfiguration)
|
||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
//TODO implement this
|
//TODO implement this
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
//TODO implement this
|
//TODO implement this
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ public class AndroidSenseDAOUtil {
|
|||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
dataSource = (DataSource) ctx.lookup(AndroidSenseConstants.DATA_SOURCE_NAME);
|
dataSource = (DataSource) ctx.lookup(AndroidSenseConstants.DATA_SOURCE_NAME);
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + AndroidSenseConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + AndroidSenseConstants.DATA_SOURCE_NAME, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,13 +85,12 @@ public class AndroidSenseUtils {
|
|||||||
try {
|
try {
|
||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
DataSource dataSource = (DataSource) ctx.lookup(AndroidSenseConstants.DATA_SOURCE_NAME);
|
DataSource dataSource = (DataSource) ctx.lookup(AndroidSenseConstants.DATA_SOURCE_NAME);
|
||||||
DeviceSchemaInitializer initializer =
|
DeviceSchemaInitializer initializer = new DeviceSchemaInitializer(dataSource);
|
||||||
new DeviceSchemaInitializer(dataSource);
|
|
||||||
log.info("Initializing device management repository database schema");
|
log.info("Initializing device management repository database schema");
|
||||||
initializer.createRegistryDatabase();
|
initializer.createRegistryDatabase();
|
||||||
|
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + AndroidSenseConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + AndroidSenseConstants.DATA_SOURCE_NAME, e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new AndroidSenseDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
throw new AndroidSenseDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
||||||
"Management database schema", e);
|
"Management database schema", e);
|
||||||
|
|||||||
@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl.util;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.constants.AndroidSenseConstants;
|
||||||
import org.wso2.carbon.utils.CarbonUtils;
|
import org.wso2.carbon.utils.CarbonUtils;
|
||||||
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
||||||
|
|
||||||
@ -33,7 +34,8 @@ public class DeviceSchemaInitializer extends DatabaseCreator{
|
|||||||
|
|
||||||
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
||||||
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
||||||
+ File.separator + "cdm" + File.separator + "plugins" + File.separator;
|
+ File.separator + "cdm" + File.separator + "plugins" + File.separator + AndroidSenseConstants.DEVICE_TYPE
|
||||||
|
+ File.separator;
|
||||||
|
|
||||||
public DeviceSchemaInitializer(DataSource dataSource) {
|
public DeviceSchemaInitializer(DataSource dataSource) {
|
||||||
super(dataSource);
|
super(dataSource);
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl.AndroidSenseManag
|
|||||||
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl.util.AndroidSenseStartupListener;
|
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl.util.AndroidSenseStartupListener;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl.util.AndroidSenseUtils;
|
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl.util.AndroidSenseUtils;
|
||||||
import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
|
import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
|
||||||
|
import org.wso2.carbon.ndatasource.core.DataSourceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @scr.component name="org.wso2.carbon.device.mgt.iot.android.internal.AndroidSenseManagementServiceComponent"
|
* @scr.component name="org.wso2.carbon.device.mgt.iot.android.internal.AndroidSenseManagementServiceComponent"
|
||||||
@ -38,6 +39,12 @@ import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
|
|||||||
* policy="dynamic"
|
* policy="dynamic"
|
||||||
* bind="setOutputEventAdapterService"
|
* bind="setOutputEventAdapterService"
|
||||||
* unbind="unsetOutputEventAdapterService"
|
* unbind="unsetOutputEventAdapterService"
|
||||||
|
* @scr.reference name="org.wso2.carbon.ndatasource"
|
||||||
|
* interface="org.wso2.carbon.ndatasource.core.DataSourceService"
|
||||||
|
* cardinality="1..1"
|
||||||
|
* policy="dynamic"
|
||||||
|
* bind="setDataSourceService"
|
||||||
|
* unbind="unsetDataSourceService"
|
||||||
*/
|
*/
|
||||||
public class AndroidSenseManagementServiceComponent {
|
public class AndroidSenseManagementServiceComponent {
|
||||||
|
|
||||||
@ -57,8 +64,7 @@ public class AndroidSenseManagementServiceComponent {
|
|||||||
String setupOption = System.getProperty("setup");
|
String setupOption = System.getProperty("setup");
|
||||||
if (setupOption != null) {
|
if (setupOption != null) {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug(
|
log.debug("-Dsetup is enabled. Iot Device management repository schema initialization is about " +
|
||||||
"-Dsetup is enabled. Iot Device management repository schema initialization is about " +
|
|
||||||
"to begin");
|
"to begin");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -108,4 +114,16 @@ public class AndroidSenseManagementServiceComponent {
|
|||||||
protected void unsetOutputEventAdapterService(OutputEventAdapterService outputEventAdapterService) {
|
protected void unsetOutputEventAdapterService(OutputEventAdapterService outputEventAdapterService) {
|
||||||
AndroidSenseManagementDataHolder.getInstance().setOutputEventAdapterService(null);
|
AndroidSenseManagementDataHolder.getInstance().setOutputEventAdapterService(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setDataSourceService(DataSourceService dataSourceService) {
|
||||||
|
/* This is to avoid mobile device management component getting initialized before the underlying datasources
|
||||||
|
are registered */
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Data source service set to service component");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void unsetDataSourceService(DataSourceService dataSourceService) {
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Licensed 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.
|
||||||
|
*/
|
||||||
|
.circle {
|
||||||
|
background: none repeat scroll 0 0 #191919;
|
||||||
|
border-radius: 50px;
|
||||||
|
height: 50px;
|
||||||
|
padding: 10px;
|
||||||
|
width: 50px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-top-double {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-double {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grey {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
display: block;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #7f7f7f;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-grey {
|
||||||
|
color: #7c7c7c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uppercase {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grey-bg {
|
||||||
|
background-color: #f6f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link {
|
||||||
|
background: #11375B;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -272,61 +272,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style type="text/css">
|
{{#zone "topCss"}}
|
||||||
.circle {
|
{{css "css/styles.css"}}
|
||||||
background: none repeat scroll 0 0 #191919;
|
{{/zone}}
|
||||||
border-radius: 50px;
|
|
||||||
height: 50px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 50px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padding-top-double {
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padding-double {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grey {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
display: block;
|
|
||||||
height: 1px;
|
|
||||||
border: 0;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.light-grey {
|
|
||||||
color: #7c7c7c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uppercase {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grey-bg {
|
|
||||||
background-color: #f6f4f4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link {
|
|
||||||
background: #11375B;
|
|
||||||
padding: 20px;
|
|
||||||
color: white;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
{{js "/js/download.js"}}
|
{{js "/js/download.js"}}
|
||||||
|
|||||||
@ -69,7 +69,8 @@
|
|||||||
org.wso2.carbon.device.mgt.common,
|
org.wso2.carbon.device.mgt.common,
|
||||||
org.wso2.carbon.device.mgt.iot.*,
|
org.wso2.carbon.device.mgt.iot.*,
|
||||||
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
|
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
|
||||||
org.wso2.carbon.utils.*
|
org.wso2.carbon.utils.*,
|
||||||
|
org.wso2.carbon.ndatasource.core
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
|
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.iot.arduino.plugin.exception.ArduinoDeviceMgtPluginException;
|
import org.wso2.carbon.device.mgt.iot.arduino.plugin.exception.ArduinoDeviceMgtPluginException;
|
||||||
@ -51,14 +51,14 @@ public class ArduinoManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
|
public boolean saveConfiguration(PlatformConfiguration PlatformConfiguration)
|
||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
//TODO implement this
|
//TODO implement this
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
//TODO implement this
|
//TODO implement this
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public class ArduinoDAOUtil {
|
|||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
dataSource = (DataSource) ctx.lookup(ArduinoConstants.DATA_SOURCE_NAME);
|
dataSource = (DataSource) ctx.lookup(ArduinoConstants.DATA_SOURCE_NAME);
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + ArduinoConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + ArduinoConstants.DATA_SOURCE_NAME, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,13 +97,12 @@ public class ArduinoUtils {
|
|||||||
try {
|
try {
|
||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
DataSource dataSource = (DataSource) ctx.lookup(ArduinoConstants.DATA_SOURCE_NAME);
|
DataSource dataSource = (DataSource) ctx.lookup(ArduinoConstants.DATA_SOURCE_NAME);
|
||||||
DeviceSchemaInitializer initializer =
|
DeviceSchemaInitializer initializer = new DeviceSchemaInitializer(dataSource);
|
||||||
new DeviceSchemaInitializer(dataSource);
|
|
||||||
log.info("Initializing device management repository database schema");
|
log.info("Initializing device management repository database schema");
|
||||||
initializer.createRegistryDatabase();
|
initializer.createRegistryDatabase();
|
||||||
|
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + ArduinoConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + ArduinoConstants.DATA_SOURCE_NAME, e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ArduinoDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
throw new ArduinoDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
||||||
"Management database schema", e);
|
"Management database schema", e);
|
||||||
|
|||||||
@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.iot.arduino.plugin.impl.util;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.arduino.plugin.constants.ArduinoConstants;
|
||||||
import org.wso2.carbon.utils.CarbonUtils;
|
import org.wso2.carbon.utils.CarbonUtils;
|
||||||
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
||||||
|
|
||||||
@ -33,7 +34,8 @@ public class DeviceSchemaInitializer extends DatabaseCreator{
|
|||||||
|
|
||||||
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
||||||
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
||||||
+ File.separator + "cdm" + File.separator + "plugins" + File.separator;
|
+ File.separator + "cdm" + File.separator + "plugins" + File.separator + ArduinoConstants.DEVICE_TYPE
|
||||||
|
+ File.separator;
|
||||||
|
|
||||||
public DeviceSchemaInitializer(DataSource dataSource) {
|
public DeviceSchemaInitializer(DataSource dataSource) {
|
||||||
super(dataSource);
|
super(dataSource);
|
||||||
|
|||||||
@ -27,9 +27,17 @@ import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
|
|||||||
import org.wso2.carbon.device.mgt.iot.arduino.plugin.exception.ArduinoDeviceMgtPluginException;
|
import org.wso2.carbon.device.mgt.iot.arduino.plugin.exception.ArduinoDeviceMgtPluginException;
|
||||||
import org.wso2.carbon.device.mgt.iot.arduino.plugin.impl.ArduinoManagerService;
|
import org.wso2.carbon.device.mgt.iot.arduino.plugin.impl.ArduinoManagerService;
|
||||||
import org.wso2.carbon.device.mgt.iot.arduino.plugin.impl.util.ArduinoUtils;
|
import org.wso2.carbon.device.mgt.iot.arduino.plugin.impl.util.ArduinoUtils;
|
||||||
|
import org.wso2.carbon.ndatasource.core.DataSourceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @scr.component name="org.wso2.carbon.device.mgt.iot.arduino.internal.ArduinoManagementServiceComponent"
|
* @scr.component name="org.wso2.carbon.device.mgt.iot.arduino.internal.ArduinoManagementServiceComponent"
|
||||||
* immediate="true"
|
* immediate="true"
|
||||||
|
* @scr.reference name="org.wso2.carbon.ndatasource"
|
||||||
|
* interface="org.wso2.carbon.ndatasource.core.DataSourceService"
|
||||||
|
* cardinality="1..1"
|
||||||
|
* policy="dynamic"
|
||||||
|
* bind="setDataSourceService"
|
||||||
|
* unbind="unsetDataSourceService"
|
||||||
*/
|
*/
|
||||||
public class ArduinoManagementServiceComponent {
|
public class ArduinoManagementServiceComponent {
|
||||||
|
|
||||||
@ -83,4 +91,16 @@ public class ArduinoManagementServiceComponent {
|
|||||||
log.error("Error occurred while de-activating Arduino Device Management bundle", e);
|
log.error("Error occurred while de-activating Arduino Device Management bundle", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setDataSourceService(DataSourceService dataSourceService) {
|
||||||
|
/* This is to avoid mobile device management component getting initialized before the underlying datasources
|
||||||
|
are registered */
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Data source service set to service component");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void unsetDataSourceService(DataSourceService dataSourceService) {
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Licensed 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.
|
||||||
|
*/
|
||||||
|
.circle {
|
||||||
|
background: none repeat scroll 0 0 #191919;
|
||||||
|
border-radius: 50px;
|
||||||
|
height: 50px;
|
||||||
|
padding: 10px;
|
||||||
|
width: 50px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.padding-top-double {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
.padding-double {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.grey {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
display: block;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #7f7f7f;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
.light-grey {
|
||||||
|
color: #7c7c7c;
|
||||||
|
}
|
||||||
|
.uppercase {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.grey-bg {
|
||||||
|
background-color: #f6f4f4;
|
||||||
|
}
|
||||||
|
.doc-link {
|
||||||
|
background: #11375B;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.doc-link a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -289,51 +289,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#zone "topCss"}}
|
{{#zone "topCss"}}
|
||||||
<style type="text/css">
|
{{css "css/styles.css"}}
|
||||||
.circle {
|
|
||||||
background: none repeat scroll 0 0 #191919;
|
|
||||||
border-radius: 50px;
|
|
||||||
height: 50px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 50px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.padding-top-double {
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
.padding-double {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
.grey {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
hr {
|
|
||||||
display: block;
|
|
||||||
height: 1px;
|
|
||||||
border: 0;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
.light-grey {
|
|
||||||
color: #7c7c7c;
|
|
||||||
}
|
|
||||||
.uppercase {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
.grey-bg {
|
|
||||||
background-color: #f6f4f4;
|
|
||||||
}
|
|
||||||
.doc-link {
|
|
||||||
background: #11375B;
|
|
||||||
padding: 20px;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.doc-link a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
|
|||||||
@ -76,7 +76,8 @@
|
|||||||
org.wso2.carbon.core,
|
org.wso2.carbon.core,
|
||||||
org.wso2.carbon.core.util,
|
org.wso2.carbon.core.util,
|
||||||
org.wso2.carbon.event.output.adapter.core,
|
org.wso2.carbon.event.output.adapter.core,
|
||||||
org.wso2.carbon.event.output.adapter.core.exception
|
org.wso2.carbon.event.output.adapter.core.exception,
|
||||||
|
org.wso2.carbon.ndatasource.core
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
!org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.internal,
|
!org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.internal,
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.exception.RaspberrypiDeviceMgtPluginException;
|
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.exception.RaspberrypiDeviceMgtPluginException;
|
||||||
@ -49,13 +49,13 @@ public class RaspberrypiManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
|
public boolean saveConfiguration(PlatformConfiguration tenantConfiguration)
|
||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class RaspberrypiDAOUtil {
|
|||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
dataSource = (DataSource) ctx.lookup(RaspberrypiConstants.DATA_SOURCE_NAME);
|
dataSource = (DataSource) ctx.lookup(RaspberrypiConstants.DATA_SOURCE_NAME);
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + RaspberrypiConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + RaspberrypiConstants.DATA_SOURCE_NAME, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl.util;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.constants.RaspberrypiConstants;
|
||||||
import org.wso2.carbon.utils.CarbonUtils;
|
import org.wso2.carbon.utils.CarbonUtils;
|
||||||
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
||||||
|
|
||||||
@ -33,7 +34,8 @@ public class DeviceSchemaInitializer extends DatabaseCreator{
|
|||||||
|
|
||||||
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
||||||
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
||||||
+ File.separator + "cdm" + File.separator + "plugins" + File.separator;
|
+ File.separator + "cdm" + File.separator + "plugins" + File.separator + RaspberrypiConstants.DEVICE_TYPE
|
||||||
|
+ File.separator;
|
||||||
|
|
||||||
public DeviceSchemaInitializer(DataSource dataSource) {
|
public DeviceSchemaInitializer(DataSource dataSource) {
|
||||||
super(dataSource);
|
super(dataSource);
|
||||||
|
|||||||
@ -87,12 +87,11 @@ public class RaspberrypiUtils {
|
|||||||
try {
|
try {
|
||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
DataSource dataSource = (DataSource) ctx.lookup(RaspberrypiConstants.DATA_SOURCE_NAME);
|
DataSource dataSource = (DataSource) ctx.lookup(RaspberrypiConstants.DATA_SOURCE_NAME);
|
||||||
DeviceSchemaInitializer initializer =
|
DeviceSchemaInitializer initializer = new DeviceSchemaInitializer(dataSource);
|
||||||
new DeviceSchemaInitializer(dataSource);
|
|
||||||
log.info("Initializing device management repository database schema");
|
log.info("Initializing device management repository database schema");
|
||||||
initializer.createRegistryDatabase();
|
initializer.createRegistryDatabase();
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + RaspberrypiConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + RaspberrypiConstants.DATA_SOURCE_NAME, e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RaspberrypiDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
throw new RaspberrypiDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
||||||
"Management database schema", e);
|
"Management database schema", e);
|
||||||
|
|||||||
@ -30,6 +30,7 @@ import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl.RaspberrypiManager
|
|||||||
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl.util.RaspberrypiStartupListener;
|
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl.util.RaspberrypiStartupListener;
|
||||||
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl.util.RaspberrypiUtils;
|
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl.util.RaspberrypiUtils;
|
||||||
import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
|
import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
|
||||||
|
import org.wso2.carbon.ndatasource.core.DataSourceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @scr.component name="org.wso2.carbon.device.mgt.iot.raspberrypi.internal.RaspberrypiManagementServiceComponent"
|
* @scr.component name="org.wso2.carbon.device.mgt.iot.raspberrypi.internal.RaspberrypiManagementServiceComponent"
|
||||||
@ -40,6 +41,12 @@ import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
|
|||||||
* policy="dynamic"
|
* policy="dynamic"
|
||||||
* bind="setOutputEventAdapterService"
|
* bind="setOutputEventAdapterService"
|
||||||
* unbind="unsetOutputEventAdapterService"
|
* unbind="unsetOutputEventAdapterService"
|
||||||
|
* @scr.reference name="org.wso2.carbon.ndatasource"
|
||||||
|
* interface="org.wso2.carbon.ndatasource.core.DataSourceService"
|
||||||
|
* cardinality="1..1"
|
||||||
|
* policy="dynamic"
|
||||||
|
* bind="setDataSourceService"
|
||||||
|
* unbind="unsetDataSourceService"
|
||||||
*/
|
*/
|
||||||
public class RaspberrypiManagementServiceComponent {
|
public class RaspberrypiManagementServiceComponent {
|
||||||
|
|
||||||
@ -110,4 +117,16 @@ public class RaspberrypiManagementServiceComponent {
|
|||||||
RaspberrypiManagementDataHolder.getInstance().setOutputEventAdapterService(null);
|
RaspberrypiManagementDataHolder.getInstance().setOutputEventAdapterService(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setDataSourceService(DataSourceService dataSourceService) {
|
||||||
|
/* This is to avoid mobile device management component getting initialized before the underlying datasources
|
||||||
|
are registered */
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Data source service set to service component");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void unsetDataSourceService(DataSourceService dataSourceService) {
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Licensed 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.
|
||||||
|
*/
|
||||||
|
.circle {
|
||||||
|
background: none repeat scroll 0 0 #191919;
|
||||||
|
border-radius: 50px;
|
||||||
|
height: 50px;
|
||||||
|
padding: 10px;
|
||||||
|
width: 50px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-top-double {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-double {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grey {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
display: block;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #7f7f7f;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-grey {
|
||||||
|
color: #7c7c7c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uppercase {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grey-bg {
|
||||||
|
background-color: #f6f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link {
|
||||||
|
background: #11375B;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -278,61 +278,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#zone "topCss"}}
|
{{#zone "topCss"}}
|
||||||
<style type="text/css">
|
{{css "css/styles.css"}}
|
||||||
.circle {
|
|
||||||
background: none repeat scroll 0 0 #191919;
|
|
||||||
border-radius: 50px;
|
|
||||||
height: 50px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 50px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padding-top-double {
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padding-double {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grey {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
display: block;
|
|
||||||
height: 1px;
|
|
||||||
border: 0;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.light-grey {
|
|
||||||
color: #7c7c7c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uppercase {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grey-bg {
|
|
||||||
background-color: #f6f4f4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link {
|
|
||||||
background: #11375B;
|
|
||||||
padding: 20px;
|
|
||||||
color: white;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
javax.xml.bind,
|
javax.xml.bind,
|
||||||
javax.xml.bind.annotation,
|
javax.xml.bind.annotation,
|
||||||
javax.xml.parsers,
|
javax.xml.parsers,
|
||||||
org.w3c.dom
|
org.w3c.dom,
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
!org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.internal,
|
!org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.internal,
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.exception.VirtualFirealarmDeviceMgtPluginException;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.exception.VirtualFirealarmDeviceMgtPluginException;
|
||||||
@ -50,13 +50,13 @@ public class VirtualFireAlarmManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
|
public boolean saveConfiguration(PlatformConfiguration PlatformConfiguration)
|
||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public class VirtualFireAlarmDAOUtil {
|
|||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
dataSource = (DataSource) ctx.lookup(VirtualFireAlarmConstants.DATA_SOURCE_NAME);
|
dataSource = (DataSource) ctx.lookup(VirtualFireAlarmConstants.DATA_SOURCE_NAME);
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + VirtualFireAlarmConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + VirtualFireAlarmConstants.DATA_SOURCE_NAME, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.impl.util;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants;
|
||||||
import org.wso2.carbon.utils.CarbonUtils;
|
import org.wso2.carbon.utils.CarbonUtils;
|
||||||
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;
|
||||||
|
|
||||||
@ -33,7 +34,8 @@ public class DeviceSchemaInitializer extends DatabaseCreator{
|
|||||||
|
|
||||||
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
private static final Log log = LogFactory.getLog(DeviceSchemaInitializer.class);
|
||||||
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
private static final String setupSQLScriptBaseLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts"
|
||||||
+ File.separator + "cdm" + File.separator + "plugins" + File.separator;
|
+ File.separator + "cdm" + File.separator + "plugins" + File.separator
|
||||||
|
+ VirtualFireAlarmConstants.DEVICE_TYPE + File.separator;
|
||||||
|
|
||||||
public DeviceSchemaInitializer(DataSource dataSource) {
|
public DeviceSchemaInitializer(DataSource dataSource) {
|
||||||
super(dataSource);
|
super(dataSource);
|
||||||
|
|||||||
@ -100,12 +100,11 @@ public class VirtualFireAlarmUtils {
|
|||||||
try {
|
try {
|
||||||
Context ctx = new InitialContext();
|
Context ctx = new InitialContext();
|
||||||
DataSource dataSource = (DataSource) ctx.lookup(VirtualFireAlarmConstants.DATA_SOURCE_NAME);
|
DataSource dataSource = (DataSource) ctx.lookup(VirtualFireAlarmConstants.DATA_SOURCE_NAME);
|
||||||
DeviceSchemaInitializer initializer =
|
DeviceSchemaInitializer initializer = new DeviceSchemaInitializer(dataSource);
|
||||||
new DeviceSchemaInitializer(dataSource);
|
|
||||||
log.info("Initializing device management repository database schema");
|
log.info("Initializing device management repository database schema");
|
||||||
initializer.createRegistryDatabase();
|
initializer.createRegistryDatabase();
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
log.error("Error while looking up the data source: " + VirtualFireAlarmConstants.DATA_SOURCE_NAME);
|
log.error("Error while looking up the data source: " + VirtualFireAlarmConstants.DATA_SOURCE_NAME, e);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new VirtualFirealarmDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
throw new VirtualFirealarmDeviceMgtPluginException("Error occurred while initializing Iot Device " +
|
||||||
"Management database schema", e);
|
"Management database schema", e);
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Licensed 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.
|
||||||
|
*/
|
||||||
|
.circle {
|
||||||
|
background: none repeat scroll 0 0 #191919;
|
||||||
|
border-radius: 50px;
|
||||||
|
height: 50px;
|
||||||
|
padding: 10px;
|
||||||
|
width: 50px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-top-double {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding-double {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grey {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
display: block;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #7f7f7f;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-grey {
|
||||||
|
color: #7c7c7c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uppercase {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grey-bg {
|
||||||
|
background-color: #f6f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link {
|
||||||
|
background: #11375B;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -250,62 +250,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#zone "topCss"}}
|
{{#zone "topCss"}}
|
||||||
<style type="text/css">
|
{{css "css/styles.css"}}
|
||||||
.circle {
|
|
||||||
background: none repeat scroll 0 0 #191919;
|
|
||||||
border-radius: 50px;
|
|
||||||
height: 50px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 50px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padding-top-double {
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.padding-double {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grey {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
display: block;
|
|
||||||
height: 1px;
|
|
||||||
border: 0;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.light-grey {
|
|
||||||
color: #7c7c7c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uppercase {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grey-bg {
|
|
||||||
background-color: #f6f4f4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link {
|
|
||||||
background: #11375B;
|
|
||||||
padding: 20px;
|
|
||||||
color: white;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.annotations.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.annotations.ApiResponses;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException;
|
import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException;
|
||||||
|
|
||||||
import javax.ws.rs.*;
|
import javax.ws.rs.*;
|
||||||
@ -46,14 +46,13 @@ public interface DeviceTypeConfigurationService {
|
|||||||
@ApiResponse(code = 500, message = "Internal Server Error")
|
@ApiResponse(code = 500, message = "Internal Server Error")
|
||||||
})
|
})
|
||||||
Response addConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration")
|
Response addConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration")
|
||||||
TenantConfiguration configuration) throws AndroidAgentException;
|
PlatformConfiguration configuration) throws AndroidAgentException;
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@ApiOperation(
|
@ApiOperation(
|
||||||
httpMethod = "GET",
|
httpMethod = "GET",
|
||||||
value = "Getting Android Platform Configurations",
|
value = "Getting Android Platform Configurations",
|
||||||
notes = "Get the Android platform configuration details using this REST API",
|
notes = "Get the Android platform configuration details using this REST API",
|
||||||
response = TenantConfiguration.class
|
response = PlatformConfiguration.class
|
||||||
)
|
)
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "Get Android Configurations"),
|
@ApiResponse(code = 200, message = "Get Android Configurations"),
|
||||||
@ -75,6 +74,6 @@ public interface DeviceTypeConfigurationService {
|
|||||||
"Android platform")
|
"Android platform")
|
||||||
})
|
})
|
||||||
Response updateConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration")
|
Response updateConfiguration(@ApiParam(name = "configuration", value = "AndroidPlatformConfiguration")
|
||||||
TenantConfiguration configuration) throws AndroidAgentException;
|
PlatformConfiguration configuration) throws AndroidAgentException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException;
|
import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException;
|
||||||
import org.wso2.carbon.mdm.services.android.services.DeviceTypeConfigurationService;
|
import org.wso2.carbon.mdm.services.android.services.DeviceTypeConfigurationService;
|
||||||
@ -46,7 +46,7 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
|
|||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Override
|
@Override
|
||||||
public Response addConfiguration(TenantConfiguration configuration) throws AndroidAgentException {
|
public Response addConfiguration(PlatformConfiguration configuration) throws AndroidAgentException {
|
||||||
Message responseMsg = new Message();
|
Message responseMsg = new Message();
|
||||||
String msg;
|
String msg;
|
||||||
ConfigurationEntry licenseEntry = null;
|
ConfigurationEntry licenseEntry = null;
|
||||||
@ -87,15 +87,15 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
|
|||||||
@Override
|
@Override
|
||||||
public Response getConfiguration() throws AndroidAgentException {
|
public Response getConfiguration() throws AndroidAgentException {
|
||||||
String msg;
|
String msg;
|
||||||
TenantConfiguration tenantConfiguration = null;
|
PlatformConfiguration PlatformConfiguration = null;
|
||||||
List<ConfigurationEntry> configs;
|
List<ConfigurationEntry> configs;
|
||||||
try {
|
try {
|
||||||
tenantConfiguration = AndroidAPIUtils.getDeviceManagementService().
|
PlatformConfiguration = AndroidAPIUtils.getDeviceManagementService().
|
||||||
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
||||||
if (tenantConfiguration != null) {
|
if (PlatformConfiguration != null) {
|
||||||
configs = tenantConfiguration.getConfiguration();
|
configs = PlatformConfiguration.getConfiguration();
|
||||||
} else {
|
} else {
|
||||||
tenantConfiguration = new TenantConfiguration();
|
PlatformConfiguration = new PlatformConfiguration();
|
||||||
configs = new ArrayList<>();
|
configs = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,19 +109,19 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
|
|||||||
entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY);
|
entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY);
|
||||||
entry.setValue(license.getText());
|
entry.setValue(license.getText());
|
||||||
configs.add(entry);
|
configs.add(entry);
|
||||||
tenantConfiguration.setConfiguration(configs);
|
PlatformConfiguration.setConfiguration(configs);
|
||||||
}
|
}
|
||||||
} catch (DeviceManagementException e) {
|
} catch (DeviceManagementException e) {
|
||||||
msg = "Error occurred while retrieving the Android tenant configuration";
|
msg = "Error occurred while retrieving the Android tenant configuration";
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
|
||||||
}
|
}
|
||||||
return Response.status(Response.Status.OK).entity(tenantConfiguration).build();
|
return Response.status(Response.Status.OK).entity(PlatformConfiguration).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PUT
|
@PUT
|
||||||
@Override
|
@Override
|
||||||
public Response updateConfiguration(TenantConfiguration configuration) throws AndroidAgentException {
|
public Response updateConfiguration(PlatformConfiguration configuration) throws AndroidAgentException {
|
||||||
String msg;
|
String msg;
|
||||||
Message responseMsg = new Message();
|
Message responseMsg = new Message();
|
||||||
ConfigurationEntry licenseEntry = null;
|
ConfigurationEntry licenseEntry = null;
|
||||||
|
|||||||
@ -93,6 +93,17 @@ public class AndroidAPIUtils {
|
|||||||
return deviceManagementProviderService;
|
return deviceManagementProviderService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public static GCMService getGCMService() {
|
||||||
|
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
||||||
|
// GCMService gcmService = (GCMService) ctx.getOSGiService(GCMService.class, null);
|
||||||
|
// if (gcmService == null) {
|
||||||
|
// String msg = "GCM service has not initialized.";
|
||||||
|
// log.error(msg);
|
||||||
|
// throw new IllegalStateException(msg);
|
||||||
|
// }
|
||||||
|
// return gcmService;
|
||||||
|
// }
|
||||||
|
|
||||||
public static MediaType getResponseMediaType(String acceptHeader) {
|
public static MediaType getResponseMediaType(String acceptHeader) {
|
||||||
MediaType responseMediaType;
|
MediaType responseMediaType;
|
||||||
if (MediaType.WILDCARD.equals(acceptHeader)) {
|
if (MediaType.WILDCARD.equals(acceptHeader)) {
|
||||||
@ -113,6 +124,17 @@ public class AndroidAPIUtils {
|
|||||||
List<DeviceIdentifier> validDeviceIds = deviceIDHolder.getValidDeviceIDList();
|
List<DeviceIdentifier> validDeviceIds = deviceIDHolder.getValidDeviceIDList();
|
||||||
Activity activity = getDeviceManagementService().addOperation(
|
Activity activity = getDeviceManagementService().addOperation(
|
||||||
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, operation, validDeviceIds);
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, operation, validDeviceIds);
|
||||||
|
// if (activity != null) {
|
||||||
|
// GCMService gcmService = getGCMService();
|
||||||
|
// if (gcmService.isGCMEnabled()) {
|
||||||
|
// List<DeviceIdentifier> deviceIDList = deviceIDHolder.getValidDeviceIDList();
|
||||||
|
// List<Device> devices = new ArrayList<Device>(deviceIDList.size());
|
||||||
|
// for (DeviceIdentifier deviceIdentifier : deviceIDList) {
|
||||||
|
// devices.add(getDeviceManagementService().getDevice(deviceIdentifier));
|
||||||
|
// }
|
||||||
|
// getGCMService().sendNotification(operation.getCode(), devices);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
if (!deviceIDHolder.getErrorDeviceIdList().isEmpty()) {
|
if (!deviceIDHolder.getErrorDeviceIdList().isEmpty()) {
|
||||||
return javax.ws.rs.core.Response.status(AndroidConstants.StatusCodes.
|
return javax.ws.rs.core.Response.status(AndroidConstants.StatusCodes.
|
||||||
MULTI_STATUS_HTTP_CODE).entity(deviceUtils.
|
MULTI_STATUS_HTTP_CODE).entity(deviceUtils.
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Licensed 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.
|
||||||
|
*/
|
||||||
|
.circle {
|
||||||
|
background: none repeat scroll 0 0 #191919;
|
||||||
|
border-radius: 50px;
|
||||||
|
height: 50px;
|
||||||
|
padding: 10px;
|
||||||
|
width: 50px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.padding-top-double {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
.padding-double {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.grey {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
display: block;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #7f7f7f;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
.light-grey {
|
||||||
|
color: #7c7c7c;
|
||||||
|
}
|
||||||
|
.uppercase {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.grey-bg {
|
||||||
|
background-color: #f6f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link {
|
||||||
|
background: #11375B;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -79,59 +79,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#zone "topCss"}}
|
{{#zone "topCss"}}
|
||||||
<style type="text/css">
|
{{css "css/styles.css"}}
|
||||||
.circle {
|
|
||||||
background: none repeat scroll 0 0 #191919;
|
|
||||||
border-radius: 50px;
|
|
||||||
height: 50px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 50px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.padding-top-double {
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
.padding-double {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
.grey {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
hr {
|
|
||||||
display: block;
|
|
||||||
height: 1px;
|
|
||||||
border: 0;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
.light-grey {
|
|
||||||
color: #7c7c7c;
|
|
||||||
}
|
|
||||||
.uppercase {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
.grey-bg {
|
|
||||||
background-color: #f6f4f4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link {
|
|
||||||
background: #11375B;
|
|
||||||
padding: 20px;
|
|
||||||
color: white;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(".download-link").click(function(){
|
$(".download-link").click(function(){
|
||||||
toggleEnrollment();
|
toggleEnrollment();
|
||||||
});
|
});
|
||||||
@ -141,6 +93,5 @@
|
|||||||
generateQRCode(".modalpopup-content .qr-code");
|
generateQRCode(".modalpopup-content .qr-code");
|
||||||
showPopup();
|
showPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
@ -27,7 +27,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
import org.wso2.carbon.device.mgt.common.DeviceManager;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
import org.wso2.carbon.device.mgt.common.FeatureManager;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
||||||
@ -85,7 +85,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
|
public boolean saveConfiguration(PlatformConfiguration tenantConfiguration)
|
||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
boolean status;
|
boolean status;
|
||||||
try {
|
try {
|
||||||
@ -96,7 +96,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
DeviceManagementConstants.
|
DeviceManagementConstants.
|
||||||
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Marshaller marshaller = context.createMarshaller();
|
Marshaller marshaller = context.createMarshaller();
|
||||||
marshaller.marshal(tenantConfiguration, writer);
|
marshaller.marshal(tenantConfiguration, writer);
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
Resource resource;
|
Resource resource;
|
||||||
try {
|
try {
|
||||||
String androidRegPath =
|
String androidRegPath =
|
||||||
@ -127,9 +127,9 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
||||||
resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath);
|
resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath);
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||||
return (TenantConfiguration) unmarshaller.unmarshal(
|
return (PlatformConfiguration) unmarshaller.unmarshal(
|
||||||
new StringReader(new String((byte[]) resource.getContent(), Charset.
|
new StringReader(new String((byte[]) resource.getContent(), Charset.
|
||||||
forName(MobilePluginConstants.CHARSET_UTF8))));
|
forName(MobilePluginConstants.CHARSET_UTF8))));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import org.wso2.carbon.context.CarbonContext;
|
|||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
|
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
|
||||||
import org.wso2.carbon.device.mgt.mobile.android.impl.util.AndroidPluginConstants;
|
import org.wso2.carbon.device.mgt.mobile.android.impl.util.AndroidPluginConstants;
|
||||||
import org.wso2.carbon.device.mgt.mobile.android.internal.AndroidDeviceManagementDataHolder;
|
import org.wso2.carbon.device.mgt.mobile.android.internal.AndroidDeviceManagementDataHolder;
|
||||||
@ -56,7 +56,7 @@ public class GCMUtil {
|
|||||||
private static final int TIME_TO_LIVE = 60;
|
private static final int TIME_TO_LIVE = 60;
|
||||||
private static final int HTTP_STATUS_CODE_OK = 200;
|
private static final int HTTP_STATUS_CODE_OK = 200;
|
||||||
|
|
||||||
private static HashMap<Integer,TenantConfiguration> tenantConfigurationCache = new HashMap<>();
|
private static HashMap<Integer, PlatformConfiguration> tenantConfigurationCache = new HashMap<>();
|
||||||
|
|
||||||
public static GCMResult sendWakeUpCall(String message, List<Device> devices) {
|
public static GCMResult sendWakeUpCall(String message, List<Device> devices) {
|
||||||
GCMResult result = new GCMResult();
|
GCMResult result = new GCMResult();
|
||||||
@ -163,7 +163,7 @@ public class GCMUtil {
|
|||||||
getAndroidDeviceManagementService();
|
getAndroidDeviceManagementService();
|
||||||
try {
|
try {
|
||||||
//Get the TenantConfiguration from cache if not we'll get it from DM service
|
//Get the TenantConfiguration from cache if not we'll get it from DM service
|
||||||
TenantConfiguration tenantConfiguration = getTenantConfigurationFromCache();
|
PlatformConfiguration tenantConfiguration = getTenantConfigurationFromCache();
|
||||||
if (tenantConfiguration == null) {
|
if (tenantConfiguration == null) {
|
||||||
tenantConfiguration = androidDMService.getDeviceManager().getConfiguration();
|
tenantConfiguration = androidDMService.getDeviceManager().getConfiguration();
|
||||||
if (tenantConfiguration != null) {
|
if (tenantConfiguration != null) {
|
||||||
@ -190,11 +190,11 @@ public class GCMUtil {
|
|||||||
tenantConfigurationCache.remove(getTenantId());
|
tenantConfigurationCache.remove(getTenantId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addTenantConfigurationToCache(TenantConfiguration tenantConfiguration) {
|
private static void addTenantConfigurationToCache(PlatformConfiguration tenantConfiguration) {
|
||||||
tenantConfigurationCache.put(getTenantId(), tenantConfiguration);
|
tenantConfigurationCache.put(getTenantId(), tenantConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TenantConfiguration getTenantConfigurationFromCache() {
|
private static PlatformConfiguration getTenantConfigurationFromCache() {
|
||||||
return tenantConfigurationCache.get(getTenantId());
|
return tenantConfigurationCache.get(getTenantId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.mobile.impl.android;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.device.mgt.common.*;
|
import org.wso2.carbon.device.mgt.common.*;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
||||||
@ -79,7 +79,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
|
public boolean saveConfiguration(PlatformConfiguration tenantConfiguration)
|
||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
boolean status;
|
boolean status;
|
||||||
try {
|
try {
|
||||||
@ -90,7 +90,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
DeviceManagementConstants.
|
DeviceManagementConstants.
|
||||||
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Marshaller marshaller = context.createMarshaller();
|
Marshaller marshaller = context.createMarshaller();
|
||||||
marshaller.marshal(tenantConfiguration, writer);
|
marshaller.marshal(tenantConfiguration, writer);
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
Resource resource;
|
Resource resource;
|
||||||
try {
|
try {
|
||||||
String androidRegPath =
|
String androidRegPath =
|
||||||
@ -121,9 +121,9 @@ public class AndroidDeviceManager implements DeviceManager {
|
|||||||
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
|
||||||
resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath);
|
resource = MobileDeviceManagementUtil.getRegistryResource(androidRegPath);
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||||
return (TenantConfiguration) unmarshaller.unmarshal(
|
return (PlatformConfiguration) unmarshaller.unmarshal(
|
||||||
new StringReader(new String((byte[]) resource.getContent(), Charset.
|
new StringReader(new String((byte[]) resource.getContent(), Charset.
|
||||||
forName(MobilePluginConstants.CHARSET_UTF8))));
|
forName(MobilePluginConstants.CHARSET_UTF8))));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,8 +25,9 @@ import org.wso2.carbon.context.CarbonContext;
|
|||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
|
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
|
||||||
|
import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManagementService;
|
||||||
import org.wso2.carbon.device.mgt.mobile.impl.android.util.AndroidPluginConstants;
|
import org.wso2.carbon.device.mgt.mobile.impl.android.util.AndroidPluginConstants;
|
||||||
import org.wso2.carbon.device.mgt.mobile.internal.MobileDeviceManagementDataHolder;
|
import org.wso2.carbon.device.mgt.mobile.internal.MobileDeviceManagementDataHolder;
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ public class GCMUtil {
|
|||||||
private static final int TIME_TO_LIVE = 60;
|
private static final int TIME_TO_LIVE = 60;
|
||||||
private static final int HTTP_STATUS_CODE_OK = 200;
|
private static final int HTTP_STATUS_CODE_OK = 200;
|
||||||
|
|
||||||
private static HashMap<Integer,TenantConfiguration> tenantConfigurationCache = new HashMap<>();
|
private static HashMap<Integer, PlatformConfiguration> tenantConfigurationCache = new HashMap<>();
|
||||||
|
|
||||||
public static GCMResult sendWakeUpCall(String message, List<Device> devices) {
|
public static GCMResult sendWakeUpCall(String message, List<Device> devices) {
|
||||||
GCMResult result = new GCMResult();
|
GCMResult result = new GCMResult();
|
||||||
@ -153,12 +154,12 @@ public class GCMUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getConfigurationProperty(String property) {
|
public static String getConfigurationProperty(String property) {
|
||||||
DeviceManagementService androidDMService = MobileDeviceManagementDataHolder.getInstance().
|
DeviceManagementService androidDMService = new AndroidDeviceManagementService();
|
||||||
getAndroidDeviceManagementService();
|
|
||||||
try {
|
try {
|
||||||
//Get the TenantConfiguration from cache if not we'll get it from DM service
|
//Get the TenantConfiguration from cache if not we'll get it from DM service
|
||||||
TenantConfiguration tenantConfiguration = getTenantConfigurationFromCache();
|
PlatformConfiguration tenantConfiguration = getTenantConfigurationFromCache();
|
||||||
if (tenantConfiguration == null) {
|
if (tenantConfiguration == null) {
|
||||||
|
androidDMService.init();
|
||||||
tenantConfiguration = androidDMService.getDeviceManager().getConfiguration();
|
tenantConfiguration = androidDMService.getDeviceManager().getConfiguration();
|
||||||
if (tenantConfiguration != null) {
|
if (tenantConfiguration != null) {
|
||||||
addTenantConfigurationToCache(tenantConfiguration);
|
addTenantConfigurationToCache(tenantConfiguration);
|
||||||
@ -184,11 +185,11 @@ public class GCMUtil {
|
|||||||
tenantConfigurationCache.remove(getTenantId());
|
tenantConfigurationCache.remove(getTenantId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addTenantConfigurationToCache(TenantConfiguration tenantConfiguration) {
|
private static void addTenantConfigurationToCache(PlatformConfiguration tenantConfiguration) {
|
||||||
tenantConfigurationCache.put(getTenantId(), tenantConfiguration);
|
tenantConfigurationCache.put(getTenantId(), tenantConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TenantConfiguration getTenantConfigurationFromCache() {
|
private static PlatformConfiguration getTenantConfigurationFromCache() {
|
||||||
return tenantConfigurationCache.get(getTenantId());
|
return tenantConfigurationCache.get(getTenantId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.mobile.impl.windows;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.device.mgt.common.*;
|
import org.wso2.carbon.device.mgt.common.*;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
||||||
@ -79,7 +79,7 @@ public class WindowsDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration) throws DeviceManagementException {
|
public boolean saveConfiguration(PlatformConfiguration tenantConfiguration) throws DeviceManagementException {
|
||||||
boolean status;
|
boolean status;
|
||||||
Resource resource;
|
Resource resource;
|
||||||
try {
|
try {
|
||||||
@ -89,7 +89,7 @@ public class WindowsDeviceManager implements DeviceManager {
|
|||||||
String resourcePath = MobileDeviceManagementUtil.getPlatformConfigPath(
|
String resourcePath = MobileDeviceManagementUtil.getPlatformConfigPath(
|
||||||
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Marshaller marshaller = context.createMarshaller();
|
Marshaller marshaller = context.createMarshaller();
|
||||||
marshaller.marshal(tenantConfiguration, writer);
|
marshaller.marshal(tenantConfiguration, writer);
|
||||||
|
|
||||||
@ -112,16 +112,16 @@ public class WindowsDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
Resource resource;
|
Resource resource;
|
||||||
try {
|
try {
|
||||||
String windowsTenantRegistryPath = MobileDeviceManagementUtil.
|
String windowsTenantRegistryPath = MobileDeviceManagementUtil.
|
||||||
getPlatformConfigPath(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
getPlatformConfigPath(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath);
|
resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath);
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||||
return (TenantConfiguration) unmarshaller.unmarshal(new StringReader(
|
return (PlatformConfiguration) unmarshaller.unmarshal(new StringReader(
|
||||||
new String((byte[]) resource.getContent(), Charset.
|
new String((byte[]) resource.getContent(), Charset.
|
||||||
forName(MobilePluginConstants.CHARSET_UTF8))));
|
forName(MobilePluginConstants.CHARSET_UTF8))));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService;
|
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService;
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
||||||
@ -165,7 +165,7 @@ public class WindowsAPIUtils {
|
|||||||
getDeviceManagementService().updateOperation(deviceIdentifier, operation);
|
getDeviceManagementService().updateOperation(deviceIdentifier, operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TenantConfiguration getTenantConfiguration() throws DeviceManagementException {
|
public static PlatformConfiguration getTenantConfiguration() throws DeviceManagementException {
|
||||||
return getDeviceManagementService().getConfiguration(
|
return getDeviceManagementService().getConfiguration(
|
||||||
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ package org.wso2.carbon.mdm.mobileservices.windows.services.configurationmgtserv
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.annotations.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.annotations.ApiResponses;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
|
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ public interface ConfigurationMgtService {
|
|||||||
@ApiResponse(code = 201, message = "Windows platform configuration saved successfully"),
|
@ApiResponse(code = 201, message = "Windows platform configuration saved successfully"),
|
||||||
@ApiResponse(code = 500, message = "Internal Server Error")
|
@ApiResponse(code = 500, message = "Internal Server Error")
|
||||||
})
|
})
|
||||||
Message ConfigureSettings(TenantConfiguration configuration) throws WindowsConfigurationException;
|
Message ConfigureSettings(PlatformConfiguration configuration) throws WindowsConfigurationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve Tenant configurations according to the device type.
|
* Retrieve Tenant configurations according to the device type.
|
||||||
@ -69,13 +69,13 @@ public interface ConfigurationMgtService {
|
|||||||
httpMethod = "GET",
|
httpMethod = "GET",
|
||||||
value = "Getting Windows Platform Configurations",
|
value = "Getting Windows Platform Configurations",
|
||||||
notes = "Get the Windows platform configuration details using this REST API",
|
notes = "Get the Windows platform configuration details using this REST API",
|
||||||
response = TenantConfiguration.class
|
response = PlatformConfiguration.class
|
||||||
)
|
)
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(code = 200, message = "Get Windows Configurations"),
|
@ApiResponse(code = 200, message = "Get Windows Configurations"),
|
||||||
@ApiResponse(code = 500, message = "Server Error")
|
@ApiResponse(code = 500, message = "Server Error")
|
||||||
})
|
})
|
||||||
TenantConfiguration getConfiguration() throws WindowsConfigurationException;
|
PlatformConfiguration getConfiguration() throws WindowsConfigurationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update Tenant Configurations for the specific Device type.
|
* Update Tenant Configurations for the specific Device type.
|
||||||
@ -97,5 +97,5 @@ public interface ConfigurationMgtService {
|
|||||||
@ApiResponse(code = 500, message = "Error occurred while modifying configuration settings of " +
|
@ApiResponse(code = 500, message = "Error occurred while modifying configuration settings of " +
|
||||||
"windows platform")
|
"windows platform")
|
||||||
})
|
})
|
||||||
Message updateConfiguration(TenantConfiguration configuration) throws WindowsConfigurationException;
|
Message updateConfiguration(PlatformConfiguration configuration) throws WindowsConfigurationException;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,8 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.PluginConstants;
|
import org.wso2.carbon.mdm.mobileservices.windows.common.PluginConstants;
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
||||||
@ -54,7 +55,7 @@ public class ConfigurationMgtServiceImpl {
|
|||||||
* @throws WindowsConfigurationException
|
* @throws WindowsConfigurationException
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
public Message ConfigureSettings(TenantConfiguration configuration) throws WindowsConfigurationException {
|
public Message ConfigureSettings(PlatformConfiguration configuration) throws WindowsConfigurationException {
|
||||||
Message responseMsg = new Message();
|
Message responseMsg = new Message();
|
||||||
ConfigurationEntry licenseEntry = null;
|
ConfigurationEntry licenseEntry = null;
|
||||||
String message;
|
String message;
|
||||||
@ -106,15 +107,15 @@ public class ConfigurationMgtServiceImpl {
|
|||||||
* @throws WindowsConfigurationException
|
* @throws WindowsConfigurationException
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
public TenantConfiguration getConfiguration() throws WindowsConfigurationException {
|
public PlatformConfiguration getConfiguration() throws WindowsConfigurationException {
|
||||||
String msg;
|
String msg;
|
||||||
TenantConfiguration tenantConfiguration = null;
|
PlatformConfiguration PlatformConfiguration = null;
|
||||||
try {
|
try {
|
||||||
if (WindowsAPIUtils.getDeviceManagementService().
|
if (WindowsAPIUtils.getDeviceManagementService().
|
||||||
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS) != null) {
|
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS) != null) {
|
||||||
tenantConfiguration = WindowsAPIUtils.getDeviceManagementService().
|
PlatformConfiguration = WindowsAPIUtils.getDeviceManagementService().
|
||||||
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
List<ConfigurationEntry> configs = tenantConfiguration.getConfiguration();
|
List<ConfigurationEntry> configs = PlatformConfiguration.getConfiguration();
|
||||||
ConfigurationEntry entry = new ConfigurationEntry();
|
ConfigurationEntry entry = new ConfigurationEntry();
|
||||||
License license = WindowsAPIUtils.getDeviceManagementService().getLicense(
|
License license = WindowsAPIUtils.getDeviceManagementService().getLicense(
|
||||||
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS, PluginConstants.
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS, PluginConstants.
|
||||||
@ -124,7 +125,7 @@ public class ConfigurationMgtServiceImpl {
|
|||||||
entry.setName(PluginConstants.TenantConfigProperties.LICENSE_KEY);
|
entry.setName(PluginConstants.TenantConfigProperties.LICENSE_KEY);
|
||||||
entry.setValue(license.getText());
|
entry.setValue(license.getText());
|
||||||
configs.add(entry);
|
configs.add(entry);
|
||||||
tenantConfiguration.setConfiguration(configs);
|
PlatformConfiguration.setConfiguration(configs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (DeviceManagementException e) {
|
} catch (DeviceManagementException e) {
|
||||||
@ -132,7 +133,7 @@ public class ConfigurationMgtServiceImpl {
|
|||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
throw new WindowsConfigurationException(msg, e);
|
throw new WindowsConfigurationException(msg, e);
|
||||||
}
|
}
|
||||||
return tenantConfiguration;
|
return PlatformConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,7 +144,7 @@ public class ConfigurationMgtServiceImpl {
|
|||||||
* @throws WindowsConfigurationException
|
* @throws WindowsConfigurationException
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
public Message updateConfiguration(TenantConfiguration configuration) throws WindowsConfigurationException {
|
public Message updateConfiguration(PlatformConfiguration configuration) throws WindowsConfigurationException {
|
||||||
String message;
|
String message;
|
||||||
Message responseMsg = new Message();
|
Message responseMsg = new Message();
|
||||||
ConfigurationEntry licenseEntry = null;
|
ConfigurationEntry licenseEntry = null;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService
|
|||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.PluginConstants;
|
import org.wso2.carbon.mdm.mobileservices.windows.common.PluginConstants;
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.beans.CacheEntry;
|
import org.wso2.carbon.mdm.mobileservices.windows.common.beans.CacheEntry;
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.CertificateGenerationException;
|
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.CertificateGenerationException;
|
||||||
@ -372,7 +372,7 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe
|
|||||||
*/
|
*/
|
||||||
private List<ConfigurationEntry> getTenantConfigurationData() throws DeviceManagementException {
|
private List<ConfigurationEntry> getTenantConfigurationData() throws DeviceManagementException {
|
||||||
if (WindowsAPIUtils.getTenantConfiguration() != null) {
|
if (WindowsAPIUtils.getTenantConfiguration() != null) {
|
||||||
TenantConfiguration configuration = WindowsAPIUtils.getTenantConfiguration();
|
PlatformConfiguration configuration = WindowsAPIUtils.getTenantConfiguration();
|
||||||
return configuration.getConfiguration();
|
return configuration.getConfiguration();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Licensed 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.
|
||||||
|
*/
|
||||||
|
.circle {
|
||||||
|
background: none repeat scroll 0 0 #191919;
|
||||||
|
border-radius: 50px;
|
||||||
|
height: 50px;
|
||||||
|
padding: 10px;
|
||||||
|
width: 50px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.padding-top-double {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
.padding-double {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.grey {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
display: block;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #7f7f7f;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
.light-grey {
|
||||||
|
color: #7c7c7c;
|
||||||
|
}
|
||||||
|
.uppercase {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.grey-bg {
|
||||||
|
background-color: #f6f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link {
|
||||||
|
background: #11375B;
|
||||||
|
padding: 20px;
|
||||||
|
color: white;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-link a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -16,7 +16,7 @@
|
|||||||
under the License.
|
under the License.
|
||||||
}}
|
}}
|
||||||
<div class="col-lg-12 margin-top-double">
|
<div class="col-lg-12 margin-top-double">
|
||||||
<h1 class="grey ">Windows Mobile</h1>
|
<h1 class="grey">Windows Mobile</h1>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 padding-top">
|
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 padding-top">
|
||||||
@ -24,28 +24,26 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
|
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
|
||||||
<h4 class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS100/Windows"
|
<h4 class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS100/Windows" target="_blank">[ here ]</a> for
|
||||||
target="_blank">[ here ]</a> for latest instructions and troubleshooting.</h4>
|
latest instructions and troubleshooting.</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
|
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
|
||||||
|
|
||||||
<h3 class="uppercase">What it Does</h3>
|
<h3 class="uppercase">What it Does</h3>
|
||||||
<hr>
|
<hr />
|
||||||
<p class="grey margin-top">Connect and manage your Windows device with WSO2 IoT Server.</p>
|
<p class="grey margin-top">Connect and manage your Windows device with WSO2 IoT Server.</p>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<h3 class="uppercase">What You Need</h3>
|
<h3 class="uppercase">What You Need</h3>
|
||||||
<hr>
|
<hr>
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li class="padding-top-double"><span class="circle">STEP 01</span> Windows
|
<li class="padding-top-double"><span class="circle">STEP 01</span> Windows Mobile.</li>
|
||||||
Mobile.
|
<li class="padding-top-double"><span class="circle">STEP 02</span> Go ahead and click [Enroll
|
||||||
|
Device].
|
||||||
</li>
|
</li>
|
||||||
<li class="padding-top-double"><span class="circle">STEP 02</span> Go ahead
|
<li class="padding-top-double"><span class="circle">STEP 03</span> Proceed to [Prepare]
|
||||||
and click [Enroll Device].
|
section.
|
||||||
</li>
|
|
||||||
<li class="padding-top-double"><span class="circle">STEP 03</span> Proceed
|
|
||||||
to [Prepare] section.
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
@ -53,7 +51,7 @@
|
|||||||
<a href="#" class="download-link btn-operations"><i class="fw fw-mobile fw-inverse fw-lg"></i>
|
<a href="#" class="download-link btn-operations"><i class="fw fw-mobile fw-inverse fw-lg"></i>
|
||||||
Enroll Device</a>
|
Enroll Device</a>
|
||||||
|
|
||||||
<br/><br/>
|
<br /><br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-12 padding-double grey-bg">
|
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-12 padding-double grey-bg">
|
||||||
@ -61,11 +59,8 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li class="padding-top-double"><span class="circle">01</span> Scan QR code.</li>
|
<li class="padding-top-double"><span class="circle">01</span> Scan QR code.</li>
|
||||||
<li class="padding-top-double"><span class="circle">02</span> Follow instructions in wizard.
|
<li class="padding-top-double"><span class="circle">02</span> Follow instructions in wizard.</li>
|
||||||
</li>
|
<li class="padding-top-double"><span class="circle">03</span> Configure your workspace account</li>
|
||||||
<li class="padding-top-double"><span class="circle">03</span> Configure your workspace
|
|
||||||
account
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -80,12 +75,12 @@
|
|||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br/>
|
<br />
|
||||||
|
|
||||||
<div id="qr-code-modal"
|
<div id="qr-code-modal"
|
||||||
data-enrollment-url="{{@app.context}}/device/windows/enroll" class="hidden">
|
data-enrollment-url="{{@app.context}}/device/windows/enroll" class="hidden">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
<div class="col-lg-5 col-md-6 col-centered">
|
||||||
<h3>Scan QR code to start enrollment</h3>
|
<h3>Scan QR code to start enrollment</h3>
|
||||||
@ -100,60 +95,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#zone "topCss"}}
|
|
||||||
<style type="text/css">
|
|
||||||
.circle {
|
|
||||||
background: none repeat scroll 0 0 #191919;
|
|
||||||
border-radius: 50px;
|
|
||||||
height: 50px;
|
|
||||||
padding: 10px;
|
|
||||||
width: 50px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.padding-top-double {
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
.padding-double {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
.grey {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
hr {
|
|
||||||
display: block;
|
|
||||||
height: 1px;
|
|
||||||
border: 0;
|
|
||||||
border-top: 1px solid #7f7f7f;
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
.light-grey {
|
|
||||||
color: #7c7c7c;
|
|
||||||
}
|
|
||||||
.uppercase {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
.grey-bg {
|
|
||||||
background-color: #f6f4f4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link {
|
|
||||||
background: #11375B;
|
|
||||||
padding: 20px;
|
|
||||||
color: white;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.doc-link a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
{{/zone}}
|
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(".download-link").click(function () {
|
$(".download-link").click(function () {
|
||||||
toggleEnrollment();
|
toggleEnrollment();
|
||||||
});
|
});
|
||||||
@ -163,6 +106,9 @@
|
|||||||
generateQRCode(".modalpopup-content .qr-code");
|
generateQRCode(".modalpopup-content .qr-code");
|
||||||
showPopup();
|
showPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|
||||||
|
{{#zone "topCss"}}
|
||||||
|
{{css "css/styles.css"}}
|
||||||
|
{{/zone}}
|
||||||
@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.device.mgt.common.*;
|
import org.wso2.carbon.device.mgt.common.*;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
||||||
@ -79,7 +79,7 @@ public class WindowsDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
|
public boolean saveConfiguration(PlatformConfiguration tenantConfiguration)
|
||||||
throws DeviceManagementException {
|
throws DeviceManagementException {
|
||||||
boolean status;
|
boolean status;
|
||||||
Resource resource;
|
Resource resource;
|
||||||
@ -91,7 +91,7 @@ public class WindowsDeviceManager implements DeviceManager {
|
|||||||
DeviceManagementConstants.
|
DeviceManagementConstants.
|
||||||
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Marshaller marshaller = context.createMarshaller();
|
Marshaller marshaller = context.createMarshaller();
|
||||||
marshaller.marshal(tenantConfiguration, writer);
|
marshaller.marshal(tenantConfiguration, writer);
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ public class WindowsDeviceManager implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TenantConfiguration getConfiguration() throws DeviceManagementException {
|
public PlatformConfiguration getConfiguration() throws DeviceManagementException {
|
||||||
Resource resource;
|
Resource resource;
|
||||||
try {
|
try {
|
||||||
String windowsTenantRegistryPath =
|
String windowsTenantRegistryPath =
|
||||||
@ -122,9 +122,9 @@ public class WindowsDeviceManager implements DeviceManager {
|
|||||||
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath);
|
resource = MobileDeviceManagementUtil.getRegistryResource(windowsTenantRegistryPath);
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
JAXBContext context = JAXBContext.newInstance(TenantConfiguration.class);
|
JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class);
|
||||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||||
return (TenantConfiguration) unmarshaller.unmarshal(
|
return (PlatformConfiguration) unmarshaller.unmarshal(
|
||||||
new StringReader(new String((byte[]) resource.getContent(), Charset.
|
new StringReader(new String((byte[]) resource.getContent(), Charset.
|
||||||
forName(MobilePluginConstants.CHARSET_UTF8))));
|
forName(MobilePluginConstants.CHARSET_UTF8))));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `ANDROID_DEVICE`
|
-- Table `ANDROID_DEVICE`
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS ANDROID_SENSE_DEVICE (
|
CREATE TABLE ANDROID_SENSE_DEVICE (
|
||||||
ANDROID_DEVICE_ID VARCHAR(45) NOT NULL ,
|
ANDROID_DEVICE_ID VARCHAR(45) NOT NULL ,
|
||||||
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (ANDROID_DEVICE_ID) );
|
PRIMARY KEY (ANDROID_DEVICE_ID) );
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table for `ARDUINO_DEVICE`
|
-- Table for `ARDUINO_DEVICE`
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS ARDUINO_DEVICE (
|
CREATE TABLE ARDUINO_DEVICE (
|
||||||
ARDUINO_DEVICE_ID VARCHAR(45) NOT NULL ,
|
ARDUINO_DEVICE_ID VARCHAR(45) NOT NULL ,
|
||||||
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (ARDUINO_DEVICE_ID) );
|
PRIMARY KEY (ARDUINO_DEVICE_ID) );
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `RASPBERRYPI_DEVICE`
|
-- Table `RASPBERRYPI_DEVICE`
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS RASPBERRYPI_DEVICE (
|
CREATE TABLE RASPBERRYPI_DEVICE (
|
||||||
RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL ,
|
RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL ,
|
||||||
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (RASPBERRYPI_DEVICE_ID) );
|
PRIMARY KEY (RASPBERRYPI_DEVICE_ID) );
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
-- Table `FIREALARM_DEVICE`
|
-- Table `FIREALARM_DEVICE`
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS VIRTUAL_FIREALARM_DEVICE (
|
CREATE TABLE VIRTUAL_FIREALARM_DEVICE (
|
||||||
VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL ,
|
VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL ,
|
||||||
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) );
|
PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) );
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
instructions.configure = \
|
instructions.configure = \
|
||||||
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\
|
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/webapps/mdm-android-agent.war,target:${installFolder}/../../deployment/server/webapps/mdm-android-agent.war,overwrite:true);\
|
||||||
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\
|
|
||||||
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
|
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
|
||||||
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/conf/mobile-config.xml,target:${installFolder}/../../conf/mobile-config.xml,overwrite:true);\
|
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/conf/mobile-config.xml,target:${installFolder}/../../conf/mobile-config.xml,overwrite:true);\
|
||||||
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/android,overwrite:true);\
|
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/android,overwrite:true);\
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user