charitha 8 years ago
commit c0feb96590

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>2.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>2.2.2-SNAPSHOT</version>
<artifactId>org.wso2.carbon.appmgt.mdm.osgiconnector</artifactId>
<packaging>bundle</packaging>
<name>WSO2 Carbon - App Manager WSO2 MDM OSGI Connector Component</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>org.wso2.carbon.appmgt.mdm.osgiconnector.internal</Private-Package>
<Import-Package>
org.wso2.carbon.device.mgt.core.*,
org.wso2.carbon.appmgt.mobile.utils.*,
org.wso2.carbon.appmgt.mobile.mdm.*,
org.wso2.carbon.appmgt.mobile.interfaces.*,
*;resolution:=optional
</Import-Package>
<Export-Package>
!org.wso2.carbon.appmgt.mdm.osgiconnector.internal,
org.wso2.carbon.appmgt.mdm.osgiconnector.*
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.wso2.carbon.appmgt</groupId>
<artifactId>org.wso2.carbon.appmgt.mobile</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io.wso2</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple.wso2</groupId>
<artifactId>json-simple</artifactId>
</dependency>
<dependency>
<groupId>com.googlecode.plist</groupId>
<artifactId>dd-plist</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,296 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.MobileApp;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.MobileAppTypes;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util.AndroidApplicationOperationUtil;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util.IOSApplicationOperationUtil;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util.MDMAppConstants;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util.MDMServiceAPIUtils;
import org.wso2.carbon.appmgt.mobile.beans.ApplicationOperationAction;
import org.wso2.carbon.appmgt.mobile.beans.ApplicationOperationDevice;
import org.wso2.carbon.appmgt.mobile.interfaces.ApplicationOperations;
import org.wso2.carbon.appmgt.mobile.mdm.App;
import org.wso2.carbon.appmgt.mobile.mdm.Device;
import org.wso2.carbon.appmgt.mobile.utils.MobileApplicationException;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.Platform;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
public class ApplicationOperationsImpl implements ApplicationOperations {
private static final Log log = LogFactory.getLog(ApplicationOperationsImpl.class);
/**
* @param applicationOperationAction holds the information needs to perform an action on mdm.
* @throws MobileApplicationException
*/
public String performAction(ApplicationOperationAction applicationOperationAction)
throws MobileApplicationException {
if (log.isDebugEnabled()) {
log.debug(applicationOperationAction.getAction() + " action is triggered for " +
applicationOperationAction.getType() +".");
}
Operation operation = null;
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
List<org.wso2.carbon.device.mgt.common.Device> deviceList;
if (MDMAppConstants.USER.equals(applicationOperationAction.getType())) {
String userName = null;
try {
for (String param : applicationOperationAction.getParams()) {
userName = param;
deviceList = MDMServiceAPIUtils
.getDeviceManagementService(applicationOperationAction.getTenantId()).
getDevicesOfUser(userName);
for (org.wso2.carbon.device.mgt.common.Device device : deviceList) {
if(applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())){
deviceIdentifiers.add(getDeviceIdentifierByDevice(device));
}
}
}
} catch (DeviceManagementException devEx) {
String errorMsg = "Error occurred fetch device for user " + userName +
" at app installation";
logError(errorMsg, devEx);
throw new MobileApplicationException(errorMsg, devEx);
}
} else if (MDMAppConstants.ROLE.equals(applicationOperationAction.getType())) {
String userRole = null;
try {
for (String param : applicationOperationAction.getParams()) {
userRole = param;
deviceList = MDMServiceAPIUtils
.getDeviceManagementService(applicationOperationAction.getTenantId()).
getAllDevicesOfRole(userRole);
for (org.wso2.carbon.device.mgt.common.Device device : deviceList) {
deviceIdentifiers.add(getDeviceIdentifierByDevice(device));
}
}
} catch (DeviceManagementException devMgtEx) {
String errorMsg = "Error occurred fetch device for user role " + userRole +
" at app installation";
logError(errorMsg, devMgtEx);
throw new MobileApplicationException(errorMsg, devMgtEx);
}
} else if (MDMAppConstants.DEVICE.equals(applicationOperationAction.getType())) {
DeviceIdentifier deviceIdentifier;
for (String param : applicationOperationAction.getParams()) {
deviceIdentifier = new DeviceIdentifier();
if (isValidJSON(param)) {
JSONParser parser = new JSONParser();
try {
JSONObject parsedObj = (JSONObject) parser.parse(param);
deviceIdentifier.setId((String) parsedObj.get(MDMAppConstants.ID));
deviceIdentifier.setType((String) parsedObj.get(MDMAppConstants.TYPE));
deviceIdentifiers.add(deviceIdentifier);
} catch (ParseException e) {
logError("Device Identifier is not valid json object.", e);
throw new MobileApplicationException(e);
}
}
}
} else {
throw new IllegalStateException("invalid type is received from app store.");
}
App app = applicationOperationAction.getApp();
MobileApp mobileApp = new MobileApp();
mobileApp.setId(app.getId());
mobileApp.setType(MobileAppTypes.valueOf(app.getType().toUpperCase()));
mobileApp.setAppIdentifier(app.getAppIdentifier());
mobileApp.setIconImage(app.getIconImage());
mobileApp.setIdentifier(app.getIdentifier());
mobileApp.setLocation(app.getLocation());
mobileApp.setName(app.getName());
mobileApp.setPackageName(app.getPackageName());
mobileApp.setPlatform(app.getPlatform());
mobileApp.setVersion(app.getVersion());
Properties properties = new Properties();
if (MDMAppConstants.IOS.equals(app.getPlatform())) {
if (MDMAppConstants.ENTERPRISE.equals(app.getType())) {
properties.put(MDMAppConstants.IOSConstants.IS_REMOVE_APP, true);
properties.put(MDMAppConstants.IOSConstants.IS_PREVENT_BACKUP, true);
} else if (MDMAppConstants.IOSConstants.PUBLIC.equals(app.getType())) {
properties.put(MDMAppConstants.IOSConstants.I_TUNES_ID, app.getIdentifier());
properties.put(MDMAppConstants.IOSConstants.IS_REMOVE_APP, true);
properties.put(MDMAppConstants.IOSConstants.IS_PREVENT_BACKUP, true);
} else if (MDMAppConstants.WEBAPP.equals(app.getType())) {
properties.put(MDMAppConstants.IOSConstants.LABEL, app.getName());
properties.put(MDMAppConstants.IOSConstants.IS_REMOVE_APP, true);
}
} else if (MDMAppConstants.WEBAPP.equals(app.getPlatform())) {
properties.put(MDMAppConstants.IOSConstants.LABEL, app.getName());
properties.put(MDMAppConstants.IOSConstants.IS_REMOVE_APP, true);
}
mobileApp.setProperties(properties);
Activity activity = null;
try {
if (deviceIdentifiers.size() > 0) {
if (deviceIdentifiers.get(0).getType().equalsIgnoreCase(Platform.ANDROID.toString())) {
if (MDMAppConstants.INSTALL.equals(applicationOperationAction.getAction())) {
operation = AndroidApplicationOperationUtil
.createInstallAppOperation(mobileApp, applicationOperationAction.getSchedule());
} else if (MDMAppConstants.UPDATE.equals(applicationOperationAction.getAction())) {
operation = AndroidApplicationOperationUtil
.createUpdateAppOperation(mobileApp, applicationOperationAction.getSchedule());
} else {
operation = AndroidApplicationOperationUtil
.createAppUninstallOperation(mobileApp, applicationOperationAction.getSchedule());
}
} else if (deviceIdentifiers.get(0).getType().equalsIgnoreCase(Platform.IOS.toString())) {
if (MDMAppConstants.INSTALL.equals(applicationOperationAction.getAction())) {
operation =
IOSApplicationOperationUtil.createInstallAppOperation(mobileApp);
} else {
operation =
IOSApplicationOperationUtil.createAppUninstallOperation(mobileApp);
}
}
activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId())
.installApplicationForDevices(operation, deviceIdentifiers);
}
if(activity != null){
return activity.getActivityId();
}
return null;
} catch (DeviceApplicationException mdmExce) {
logError("Error in creating operation object using app.", mdmExce);
throw new MobileApplicationException(mdmExce.getMessage());
} catch (ApplicationManagementException appMgtExce) {
logError("Error in app installation.", appMgtExce);
throw new MobileApplicationException(appMgtExce.getErrorMessage());
}
}
/**
* Create a new device identifier from Device object.
* @param device device which is to be retrieved type and id
* @return created device identifier
*/
private static DeviceIdentifier getDeviceIdentifierByDevice(
org.wso2.carbon.device.mgt.common.Device device) {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(device.getDeviceIdentifier());
deviceIdentifier.setType(device.getType());
return deviceIdentifier;
}
/**
* @param applicationOperationDevice holds the information needs to retrieve device list.
* @return List of devices
* @throws MobileApplicationException
*/
public List<Device> getDevices(ApplicationOperationDevice applicationOperationDevice)
throws MobileApplicationException {
List<Device> devices;
try {
List<org.wso2.carbon.device.mgt.common.Device> deviceList = MDMServiceAPIUtils
.getDeviceManagementService(applicationOperationDevice.getTenantId()).
getDevicesOfUser(
applicationOperationDevice.getCurrentUser().getUsername());
devices = new ArrayList<>(deviceList.size());
if(log.isDebugEnabled()){
log.debug("device list got from mdm "+ deviceList.toString());
}
for (org.wso2.carbon.device.mgt.common.Device commonDevice : deviceList) {
if (MDMAppConstants.ACTIVE
.equals(commonDevice.getEnrolmentInfo().getStatus().toString().
toLowerCase())) {
Device device = new Device();
org.wso2.carbon.appmgt.mobile.beans.DeviceIdentifier deviceIdentifier =
new org.wso2.carbon.appmgt.mobile.beans.DeviceIdentifier();
deviceIdentifier.setId(commonDevice.getDeviceIdentifier());
deviceIdentifier.setType(commonDevice.getType());
device.setDeviceIdentifier(deviceIdentifier);
device.setName(commonDevice.getName());
device.setModel(commonDevice.getName());
device.setType(MDMAppConstants.MOBILE_DEVICE);
String imgUrl;
if (MDMAppConstants.ANDROID.equalsIgnoreCase(commonDevice.getType())) {
imgUrl = String.format(applicationOperationDevice.getConfigParams()
.get(MDMAppConstants.IMAGE_URL),
MDMAppConstants.NEXUS);
} else if (MDMAppConstants.IOS.equalsIgnoreCase(commonDevice.getType())) {
imgUrl = String.format(applicationOperationDevice.getConfigParams()
.get(MDMAppConstants.IMAGE_URL),
MDMAppConstants.IPHONE);
} else {
imgUrl = String.format(applicationOperationDevice.getConfigParams()
.get(MDMAppConstants.IMAGE_URL),
MDMAppConstants.NONE);
}
device.setImage(imgUrl);
device.setPlatform(commonDevice.getType());
devices.add(device);
}
}
} catch (DeviceManagementException e) {
logError("Error While retrieving Device List.", e);
throw new MobileApplicationException(e.getMessage());
}
return devices;
}
private boolean isValidJSON(String json) {
JSONParser parser = new JSONParser();
try {
parser.parse(json);
} catch (ParseException e) {
return false;
}
return true;
}
private void logError(String errorMessage, Throwable e) {
if (log.isDebugEnabled()) {
log.error(errorMessage, e);
} else {
log.error(errorMessage);
}
}
}

@ -0,0 +1,60 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.internal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.appmgt.mdm.osgiconnector.ApplicationOperationsImpl;
import org.wso2.carbon.appmgt.mobile.interfaces.ApplicationOperations;
/**
* @scr.component name="org.wso2.carbon.appmgt.mdm.osgiconnector" immediate="true"
*/
public class DeviceApplicationServiceComponent {
private static final Log log = LogFactory.getLog(DeviceApplicationServiceComponent.class);
private ServiceRegistration mdmServiceRegistration;
protected void activate(ComponentContext context) {
BundleContext bundleContext = context.getBundleContext();
mdmServiceRegistration = bundleContext
.registerService(ApplicationOperations.class.getName(), new ApplicationOperationsImpl(), null);
if (log.isDebugEnabled()) {
log.debug("Device Application Service Component activated.");
}
}
protected void deactivate(ComponentContext context) {
if (mdmServiceRegistration != null) {
mdmServiceRegistration.unregister();
mdmServiceRegistration = null;
}
if (log.isDebugEnabled()) {
log.debug("Device Application Service Component deactivated.");
}
}
}

@ -0,0 +1,126 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans;
import java.util.Properties;
/**
* This class represents the generic mobile Application information
* which is used by AppM.
*/
public class MobileApp {
private String id;
private String name;
private MobileAppTypes type;
private String platform;
private String version;
private String identifier;
private String iconImage;
private String packageName;
private String appIdentifier;
private String location;
private Properties properties;
public MobileAppTypes getType() {
return type;
}
public void setType(MobileAppTypes type) {
this.type = type;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPlatform() {
return platform;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getIconImage() {
return iconImage;
}
public void setIconImage(String iconImage) {
this.iconImage = iconImage;
}
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
public String getAppIdentifier() {
return appIdentifier;
}
public void setAppIdentifier(String appIdentifier) {
this.appIdentifier = appIdentifier;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Properties getProperties() {
return properties;
}
public void setProperties(Properties properties) {
this.properties = properties;
}
}

@ -0,0 +1,21 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans;
public enum MobileAppTypes {
ENTERPRISE, WEBAPP, PUBLIC
}

@ -0,0 +1,46 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.android;
import com.google.gson.Gson;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
public class AndroidApplication {
private String type;
private String appIdentifier;
public String getAppIdentifier() {
return appIdentifier;
}
public void setAppIdentifier(String appIdentifier) {
this.appIdentifier = appIdentifier;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String toJSON() throws DeviceApplicationException {
Gson gson = new Gson();
return gson.toJson(this);
}
}

@ -0,0 +1,28 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.android;
import com.google.gson.Gson;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
import java.io.Serializable;
/**
* This class represents the Appstore Application information.
*/
public class AppStoreApplication extends AndroidApplication implements Serializable {
}

@ -0,0 +1,55 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.android;
import com.google.gson.Gson;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
import java.io.Serializable;
/**
* This class represents the Enterprise Application information.
*/
public class EnterpriseApplication extends AndroidApplication implements Serializable {
private String url;
private String schedule;
private String packageName;
public String getSchedule() {
return schedule;
}
public void setSchedule(String schedule) {
this.schedule = schedule;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
}

@ -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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.android;
import com.google.gson.Gson;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
import java.io.Serializable;
/**
* This class represents the Web Application information.
*/
public class WebApplication implements Serializable {
private String name;
private String url;
private String type;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String toJSON() throws DeviceApplicationException {
Gson gson = new Gson();
return gson.toJson(this);
}
}

@ -0,0 +1,34 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios;
import java.io.Serializable;
public class AppStoreApplication extends IOSApplication implements Serializable {
private int iTunesStoreID;
public int getiTunesStoreID() {
return iTunesStoreID;
}
public void setiTunesStoreID(int iTunesStoreID) {
this.iTunesStoreID = iTunesStoreID;
}
}

@ -0,0 +1,35 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios;
import java.io.Serializable;
public class EnterpriseApplication extends IOSApplication implements Serializable {
private String manifestURL;
public String getManifestURL() {
return manifestURL;
}
public void setManifestURL(String manifestURL) {
this.manifestURL = manifestURL;
}
}

@ -0,0 +1,74 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios;
import com.google.gson.Gson;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
public class IOSApplication {
private String identifier;
private boolean removeAppUponMDMProfileRemoval;
private boolean preventBackupOfAppData;
private String bundleId;
private String UUID;
public String getUUID() {
return UUID;
}
public void setUUID(String UUID) {
this.UUID = UUID;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public boolean isRemoveAppUponMDMProfileRemoval() {
return removeAppUponMDMProfileRemoval;
}
public void setRemoveAppUponMDMProfileRemoval(boolean removeAppUponMDMProfileRemoval) {
this.removeAppUponMDMProfileRemoval = removeAppUponMDMProfileRemoval;
}
public boolean isPreventBackupOfAppData() {
return preventBackupOfAppData;
}
public void setPreventBackupOfAppData(boolean preventBackupOfAppData) {
this.preventBackupOfAppData = preventBackupOfAppData;
}
public String getBundleId() {
return bundleId;
}
public void setBundleId(String bundleId) {
this.bundleId = bundleId;
}
public String toJSON() throws DeviceApplicationException {
Gson gson = new Gson();
return gson.toJson(this);
}
}

@ -0,0 +1,40 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios;
import com.google.gson.Gson;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
import java.io.Serializable;
public class RemoveApplication implements Serializable {
private String bundleId;
public String getBundleId() {
return bundleId;
}
public void setBundleId(String bundleId) {
this.bundleId = bundleId;
}
public String toJSON() throws DeviceApplicationException {
Gson gson = new Gson();
return gson.toJson(this);
}
}

@ -0,0 +1,75 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios;
import com.google.gson.Gson;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
public class WebClip {
private String URL;
private String label;
private String icon;
private String isRemovable;
private String UUID;
public String getUUID() {
return UUID;
}
public void setUUID(String UUID) {
this.UUID = UUID;
}
public String getURL() {
return URL;
}
public void setURL(String URL) {
this.URL = URL;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getIsRemovable() {
return isRemovable;
}
public void setIsRemovable(String isRemovable) {
this.isRemovable = isRemovable;
}
public String toJSON() throws DeviceApplicationException {
Gson gson = new Gson();
return gson.toJson(this);
}
}

@ -0,0 +1,50 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common;
public class DeviceApplicationException extends Exception {
private static final long serialVersionUID = 5136875495185597926L;
private String errorMessage;
public DeviceApplicationException(String msg, Exception e) {
super(msg, e);
setErrorMessage(msg);
}
public DeviceApplicationException(String msg, Throwable cause) {
super(msg, cause);
setErrorMessage(msg);
}
public DeviceApplicationException(String msg) {
super(msg);
setErrorMessage(msg);
}
public DeviceApplicationException() {
super();
}
public DeviceApplicationException(Throwable cause) {
super(cause);
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}

@ -0,0 +1,152 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.MobileApp;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.android.AppStoreApplication;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.android.EnterpriseApplication;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.android.WebApplication;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation;
/**
* This class contains the all the operations related to Android.
*/
public class AndroidApplicationOperationUtil {
/**
* Create Install Application operation.
*
* @param application MobileApp application
* @return operation
* @throws DeviceApplicationException
*/
public static Operation createInstallAppOperation(MobileApp application, String schedule) throws
DeviceApplicationException {
ProfileOperation operation = new ProfileOperation();
operation.setCode(MDMAppConstants.AndroidConstants.OPCODE_INSTALL_APPLICATION);
operation.setType(Operation.Type.PROFILE);
switch (application.getType()) {
case ENTERPRISE:
EnterpriseApplication enterpriseApplication = new EnterpriseApplication();
enterpriseApplication.setType(application.getType().toString());
enterpriseApplication.setUrl(application.getLocation());
enterpriseApplication.setSchedule(schedule);
enterpriseApplication.setPackageName(application.getPackageName());
operation.setPayLoad(enterpriseApplication.toJSON());
break;
case PUBLIC:
setOperationForPublicApp(operation, application);
break;
case WEBAPP:
setOperationForWebApp(operation, application);
break;
default:
String errorMessage = "Invalid application type.";
throw new DeviceApplicationException(errorMessage);
}
return operation;
}
/**
* Create Update Application operation.
*
* @param application MobileApp application
* @return operation
* @throws DeviceApplicationException
*/
public static Operation createUpdateAppOperation(MobileApp application, String schedule) throws
DeviceApplicationException {
ProfileOperation operation = new ProfileOperation();
operation.setCode(MDMAppConstants.AndroidConstants.OPCODE_UPDATE_APPLICATION);
operation.setType(Operation.Type.PROFILE);
switch (application.getType()) {
case ENTERPRISE:
EnterpriseApplication enterpriseApplication = new EnterpriseApplication();
enterpriseApplication.setType(application.getType().toString());
enterpriseApplication.setUrl(application.getLocation());
enterpriseApplication.setSchedule(schedule);
operation.setPayLoad(enterpriseApplication.toJSON());
break;
case PUBLIC:
setOperationForPublicApp(operation, application);
break;
case WEBAPP:
setOperationForWebApp(operation, application);
break;
default:
String errorMessage = "Invalid application type.";
throw new DeviceApplicationException(errorMessage);
}
return operation;
}
/**
* Create Uninstall Application operation.
*
* @param application MobileApp application
* @return operation
* @throws DeviceApplicationException
*/
public static Operation createAppUninstallOperation(MobileApp application, String schedule) throws
DeviceApplicationException {
ProfileOperation operation = new ProfileOperation();
operation.setCode(MDMAppConstants.AndroidConstants.OPCODE_UNINSTALL_APPLICATION);
operation.setType(Operation.Type.PROFILE);
switch (application.getType()) {
case ENTERPRISE:
EnterpriseApplication enterpriseApplication = new EnterpriseApplication();
enterpriseApplication.setType(application.getType().toString());
enterpriseApplication.setAppIdentifier(application.getIdentifier());
enterpriseApplication.setSchedule(schedule);
operation.setPayLoad(enterpriseApplication.toJSON());
break;
case PUBLIC:
setOperationForPublicApp(operation, application);
break;
case WEBAPP:
setOperationForWebApp(operation, application);
break;
default:
String errorMessage = "Invalid application type.";
throw new DeviceApplicationException(errorMessage);
}
return operation;
}
private static void setOperationForPublicApp(Operation operation, MobileApp application)
throws DeviceApplicationException {
AppStoreApplication appStoreApplication = new AppStoreApplication();
appStoreApplication.setType(application.getType().toString());
appStoreApplication.setAppIdentifier(application.getIdentifier());
operation.setPayLoad(appStoreApplication.toJSON());
}
private static void setOperationForWebApp(Operation operation, MobileApp application)
throws DeviceApplicationException {
WebApplication webApplication = new WebApplication();
webApplication.setUrl(application.getLocation());
webApplication.setName(application.getName());
webApplication.setType(application.getType().toString());
operation.setPayLoad(webApplication.toJSON());
}
}

@ -0,0 +1,114 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.MobileApp;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios.AppStoreApplication;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios.WebClip;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios.EnterpriseApplication;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.ios.RemoveApplication;
import java.util.Properties;
/**
* This class contains the all the operations related to IOS.
*/
public class IOSApplicationOperationUtil {
/**
* Create Install Application operation.
*
* @param application MobileApp application
* @return operation
* @throws DeviceApplicationException
*/
public static Operation createInstallAppOperation(MobileApp application) throws
DeviceApplicationException {
ProfileOperation operation = new ProfileOperation();
switch (application.getType()) {
case ENTERPRISE:
EnterpriseApplication enterpriseApplication = new EnterpriseApplication();
enterpriseApplication.setBundleId(application.getId());
enterpriseApplication.setIdentifier(application.getIdentifier());
enterpriseApplication.setManifestURL(application.getLocation());
Properties properties = application.getProperties();
enterpriseApplication.setPreventBackupOfAppData(
(Boolean) properties.get(MDMAppConstants.IOSConstants.IS_PREVENT_BACKUP));
enterpriseApplication.setRemoveAppUponMDMProfileRemoval(
(Boolean) properties.get(MDMAppConstants.IOSConstants.IS_REMOVE_APP));
operation.setCode(
MDMAppConstants.IOSConstants.OPCODE_INSTALL_ENTERPRISE_APPLICATION);
operation.setPayLoad(enterpriseApplication.toJSON());
operation.setType(Operation.Type.COMMAND);
break;
case PUBLIC:
AppStoreApplication appStoreApplication = new AppStoreApplication();
appStoreApplication.setRemoveAppUponMDMProfileRemoval(
(Boolean) application.getProperties()
.get(MDMAppConstants.IOSConstants.IS_REMOVE_APP));
appStoreApplication.setIdentifier(application.getIdentifier());
appStoreApplication.setPreventBackupOfAppData((Boolean) application.getProperties().
get(MDMAppConstants.IOSConstants.IS_PREVENT_BACKUP));
appStoreApplication.setBundleId(application.getId());
appStoreApplication.setiTunesStoreID((Integer) application.getProperties().
get(MDMAppConstants.IOSConstants.I_TUNES_ID));
operation.setCode(MDMAppConstants.IOSConstants.OPCODE_INSTALL_STORE_APPLICATION);
operation.setType(Operation.Type.COMMAND);
operation.setPayLoad(appStoreApplication.toJSON());
break;
case WEBAPP:
WebClip webClip = new WebClip();
webClip.setIcon(application.getIconImage());
webClip.setIsRemovable(application.getProperties().
getProperty(MDMAppConstants.IOSConstants.IS_REMOVE_APP));
webClip.setLabel(application.getProperties().
getProperty(MDMAppConstants.IOSConstants.LABEL));
webClip.setURL(application.getLocation());
operation.setCode(MDMAppConstants.IOSConstants.OPCODE_INSTALL_WEB_APPLICATION);
operation.setType(Operation.Type.PROFILE);
operation.setPayLoad(webClip.toJSON());
break;
default:
String errorMessage = "Invalid application type.";
throw new DeviceApplicationException(errorMessage);
}
return operation;
}
/**
* Create uninstall operations.
*
* @param application
* @return Uninstall operation
* @throws DeviceApplicationException
*/
public static Operation createAppUninstallOperation(MobileApp application) throws
DeviceApplicationException {
ProfileOperation operation = new ProfileOperation();
operation.setCode(MDMAppConstants.IOSConstants.OPCODE_REMOVE_APPLICATION);
operation.setType(Operation.Type.PROFILE);
RemoveApplication removeApplication = new RemoveApplication();
removeApplication.setBundleId(application.getIdentifier());
operation.setPayLoad(removeApplication.toJSON());
return operation;
}
}

@ -0,0 +1,82 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util;
/**
* This class holds all the constants used for IOS and Android.
*/
public class MDMAppConstants {
public static final String USER = "user";
public static final String ROLE = "role";
public static final String IOS = "ios";
public static final String ANDROID = "android";
public static final String WEBAPP = "webapp";
public static final String INSTALL = "install";
public static final String UPDATE = "update";
public static final String ACTIVE = "active";
public static final String ENTERPRISE = "enterprise";
public static final String DEVICE = "device";
public static final String MOBILE_DEVICE = "mobileDevice";
public static final String NEXUS = "nexus";
public static final String IPHONE = "iphone";
public static final String NONE = "none";
public static final String IMAGE_URL = "ImageURL";
public static final String TYPE = "type";
public static final String ID = "id";
public class IOSConstants {
private IOSConstants() {
throw new AssertionError();
}
public static final String IS_REMOVE_APP = "isRemoveApp";
public static final String IS_PREVENT_BACKUP = "isPreventBackup";
public static final String I_TUNES_ID = "iTunesId";
public static final String LABEL = "label";
public static final String PUBLIC = "public";
public static final String OPCODE_INSTALL_ENTERPRISE_APPLICATION =
"INSTALL_ENTERPRISE_APPLICATION";
public static final String OPCODE_INSTALL_STORE_APPLICATION = "INSTALL_STORE_APPLICATION";
public static final String OPCODE_INSTALL_WEB_APPLICATION = "WEB_CLIP";
public static final String OPCODE_REMOVE_APPLICATION = "REMOVE_APPLICATION";
}
public class AndroidConstants {
private AndroidConstants() {
throw new AssertionError();
}
public static final String OPCODE_INSTALL_APPLICATION = "INSTALL_APPLICATION";
public static final String OPCODE_UPDATE_APPLICATION = "UPDATE_APPLICATION";
public static final String OPCODE_UNINSTALL_APPLICATION = "UNINSTALL_APPLICATION";
}
public class RegistryConstants {
private RegistryConstants() {
throw new AssertionError();
}
public static final String GENERAL_CONFIG_RESOURCE_PATH = "general";
}
public class APPManagerConstants {
private static final String APP_MANAGER_MDM_SERVICE_NAME =
"org.wso2.carbon.appmgt.mobile.interfaces.MDMOperations";
}
}

@ -0,0 +1,74 @@
/*
* 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.
*/
package org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
/**
* MDMServiceAPIUtils class provides utility function.
*/
public class MDMServiceAPIUtils {
private static Log log = LogFactory.getLog(MDMServiceAPIUtils.class);
/**
* Returns the DeviceManagementProviderService osgi service.
*
* @param tenantId tenant id
* @return DeviceManagementProviderService
*/
public static DeviceManagementProviderService getDeviceManagementService(int tenantId) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
ctx.setTenantId(tenantId, true);
DeviceManagementProviderService deviceManagementProviderService =
(DeviceManagementProviderService) ctx
.getOSGiService(DeviceManagementProviderService.class, null);
if (deviceManagementProviderService == null) {
String msg = "Device Management provider service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return deviceManagementProviderService;
}
/**
* Returns the ApplicationManagementProviderService osgi service.
*
* @param tenantId tenant id
* @return ApplicationManagementProviderService
*/
public static ApplicationManagementProviderService getAppManagementService(int tenantId) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
ctx.setTenantId(tenantId, true);
ApplicationManagementProviderService applicationManagementProviderService =
(ApplicationManagementProviderService) ctx.
getOSGiService(
ApplicationManagementProviderService.class,
null);
if (applicationManagementProviderService == null) {
String msg = "Application management service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return applicationManagementProviderService;
}
}

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>2.2.2-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extensions</artifactId>
<packaging>pom</packaging>
<name>WSO2 Carbon - Mobile Plugins Extensions</name>
<url>http://wso2.org</url>
<modules>
<module>org.wso2.carbon.appmgt.mdm.osgiconnector</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

@ -107,10 +107,13 @@
<div id="operation-bar"> <div id="operation-bar">
{{unit "mdm.unit.device.operation-bar"}} {{unit "mdm.unit.device.operation-bar"}}
</div> </div>
<div id="operation-guide" class="bs-callout bs-callout-info"> <div id="operation-guide" class="message message-info">
<h4>Enabling Device Operations</h4> <h4 class="remove-margin">
<i class="icon fw fw-info"></i>
Enabling Bulk Operations on Devices
</h4>
<h5 class="add-padding-top-1x"> <h5 class="add-padding-top-1x">
To enable device operations, select the desired platform and To enable bulk operations, select the desired platform and
ownership from above filter. ownership from above filter.
</h5> </h5>
</div> </div>

@ -35,6 +35,10 @@ var operations = '.wr-operations',
ownershipTypeConstants = { ownershipTypeConstants = {
"BYOD": "BYOD", "BYOD": "BYOD",
"COPE": "COPE" "COPE": "COPE"
},
operationBarModeConstants = {
"BULK": "BULK_OPERATION_MODE",
"SINGLE": "SINGLE_OPERATION_MODE"
}; };
/* /*
@ -103,7 +107,7 @@ function getDevicesByTypes(deviceList) {
// $(".wr-operations").html(""); // $(".wr-operations").html("");
//} //}
function loadOperationBar(deviceType, ownership) { function loadOperationBar(deviceType, ownership, mode) {
var operationBar = $("#operations-bar"); var operationBar = $("#operations-bar");
var operationBarSrc = operationBar.attr("src"); var operationBarSrc = operationBar.attr("src");
@ -121,11 +125,22 @@ function loadOperationBar(deviceType, ownership) {
var j; var j;
for (j = 0; j < totalFeatures.length; j++) { for (j = 0; j < totalFeatures.length; j++) {
if (permissionList[deviceType][i] == totalFeatures[j]["code"]) { if (permissionList[deviceType][i] == totalFeatures[j]["code"]) {
if (deviceType == platformTypeConstants.ANDROID && if (deviceType == platformTypeConstants.ANDROID) {
totalFeatures[j]["code"] == "DEVICE_UNLOCK") { if (totalFeatures[j]["code"] == "DEVICE_UNLOCK") {
if (ownership == ownershipTypeConstants.COPE) { if (ownership == ownershipTypeConstants.COPE) {
permittedOperations.push(totalFeatures[j]); permittedOperations.push(totalFeatures[j]);
} }
} else if (totalFeatures[j]["code"] == "WIPE_DATA") {
if (mode == operationBarModeConstants.BULK) {
if (ownership == ownershipTypeConstants.COPE) {
permittedOperations.push(totalFeatures[j]);
}
} else {
permittedOperations.push(totalFeatures[j]);
}
} else {
permittedOperations.push(totalFeatures[j]);
}
} else { } else {
permittedOperations.push(totalFeatures[j]); permittedOperations.push(totalFeatures[j]);
} }

@ -1450,6 +1450,7 @@ var operationModule = function () {
} else if (operationDataObj.is(":radio")) { } else if (operationDataObj.is(":radio")) {
if (operationDataObj.val() == uiPayload[key]) { if (operationDataObj.val() == uiPayload[key]) {
operationDataObj.attr("checked", true); operationDataObj.attr("checked", true);
operationDataObj.trigger("click");
} }
} else if (operationDataObj.is("select")) { } else if (operationDataObj.is("select")) {
operationDataObj.val(value); operationDataObj.val(value);

@ -292,7 +292,7 @@ var InitiateViewOption = null;
$(document).ready(function () { $(document).ready(function () {
$(".device-detail-body").removeClass("hidden"); $(".device-detail-body").removeClass("hidden");
$("#loading-content").remove(); $("#loading-content").remove();
loadOperationBar(deviceType, ownership); loadOperationBar(deviceType, ownership, operationBarModeConstants.SINGLE);
loadOperationsLog(false); loadOperationsLog(false);
loadApplicationsList(); loadApplicationsList();
loadPolicyCompliance(); loadPolicyCompliance();

@ -62,7 +62,7 @@
<i class="fw fw-application fw-stack-1x"></i> <i class="fw fw-application fw-stack-1x"></i>
<i class="fw fw-block fw-stack-2x"></i> <i class="fw fw-block fw-stack-2x"></i>
</span> </span>
Applications Restrictions Application Restrictions
<span id="app-restriction-configured" class="has-configured status-icon hidden"><i <span id="app-restriction-configured" class="has-configured status-icon hidden"><i
class="fw fw-ok"></i></span> class="fw fw-ok"></i></span>
<span id="app-restriction-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span> <span id="app-restriction-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
@ -73,8 +73,10 @@
<i class="fw fw-import fw-stack-2x"></i> <i class="fw fw-import fw-stack-2x"></i>
</span> </span>
&nbsp;&nbsp;System Update Policy (COSU) &nbsp;&nbsp;System Update Policy (COSU)
<span id="cosu-system-update-policy-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span> <span id="cosu-system-update-policy-configured" class="has-configured status-icon hidden"><i
<span id="cosu-system-update-policy-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span> class="fw fw-ok"></i></span>
<span id="cosu-system-update-policy-ok" class="has-success status-icon hidden"><i
class="fw fw-ok"></i></span>
<span id="cosu-system-update-policy-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span> <span id="cosu-system-update-policy-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span>
</a> </a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('cosu-whitelisted-applications', this)"> <a href="javascript:void(0)" onclick="showAdvanceOperation('cosu-whitelisted-applications', this)">
@ -82,9 +84,11 @@
<i class="fw fw-register fw-stack-2x"></i> <i class="fw fw-register fw-stack-2x"></i>
</span> </span>
Whitelist Apps (COSU) Whitelist Apps (COSU)
<span id="cosu-whitelisted-applications-configured" class="has-configured status-icon hidden"><i class="fw fw-ok"></i></span> <span id="cosu-whitelisted-applications-configured" class="has-configured status-icon hidden"><i
class="fw fw-ok"></i></span>
<span id="cosu-whitelisted-applications-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span> <span id="cosu-whitelisted-applications-ok" class="has-success status-icon hidden"><i class="fw fw-ok"></i></span>
<span id="cosu-whitelisted-applications-error" class="has-error status-icon hidden"><i class="fw fw-error"></i></span> <span id="cosu-whitelisted-applications-error" class="has-error status-icon hidden"><i
class="fw fw-error"></i></span>
</a> </a>
</div> </div>
@ -104,10 +108,8 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to set a passcode policy to an Android Device. Configure the passcode policy for Android device. Once the policy is applied on a device,
Once this configuration profile is installed on a device, corresponding users will not be the device owner will not be able to modify the password settings via the device.
able
to modify these settings on their devices.
</div> </div>
</h2> </h2>
</div> </div>
@ -797,7 +799,8 @@
</span> </span>
</label> </label>
<select class="form-control operationDataKeys" id="wifi-eap" <select class="form-control operationDataKeys" id="wifi-eap"
onchange="changeAndroidWifiPolicyEAP(this, document.getElementById('wifi-type'))" data-key="wifiEAP"> onchange="changeAndroidWifiPolicyEAP(this, document.getElementById('wifi-type'))"
data-key="wifiEAP">
<option value="peap">PEAP</option> <option value="peap">PEAP</option>
<option value="tls">TLS</option> <option value="tls">TLS</option>
<option value="ttls">TTLS</option> <option value="ttls">TTLS</option>
@ -829,7 +832,8 @@
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> </span>
</label> </label>
<select class="form-control operationDataKeys" id="wifi-provisioning" data-key="wifiProvisioning"> <select class="form-control operationDataKeys" id="wifi-provisioning"
data-key="wifiProvisioning">
<option value="0">0</option> <option value="0">0</option>
<option value="1">1</option> <option value="1">1</option>
<option value="2">2</option> <option value="2">2</option>
@ -874,9 +878,9 @@
<input id="wifi-cacert-upload" type="file" class="form-control" <input id="wifi-cacert-upload" type="file" class="form-control"
onchange="base64EncodeFile(this, document.getElementById('wifi-cacert'), document.getElementById('wifi-cacert-name'))"/> onchange="base64EncodeFile(this, document.getElementById('wifi-cacert'), document.getElementById('wifi-cacert-name'))"/>
<input id="wifi-cacert" type="hidden" class="form-control operationDataKeys" <input id="wifi-cacert" type="hidden" class="form-control operationDataKeys"
data-key="wifiCaCert" /> data-key="wifiCaCert"/>
<input id="wifi-cacert-name" type="hidden" class="form-control operationDataKeys" <input id="wifi-cacert-name" type="hidden" class="form-control operationDataKeys"
data-key="wifiCaCertName" /> data-key="wifiCaCertName"/>
</div> </div>
<div class="wr-input-control" id="control-wifi-password" style="display:none;"> <div class="wr-input-control" id="control-wifi-password" style="display:none;">
<label class="wr-input-label" for="wifi-password"> <label class="wr-input-label" for="wifi-password">
@ -909,11 +913,12 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to create a black list or white list of applications. This configuration can be used to create a blacklist or whitelist of applications.
</div> </div>
</h2> </h2>
</div> </div>
<div id="app-restriction-body" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="app-restriction-body"> <div id="app-restriction-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="app-restriction-body">
<div id="app-restriction-feature-error-msg" class="alert alert-danger hidden" role="alert"> <div id="app-restriction-feature-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
@ -927,8 +932,8 @@
<br> <br>
</label> </label>
<select id="app-restriction-type" class="form-control operationDataKeys" data-key="restrictionType"> <select id="app-restriction-type" class="form-control operationDataKeys" data-key="restrictionType">
<option value="black-list" selected="selected">Black List</option> <option value="black-list" selected="selected">BlackList</option>
<option value="white-list">White List</option> <option value="white-list">Whitelist</option>
</select> </select>
<div class="wr-input-control"> <div class="wr-input-control">
@ -1195,7 +1200,7 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to set a passcode policy to an Android Device. This configuration can be used to set system update policy to an Android Device in COSU.
Once this configuration profile is installed on a device, corresponding users will not be Once this configuration profile is installed on a device, corresponding users will not be
able able
to modify these settings on their devices. to modify these settings on their devices.
@ -1206,7 +1211,8 @@
<div id="cosu-system-update-policy-body" class="panel-collapse panel-body collapse" role="tabpanel" <div id="cosu-system-update-policy-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="cosu-system-update-policy-body"> aria-labelledby="cosu-system-update-policy-body">
<div id="cosu-system-update-policy-feature-error-msg" class="alert alert-danger hidden" role="alert"> <div id="cosu-system-update-policy-feature-error-msg" class="alert alert-danger hidden"
role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
@ -1221,24 +1227,31 @@
<label class="wr-input-control radio light"> <label class="wr-input-control radio light">
<input id="automatic-system-update-radio-btn" type="radio" name="cosu-system-update-type" <input id="automatic-system-update-radio-btn" type="radio" name="cosu-system-update-type"
class="form-control operationDataKeys" data-key="cosuSystemUpdatePolicyType" class="form-control operationDataKeys" data-key="cosuSystemUpdatePolicyType"
value="automatic" onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'cosu-system-update-policy-window-select', ['window'])" checked/> value="automatic"
<span class="helper" title="Installs system update automatically as soon as one is available"> onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'cosu-system-update-policy-window-select', ['window'])"
checked/>
<span class="helper"
title="Installs system update automatically as soon as one is available">
&nbsp;Automatic &nbsp;Automatic
</span> </span>
</label> </label>
<label class="wr-input-control radio light"> <label class="wr-input-control radio light">
<input id="postpone-system-update-radio-btn" type="radio" name="cosu-system-update-type" <input id="postpone-system-update-radio-btn" type="radio" name="cosu-system-update-type"
class="form-control operationDataKeys" data-key="cosuSystemUpdatePolicyType" class="form-control operationDataKeys" data-key="cosuSystemUpdatePolicyType"
value="postpone" onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'cosu-system-update-policy-window-select', ['window'])"/> value="postpone"
<span class="helper" title="Incoming system update will be blocked for a maximum of 30 days"> onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'cosu-system-update-policy-window-select', ['window'])"/>
<span class="helper"
title="Incoming system update will be blocked for a maximum of 30 days">
&nbsp;Postpone &nbsp;Postpone
</span> </span>
</label> </label>
<label class="wr-input-control radio light"> <label class="wr-input-control radio light">
<input id="window-system-update-radio-btn" type="radio" name="cosu-system-update-type" <input id="window-system-update-radio-btn" type="radio" name="cosu-system-update-type"
class="form-control operationDataKeys" data-key="cosuSystemUpdatePolicyType" class="form-control operationDataKeys" data-key="cosuSystemUpdatePolicyType"
value="window" onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'cosu-system-update-policy-window-select', ['window'])"/> value="window"
<span class="helper" title="Install system update automatically within a daily maintenance window, for a maximum of 30 days"> onclick="slideDownPaneAgainstValueSetForRadioButtons(this, 'cosu-system-update-policy-window-select', ['window'])"/>
<span class="helper"
title="Install system update automatically within a daily maintenance window, for a maximum of 30 days">
&nbsp;Window &nbsp;Window
</span> </span>
</label> </label>
@ -1339,7 +1352,8 @@
<div id="cosu-whitelisted-applications-heading" class="panel-heading" role="tab"> <div id="cosu-whitelisted-applications-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title"> <h2 class="sub-title panel-title">
Whitelist Applications (COSU) Whitelist Applications (COSU)
<label id="cosu-whitelisted-applications-lbl" class="wr-input-control switch" data-toggle="collapse" <label id="cosu-whitelisted-applications-lbl" class="wr-input-control switch"
data-toggle="collapse"
data-target="#cosu-whitelisted-applications-body"> data-target="#cosu-whitelisted-applications-body">
<input type="checkbox"/> <input type="checkbox"/>
<span class="helper"></span> <span class="helper"></span>
@ -1347,7 +1361,7 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to set a passcode policy to an Android Device. This configuration can be used to whitelist applications in lock task mode of an Android Device in COSU.
Once this configuration profile is installed on a device, corresponding users will not be Once this configuration profile is installed on a device, corresponding users will not be
able able
to modify these settings on their devices. to modify these settings on their devices.
@ -1358,18 +1372,21 @@
<div id="cosu-whitelisted-applications-body" class="panel-collapse panel-body collapse" role="tabpanel" <div id="cosu-whitelisted-applications-body" class="panel-collapse panel-body collapse" role="tabpanel"
aria-labelledby="cosu-whitelisted-applications-body"> aria-labelledby="cosu-whitelisted-applications-body">
<div id="cosu-whitelisted-applications-feature-error-msg" class="alert alert-danger hidden" role="alert"> <div id="cosu-whitelisted-applications-feature-error-msg" class="alert alert-danger hidden"
role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-label" for="cosu-whitelisted-applications"> <label class="wr-input-label" for="cosu-whitelisted-applications">
Whitelisted Applications to enter Lock Task Mode Whitelisted Applications to enter Lock Task Mode
<span class="helper" title="Configuration information specific to a given third-party VPN solution. This has to be input as key/value pairs."> <span class="helper"
title="Configuration information specific to a given third-party VPN solution. This has to be input as key/value pairs.">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> </span>
<br> <br>
<a href="#cosu-whitelisted-applications-grid" class="grid-input-add" data-click-event="add-form"> <a href="#cosu-whitelisted-applications-grid" class="grid-input-add"
data-click-event="add-form">
<span class="icon fw-stack"> <span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i> <i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
@ -1406,10 +1423,12 @@
</td> </td>
<td data-title="Application Name / Description"> <td data-title="Application Name / Description">
<input type="text" class="form-control grid-input-text" data-child-key="appName" <input type="text" class="form-control grid-input-text" data-child-key="appName"
maxlength="100" data-default="" placeholder="[ Application Name / Description ]"/> maxlength="100" data-default=""
placeholder="[ Application Name / Description ]"/>
</td> </td>
<td data-title="Package Name"> <td data-title="Package Name">
<input type="text" class="form-control grid-input-text" data-child-key="packageName" <input type="text" class="form-control grid-input-text"
data-child-key="packageName"
maxlength="100" data-default="" placeholder="[ Package Name ]"/> maxlength="100" data-default="" placeholder="[ Package Name ]"/>
</td> </td>
<td> <td>

@ -1320,7 +1320,7 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to set a passcode policy to an Android Device. This configuration can be used to set system update policy to an Android Device in COSU.
Once this configuration profile is installed on a device, corresponding users will not be Once this configuration profile is installed on a device, corresponding users will not be
able able
to modify these settings on their devices. to modify these settings on their devices.
@ -1472,7 +1472,7 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to set a passcode policy to an Android Device. This configuration can be used to whitelist applications in lock task mode of an Android Device in COSU.
Once this configuration profile is installed on a device, corresponding users will not be Once this configuration profile is installed on a device, corresponding users will not be
able able
to modify these settings on their devices. to modify these settings on their devices.

@ -231,7 +231,7 @@
<div id="camera-heading" class="panel-heading" role="tab"> <div id="camera-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title"> <h2 class="sub-title panel-title">
Restrictions Restrictions
<label class="wr-input-control switch" data-toggle="collapse" data-target="#camera-body"> <label class="wr-input-control switch hidden" data-toggle="collapse" data-target="#camera-body">
<input type="checkbox"/> <input type="checkbox"/>
<span class="helper"></span> <span class="helper"></span>
<span class="text"></span> <span class="text"></span>
@ -254,7 +254,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="camera-enabled" type="checkbox" class="operationDataKeys" data-key="cameraEnabled" <input id="camera-enabled" type="checkbox" class="operationDataKeys" data-key="cameraEnabled"
checked="checked"/> checked="checked" disabled/>
<span class="helper" <span class="helper"
title="Having this checked would enable Usage of phone camera in the device."> title="Having this checked would enable Usage of phone camera in the device.">
&nbsp;&nbsp;&nbsp;Allow use of camera &nbsp;&nbsp;&nbsp;Allow use of camera
@ -269,7 +269,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="volume-adjust-enabled" type="checkbox" class="operationDataKeys" <input id="volume-adjust-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowAdjustVolumeEnabled"/> data-key="disallowAdjustVolumeEnabled" disabled/>
<span class="helper" title="Having this checked would disallow volume adjust."> <span class="helper" title="Having this checked would disallow volume adjust.">
&nbsp;&nbsp;&nbsp;Disallow volume adjust &nbsp;&nbsp;&nbsp;Disallow volume adjust
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -281,7 +281,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-bluetooth-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-configuring-bluetooth-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowConfigBluetooth"/> data-key="disallowConfigBluetooth" disabled/>
<span class="helper" title="Having this checked would disallow configuring bluetooth."> <span class="helper" title="Having this checked would disallow configuring bluetooth.">
&nbsp;&nbsp;&nbsp;Disallow configuring bluetooth. &nbsp;&nbsp;&nbsp;Disallow configuring bluetooth.
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -294,7 +294,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-cell-broadcast-enabled" type="checkbox" <input id="disallow-configuring-cell-broadcast-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowConfigCellBroadcasts"/> data-key="disallowConfigCellBroadcasts" disabled/>
<span class="helper" title="Having this checked would disallow configuring cell broadcast."> <span class="helper" title="Having this checked would disallow configuring cell broadcast.">
&nbsp;&nbsp;&nbsp;Disallow cell broadcast &nbsp;&nbsp;&nbsp;Disallow cell broadcast
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -307,7 +307,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-credentials-enabled" type="checkbox" <input id="disallow-configuring-credentials-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowConfigCredentials"/> data-key="disallowConfigCredentials" disabled/>
<span class="helper" title="Having this checked would disallow configuring credentials."> <span class="helper" title="Having this checked would disallow configuring credentials.">
&nbsp;&nbsp;&nbsp;Disallow configuring credentials &nbsp;&nbsp;&nbsp;Disallow configuring credentials
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -320,7 +320,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-mobile-networkst-enabled" type="checkbox" <input id="disallow-configuring-mobile-networkst-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowConfigMobileNetworks"/> data-key="disallowConfigMobileNetworks" disabled/>
<span class="helper" <span class="helper"
title="Having this checked would disallow configuring mobile networks."> title="Having this checked would disallow configuring mobile networks.">
&nbsp;&nbsp;&nbsp;Disallow configuring mobile networks &nbsp;&nbsp;&nbsp;Disallow configuring mobile networks
@ -334,7 +334,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-tethering-enabled" type="checkbox" <input id="disallow-configuring-tethering-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowConfigTethering"/> data-key="disallowConfigTethering" disabled/>
<span class="helper" title="Having this checked would disallow configuring tethering."> <span class="helper" title="Having this checked would disallow configuring tethering.">
&nbsp;&nbsp;&nbsp;Disallow configuring tethering &nbsp;&nbsp;&nbsp;Disallow configuring tethering
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -346,7 +346,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-VPN-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-configuring-VPN-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowConfigVpn"/> data-key="disallowConfigVpn" disabled/>
<span class="helper" title="Having this checked would disallow configuring VPN."> <span class="helper" title="Having this checked would disallow configuring VPN.">
&nbsp;&nbsp;&nbsp;Disallow configuring VPN &nbsp;&nbsp;&nbsp;Disallow configuring VPN
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -358,7 +358,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-Wifi-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-configuring-Wifi-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowConfigWifi"/> data-key="disallowConfigWifi" disabled/>
<span class="helper" title="Having this checked would disallow configuring Wifi."> <span class="helper" title="Having this checked would disallow configuring Wifi.">
&nbsp;&nbsp;&nbsp;Disallow configuring Wifi &nbsp;&nbsp;&nbsp;Disallow configuring Wifi
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -371,7 +371,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-configuring-app-control-enabled" type="checkbox" <input id="disallow-configuring-app-control-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowAppControl"/> data-key="disallowAppControl" disabled/>
<span class="helper" title="Having this checked would disallow configuring app control."> <span class="helper" title="Having this checked would disallow configuring app control.">
&nbsp;&nbsp;&nbsp;Disallow configuring app control &nbsp;&nbsp;&nbsp;Disallow configuring app control
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -383,7 +383,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-create-window-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-create-window-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowCreateWindows"/> data-key="disallowCreateWindows" disabled/>
<span class="helper" title="Having this checked would disallow create window."> <span class="helper" title="Having this checked would disallow create window.">
&nbsp;&nbsp;&nbsp;Disallow create window &nbsp;&nbsp;&nbsp;Disallow create window
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -396,7 +396,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-cross-profile-copy-paste-enabled" type="checkbox" <input id="disallow-cross-profile-copy-paste-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowCrossProfileCopyPaste"/> data-key="disallowCrossProfileCopyPaste" disabled/>
<span class="helper" title="Having this checked would disallow cross profile copy paste."> <span class="helper" title="Having this checked would disallow cross profile copy paste.">
&nbsp;&nbsp;&nbsp;Disallow cross profile copy paste &nbsp;&nbsp;&nbsp;Disallow cross profile copy paste
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -408,7 +408,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-debugging-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-debugging-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowDebugging"/> data-key="disallowDebugging" disabled/>
<span class="helper" title="Having this checked would disallow debugging."> <span class="helper" title="Having this checked would disallow debugging.">
&nbsp;&nbsp;&nbsp;Disallow debuging &nbsp;&nbsp;&nbsp;Disallow debuging
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -420,7 +420,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-factory-reset-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-factory-reset-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowFactoryReset"/> data-key="disallowFactoryReset" disabled/>
<span class="helper" title="Having this checked would disallow factory reset."> <span class="helper" title="Having this checked would disallow factory reset.">
&nbsp;&nbsp;&nbsp;Disallow factory reset &nbsp;&nbsp;&nbsp;Disallow factory reset
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -432,7 +432,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-add-user-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-add-user-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowAddUser"/> data-key="disallowAddUser" disabled/>
<span class="helper" title="Having this checked would disallow add user."> <span class="helper" title="Having this checked would disallow add user.">
&nbsp;&nbsp;&nbsp;Disallow add user &nbsp;&nbsp;&nbsp;Disallow add user
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -444,7 +444,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-install-apps-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-install-apps-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowInstallApps"/> data-key="disallowInstallApps" disabled/>
<span class="helper" title="Having this checked would disallow install apps."> <span class="helper" title="Having this checked would disallow install apps.">
&nbsp;&nbsp;&nbsp;Disallow install apps &nbsp;&nbsp;&nbsp;Disallow install apps
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -457,7 +457,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-installing-from-unknown-enabled" type="checkbox" <input id="disallow-installing-from-unknown-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowInstallUnknownSources"/> data-key="disallowInstallUnknownSources" disabled/>
<span class="helper" title="Having this checked would disallow installing from unknown <span class="helper" title="Having this checked would disallow installing from unknown
sources."> sources.">
&nbsp;&nbsp;&nbsp;Disallow install from unknown sources &nbsp;&nbsp;&nbsp;Disallow install from unknown sources
@ -470,7 +470,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-modify-accounts-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-modify-accounts-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowModifyAccounts"/> data-key="disallowModifyAccounts" disabled/>
<span class="helper" title="Having this checked would disallow modify accounts."> <span class="helper" title="Having this checked would disallow modify accounts.">
&nbsp;&nbsp;&nbsp;Disallow modify accounts &nbsp;&nbsp;&nbsp;Disallow modify accounts
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -482,7 +482,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-mount-physical-media-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-mount-physical-media-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowMountPhysicalMedia"/> data-key="disallowMountPhysicalMedia" disabled/>
<span class="helper" title="Having this checked would disallow mount physical media."> <span class="helper" title="Having this checked would disallow mount physical media.">
&nbsp;&nbsp;&nbsp;Disallow mount physical media &nbsp;&nbsp;&nbsp;Disallow mount physical media
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -494,7 +494,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-network-reset-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-network-reset-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowNetworkReset"/> data-key="disallowNetworkReset" disabled/>
<span class="helper" title="Having this checked would disallow network reset."> <span class="helper" title="Having this checked would disallow network reset.">
&nbsp;&nbsp;&nbsp;Disallow network reset &nbsp;&nbsp;&nbsp;Disallow network reset
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -506,7 +506,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-outgoing-beam-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-outgoing-beam-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowOutgoingBeam"/> data-key="disallowOutgoingBeam" disabled/>
<span class="helper" title="Having this checked would disallow outgoing beam."> <span class="helper" title="Having this checked would disallow outgoing beam.">
&nbsp;&nbsp;&nbsp;Disallow outgoing beam &nbsp;&nbsp;&nbsp;Disallow outgoing beam
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -518,7 +518,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-outgoing-calls-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-outgoing-calls-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowOutgoingCalls"/> data-key="disallowOutgoingCalls" disabled/>
<span class="helper" title="Having this checked would disallow outgoing calls."> <span class="helper" title="Having this checked would disallow outgoing calls.">
&nbsp;&nbsp;&nbsp;Disallow outgoing calls &nbsp;&nbsp;&nbsp;Disallow outgoing calls
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -530,7 +530,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-remove-user-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-remove-user-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowRemoveUser"/> data-key="disallowRemoveUser" disabled/>
<span class="helper" title="Having this checked would disallow remove user."> <span class="helper" title="Having this checked would disallow remove user.">
&nbsp;&nbsp;&nbsp;Disallow remove user &nbsp;&nbsp;&nbsp;Disallow remove user
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -542,7 +542,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-safe-boot-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-safe-boot-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowSafeBoot"/> data-key="disallowSafeBoot" disabled/>
<span class="helper" title="Having this checked would disallow safe boot."> <span class="helper" title="Having this checked would disallow safe boot.">
&nbsp;&nbsp;&nbsp;Disallow safe boot &nbsp;&nbsp;&nbsp;Disallow safe boot
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -554,7 +554,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-location-sharing-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-location-sharing-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowLocationSharing"/> data-key="disallowLocationSharing" disabled/>
<span class="helper" title="Having this checked would disallow location sharing."> <span class="helper" title="Having this checked would disallow location sharing.">
&nbsp;&nbsp;&nbsp;Disallow location sharing &nbsp;&nbsp;&nbsp;Disallow location sharing
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -566,7 +566,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-SMS-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-SMS-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowSMS"/> data-key="disallowSMS" disabled/>
<span class="helper" title="Having this checked would disallow SMS."> <span class="helper" title="Having this checked would disallow SMS.">
&nbsp;&nbsp;&nbsp;Disallow SMS &nbsp;&nbsp;&nbsp;Disallow SMS
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -578,7 +578,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-uninstall-apps-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-uninstall-apps-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowUninstallApps"/> data-key="disallowUninstallApps" disabled/>
<span class="helper" title="Having this checked would disallow uninstall apps."> <span class="helper" title="Having this checked would disallow uninstall apps.">
&nbsp;&nbsp;&nbsp;Disallow uninstall apps &nbsp;&nbsp;&nbsp;Disallow uninstall apps
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -590,7 +590,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-unmute-microphone-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-unmute-microphone-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowUnmuteMicrophone"/> data-key="disallowUnmuteMicrophone" disabled/>
<span class="helper" title="Having this checked would disallow unmute microphone."> <span class="helper" title="Having this checked would disallow unmute microphone.">
&nbsp;&nbsp;&nbsp;Disallow unmute microphone &nbsp;&nbsp;&nbsp;Disallow unmute microphone
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -602,7 +602,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-USB-transfer-enabled" type="checkbox" class="operationDataKeys" <input id="disallow-USB-transfer-enabled" type="checkbox" class="operationDataKeys"
data-key="disallowUSBFileTransfer"/> data-key="disallowUSBFileTransfer" disabled/>
<span class="helper" title="Having this checked would disallow USB file transfer."> <span class="helper" title="Having this checked would disallow USB file transfer.">
&nbsp;&nbsp;&nbsp;Disallow USB file transfer &nbsp;&nbsp;&nbsp;Disallow USB file transfer
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -615,7 +615,7 @@
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disallow-parent-profile-app-linking-enabled" type="checkbox" <input id="disallow-parent-profile-app-linking-enabled" type="checkbox"
class="operationDataKeys" class="operationDataKeys"
data-key="disallowParentProfileAppLinking"/> data-key="disallowParentProfileAppLinking" disabled/>
<span class="helper" title="Having this checked would disallow parent profile app linking."> <span class="helper" title="Having this checked would disallow parent profile app linking.">
&nbsp;&nbsp;&nbsp;Disallow parent profile app linking &nbsp;&nbsp;&nbsp;Disallow parent profile app linking
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -627,7 +627,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="ensure-verifying-apps-enabled" type="checkbox" class="operationDataKeys" <input id="ensure-verifying-apps-enabled" type="checkbox" class="operationDataKeys"
data-key="ensureVerifyApps"/> data-key="ensureVerifyApps" disabled/>
<span class="helper" title="Having this checked would ensure verifying apps ."> <span class="helper" title="Having this checked would ensure verifying apps .">
&nbsp;&nbsp;&nbsp;Ensure verifying apps &nbsp;&nbsp;&nbsp;Ensure verifying apps
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -639,7 +639,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="enable-auto-timing-enabled" type="checkbox" class="operationDataKeys" <input id="enable-auto-timing-enabled" type="checkbox" class="operationDataKeys"
data-key="enableAutoTime"/> data-key="enableAutoTime" disabled/>
<span class="helper" title="Having this checked would enable auto timing ."> <span class="helper" title="Having this checked would enable auto timing .">
&nbsp;&nbsp;&nbsp;Enable auto timing &nbsp;&nbsp;&nbsp;Enable auto timing
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -651,7 +651,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disable-screen-capture-enabled" type="checkbox" class="operationDataKeys" <input id="disable-screen-capture-enabled" type="checkbox" class="operationDataKeys"
data-key="disableScreenCapture"/> data-key="disableScreenCapture" disabled/>
<span class="helper" title="Having this checked would disable screen capture ."> <span class="helper" title="Having this checked would disable screen capture .">
&nbsp;&nbsp;&nbsp;Disable screen capture &nbsp;&nbsp;&nbsp;Disable screen capture
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -666,7 +666,7 @@
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-control checkbox"> <label class="wr-input-control checkbox">
<input id="disable-status-bar-enabled" type="checkbox" class="operationDataKeys" <input id="disable-status-bar-enabled" type="checkbox" class="operationDataKeys"
data-key="disableStatusBar"/> data-key="disableStatusBar" disabled/>
<span class="helper" title="Having this checked would disable status bar ."> <span class="helper" title="Having this checked would disable status bar .">
&nbsp;&nbsp;&nbsp;Disable status bar &nbsp;&nbsp;&nbsp;Disable status bar
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> <span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
@ -1158,7 +1158,7 @@
<div id="work-profile-policy-heading" class="panel-heading" role="tab"> <div id="work-profile-policy-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title"> <h2 class="sub-title panel-title">
Work-Profile Configurations Work-Profile Configurations
<label id="work-profile-policy-lbl" class="wr-input-control switch" data-toggle="collapse" data-target="#work-profile-policy-body"> <label id="work-profile-policy-lbl" class="wr-input-control switch hidden" data-toggle="collapse" data-target="#work-profile-policy-body">
<input type="checkbox" /> <input type="checkbox" />
<span class="helper"></span> <span class="helper"></span>
<span class="text"></span> <span class="text"></span>
@ -1192,7 +1192,7 @@
</span> </span>
<br> <br>
</label> </label>
<input id="work-profile-policy-profile-name" type="text" class="form-control operationDataKeys" data-key="workProfilePolicyProfileName" maxlength="20"> <input id="work-profile-policy-profile-name" type="text" class="form-control operationDataKeys" data-key="workProfilePolicyProfileName" maxlength="20" disabled>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-enable-system-apps"> <label class="wr-input-label" for="work-profile-policy-enable-system-apps">
@ -1203,7 +1203,7 @@
<br> <br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator ) ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label> </label>
<textarea id="workProfilePolicyEnableSystemApps" type ="text" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyEnableSystemApps"></textarea> <textarea id="workProfilePolicyEnableSystemApps" type ="text" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyEnableSystemApps" disabled></textarea>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-hide-system-apps"> <label class="wr-input-label" for="work-profile-policy-hide-system-apps">
@ -1214,7 +1214,7 @@
<br> <br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator ) ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label> </label>
<textarea id="work-profile-policy-hide-system-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyHideSystemApps" placeholder=""></textarea> <textarea id="work-profile-policy-hide-system-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyHideSystemApps" placeholder="" disabled></textarea>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-label" for="work-profile-policy-unhide-system-apps"> <label class="wr-input-label" for="work-profile-policy-unhide-system-apps">
@ -1225,7 +1225,7 @@
<br> <br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator ) ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label> </label>
<textarea id="work-profile-policy-unhide-system-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyUnhideSystemApps" placeholder=""></textarea> <textarea id="work-profile-policy-unhide-system-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyUnhideSystemApps" placeholder="" disabled></textarea>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control">
<label class="wr-input-label" for="passcode-policy-max-passcode-age-in-days"> <label class="wr-input-label" for="passcode-policy-max-passcode-age-in-days">
@ -1236,7 +1236,7 @@
<br> <br>
( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator ) ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps, com.google.android.calculator )
</label> </label>
<textarea id="work-profile-policy-install-playstore-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyEnablePlaystoreApps" placeholder=""></textarea> <textarea id="work-profile-policy-install-playstore-apps" class="form-control operationDataKeys" rows="4" data-key="workProfilePolicyEnablePlaystoreApps" placeholder="" disabled></textarea>
</div> </div>
</div> </div>
</div> </div>
@ -1257,7 +1257,7 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to set a passcode policy to an Android Device. This configuration can be used to set system update policy to an Android Device in COSU.
Once this configuration profile is installed on a device, corresponding users will not be Once this configuration profile is installed on a device, corresponding users will not be
able able
to modify these settings on their devices. to modify these settings on their devices.
@ -1325,7 +1325,7 @@
</label> </label>
<select id="cosu-system-update-policy-window-start-time" <select id="cosu-system-update-policy-window-start-time"
class="form-control operationDataKeys" class="form-control operationDataKeys"
data-key="cosuSystemUpdatePolicyWindowStartTime" data-default="0"> data-key="cosuSystemUpdatePolicyWindowStartTime" data-default="0" disabled>
<option value="1440" selected="selected">12 AM</option> <option value="1440" selected="selected">12 AM</option>
<option value="60">1 AM</option> <option value="60">1 AM</option>
<option value="120">2 AM</option> <option value="120">2 AM</option>
@ -1361,7 +1361,7 @@
</label> </label>
<select id="cosu-system-update-policy-window-end-time" <select id="cosu-system-update-policy-window-end-time"
class="form-control operationDataKeys" class="form-control operationDataKeys"
data-key="cosuSystemUpdatePolicyWindowEndTime" data-default="0"> data-key="cosuSystemUpdatePolicyWindowEndTime" data-default="0" disabled>
<option value="1440" selected="selected">12 AM</option> <option value="1440" selected="selected">12 AM</option>
<option value="60">1 AM</option> <option value="60">1 AM</option>
<option value="120">2 AM</option> <option value="120">2 AM</option>
@ -1409,7 +1409,7 @@
</label> </label>
<hr> <hr>
<div class="panel-title-description"> <div class="panel-title-description">
This configuration can be used to set a passcode policy to an Android Device. This configuration can be used to whitelist applications in lock task mode of an Android Device in COSU.
Once this configuration profile is installed on a device, corresponding users will not be Once this configuration profile is installed on a device, corresponding users will not be
able able
to modify these settings on their devices. to modify these settings on their devices.

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>2.2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.appmgt.mdm.osgiconnector.feature</artifactId>
<packaging>pom</packaging>
<version>2.2.2-SNAPSHOT</version>
<name>WSO2 Carbon - App management MDM OSGI Connector</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for APP management OSGI MDM connection
</description>
<dependencies>
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.appmgt.mdm.osgiconnector</artifactId>
<version>2.2.2-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.googlecode.plist</groupId>
<artifactId>dd-plist</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>${carbon.p2.plugin.version}</version>
<executions>
<execution>
<id>4-p2-feature-generation</id>
<phase>package</phase>
<goals>
<goal>p2-feature-gen</goal>
</goals>
<configuration>
<id>org.wso2.carbon.appmgt.mdm.osgiconnector</id>
<propertiesFile>../etc/feature.properties</propertiesFile>
<adviceFile>
<properties>
<propertyDef>org.wso2.carbon.p2.category.type:server
</propertyDef>
<propertyDef>org.eclipse.equinox.p2.type.group:false
</propertyDef>
</properties>
</adviceFile>
<bundles>
<bundleDef>org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.appmgt.mdm.osgiconnector:2.2.2-SNAPSHOT</bundleDef>
<bundleDef>com.googlecode.plist:dd-plist:${googlecode.plist.version}</bundleDef>
</bundles>
<importFeatures>
</importFeatures>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>2.2.2-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extensions-feature</artifactId>
<version>2.2.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Extensions</name>
<url>http://wso2.org</url>
<modules>
<module>org.wso2.carbon.appmgt.mdm.osgiconnector.feature</module>
</modules>
</project>

@ -37,8 +37,10 @@
<modules> <modules>
<module>components/mobile-plugins</module> <module>components/mobile-plugins</module>
<module>components/iot-plugins</module> <module>components/iot-plugins</module>
<module>components/extensions</module>
<module>features/mobile-plugins-feature</module> <module>features/mobile-plugins-feature</module>
<module>features/iot-plugins-feature</module> <module>features/iot-plugins-feature</module>
<module>features/extensions-feature</module>
</modules> </modules>
<dependencyManagement> <dependencyManagement>
@ -527,6 +529,13 @@
<version>${carbon.devicemgt.plugins.version}</version> <version>${carbon.devicemgt.plugins.version}</version>
</dependency> </dependency>
<!--- AppM dependencies -->
<dependency>
<groupId>org.wso2.carbon.appmgt</groupId>
<artifactId>org.wso2.carbon.appmgt.mobile</artifactId>
<version>${carbon.appmgt.version}</version>
</dependency>
<!--Osgi dependencies--> <!--Osgi dependencies-->
<dependency> <dependency>
<groupId>org.eclipse.osgi</groupId> <groupId>org.eclipse.osgi</groupId>
@ -712,6 +721,63 @@
<artifactId>org.wso2.carbon.registry.api</artifactId> <artifactId>org.wso2.carbon.registry.api</artifactId>
<version>${carbon.kernel.version}</version> <version>${carbon.kernel.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.wso2.carbon.governance</groupId>
<artifactId>org.wso2.carbon.governance.api</artifactId>
<version>${carbon.governance.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.juddi.wso2</groupId>
<artifactId>juddi</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.common</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.registry.core</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.admin.api</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</exclusion>
<exclusion>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.registry</artifactId>
</exclusion>
<exclusion>
<groupId>eclipse</groupId>
<artifactId>validateutility</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.extensions</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.registry.core</artifactId> <artifactId>org.wso2.carbon.registry.core</artifactId>
@ -917,6 +983,16 @@
<artifactId>axiom-impl</artifactId> <artifactId>axiom-impl</artifactId>
<version>${axiom-api.version}</version> <version>${axiom-api.version}</version>
</dependency--> </dependency-->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>commons-io.wso2</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io-wso2.version}</version>
</dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
@ -984,15 +1060,20 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>org.apache.felix</groupId>
<artifactId>commons-io</artifactId> <artifactId>org.apache.felix.scr</artifactId>
<version>${commons-io.version}</version> <version>${apache-felix.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.googlecode.json-simple.wso2</groupId> <groupId>com.googlecode.json-simple.wso2</groupId>
<artifactId>json-simple</artifactId> <artifactId>json-simple</artifactId>
<version>${json-simple.version}</version> <version>${json-simple.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.googlecode.plist</groupId>
<artifactId>dd-plist</artifactId>
<version>${googlecode.plist.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon.identity</groupId> <groupId>org.wso2.carbon.identity</groupId>
<artifactId>org.wso2.carbon.identity.oauth.stub</artifactId> <artifactId>org.wso2.carbon.identity.oauth.stub</artifactId>
@ -1124,6 +1205,10 @@
<carbon.devicemgt.version>1.2.2-SNAPSHOT</carbon.devicemgt.version> <carbon.devicemgt.version>1.2.2-SNAPSHOT</carbon.devicemgt.version>
<carbon.devicemgt.version.range>[1.1.1, 2.0.0)</carbon.devicemgt.version.range> <carbon.devicemgt.version.range>[1.1.1, 2.0.0)</carbon.devicemgt.version.range>
<!-- Carbon App Management -->
<carbon.appmgt.version>1.2.3-SNAPSHOT</carbon.appmgt.version>
<!-- Carbon Device Management Plugins --> <!-- Carbon Device Management Plugins -->
<carbon.devicemgt.plugins.version>2.2.2-SNAPSHOT</carbon.devicemgt.plugins.version> <carbon.devicemgt.plugins.version>2.2.2-SNAPSHOT</carbon.devicemgt.plugins.version>
@ -1175,6 +1260,11 @@
<codehaus.plexus.version>3.0.21</codehaus.plexus.version> <codehaus.plexus.version>3.0.21</codehaus.plexus.version>
<google.gson.version>2.2.4</google.gson.version> <google.gson.version>2.2.4</google.gson.version>
<gcm.server.version>1.0.2</gcm.server.version> <gcm.server.version>1.0.2</gcm.server.version>
<commons-io-wso2.version>2.4.0.wso2v1</commons-io-wso2.version>
<commons-io.version>2.4</commons-io.version>
<apache-felix.version>1.0.8</apache-felix.version>
<googlecode.plist.version>1.8</googlecode.plist.version>
<orbit.version.commons-httpclient>3.1.0.wso2v2</orbit.version.commons-httpclient> <orbit.version.commons-httpclient>3.1.0.wso2v2</orbit.version.commons-httpclient>
<!--<commons-codec.wso2.version>1.4.0.wso2v1</commons-codec.wso2.version>--> <!--<commons-codec.wso2.version>1.4.0.wso2v1</commons-codec.wso2.version>-->
@ -1195,7 +1285,6 @@
<wss4j.security.version>1.6.17</wss4j.security.version> <wss4j.security.version>1.6.17</wss4j.security.version>
<wss4j.security.common.version>2.0.0</wss4j.security.common.version> <wss4j.security.common.version>2.0.0</wss4j.security.common.version>
<commons-io.version>2.4</commons-io.version>
<commons-json.version>3.0.0.wso2v1</commons-json.version> <commons-json.version>3.0.0.wso2v1</commons-json.version>
<commons-json.version.range>(3.0.0, 4.0.0]</commons-json.version.range> <commons-json.version.range>(3.0.0, 4.0.0]</commons-json.version.range>
<json.path.version>0.9.1</json.path.version> <json.path.version>0.9.1</json.path.version>

Loading…
Cancel
Save