Add uninstall feature to mobile application features

revert-dabc3590
NuwanSameera 9 years ago
parent baffcb104c
commit fda0e9fb5d

@ -22,7 +22,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
import org.wso2.carbon.device.mgt.iot.controlqueue.mqtt.MqttConfig; import org.wso2.carbon.device.mgt.iot.controlqueue.mqtt.MqttConfig;
import org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl.exception.DigitalDisplayException; import org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl.exception.DigitalDisplayException;
import org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl.util.DigitalDisplayMQTTConnector; import org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl.util.DigitalDisplayMQTTConnector;

@ -164,8 +164,7 @@ public class DigitalDisplayManagerServiceImpl implements DigitalDisplayManagerSe
device.setType(DigitalDisplayConstants.DEVICE_TYPE); device.setType(DigitalDisplayConstants.DEVICE_TYPE);
enrolmentInfo.setOwner(APIUtil.getAuthenticatedUser()); enrolmentInfo.setOwner(APIUtil.getAuthenticatedUser());
device.setEnrolmentInfo(enrolmentInfo); device.setEnrolmentInfo(enrolmentInfo);
boolean added = APIUtil.getDeviceManagementService().enrollDevice(device); return APIUtil.getDeviceManagementService().enrollDevice(device);
return added;
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
return false; return false;
} }

@ -1,3 +1,21 @@
/*
* 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.device.mgt.iot.digitaldisplay.service.impl.model; package org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl.model;
public class ScreenShotModel { public class ScreenShotModel {

@ -34,7 +34,7 @@ public class DigitalDisplayMQTTConnector extends MQTTTransportHandler {
private static final String subscribeTopic = private static final String subscribeTopic =
MQTT_TOPIC_APPENDER + "/" + DigitalDisplayConstants.DEVICE_TYPE + "/+/digital_display_publisher"; MQTT_TOPIC_APPENDER + "/" + DigitalDisplayConstants.DEVICE_TYPE + "/+/digital_display_publisher";
private static final String KEY_TYPE = "PRODUCTION"; private static final String KEY_TYPE = "PRODUCTION";
private static final String EMPTY_STRING = ""; private static final String EMPTY_STRING = "";//change name to default password
private static String iotServerSubscriber = UUID.randomUUID().toString().substring(0, 5); private static String iotServerSubscriber = UUID.randomUUID().toString().substring(0, 5);
@ -101,6 +101,7 @@ public class DigitalDisplayMQTTConnector extends MQTTTransportHandler {
@Override @Override
public void processIncomingMessage(MqttMessage message, String... messageParams) { public void processIncomingMessage(MqttMessage message, String... messageParams) {
//Add thread pull executor
String topic = messageParams[0]; String topic = messageParams[0];
String[] topicParams = topic.split("/"); String[] topicParams = topic.split("/");
String owner = topicParams[2]; String owner = topicParams[2];
@ -127,9 +128,7 @@ public class DigitalDisplayMQTTConnector extends MQTTTransportHandler {
} }
private void createScreenShot(String sessionId, String picId, int pos, int length, String data) { private void createScreenShot(String sessionId, String picId, int pos, int length, String data) {
ScreenShotModel screenShotModel = screenshots.get(picId); ScreenShotModel screenShotModel = screenshots.get(picId);
if (screenShotModel == null) { if (screenShotModel == null) {
screenShotModel = new ScreenShotModel(); screenShotModel = new ScreenShotModel();
screenShotModel.setScreenShotData(new String[length + 1]); screenShotModel.setScreenShotData(new String[length + 1]);

@ -1,3 +1,21 @@
/*
* 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.device.mgt.iot.digitaldisplay.service.impl.websocket; package org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl.websocket;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -37,7 +55,6 @@ public class DigitalDisplayWebSocketServerEndPoint {
@OnClose @OnClose
public void onClose(Session userSession) { public void onClose(Session userSession) {
clientSessions.values().remove(userSession); clientSessions.values().remove(userSession);
} }
@OnError @OnError
@ -57,7 +74,8 @@ public class DigitalDisplayWebSocketServerEndPoint {
if (session != null) { if (session != null) {
session.getAsyncRemote().sendText(message.toString()); session.getAsyncRemote().sendText(message.toString());
} else { } else {
log.error("Client already disconnected."); //change err
log.warn("Client already disconnected.");
} }
} }

@ -25,3 +25,4 @@ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../con
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../database/AndroidSenseDM_DB.h2.db);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../database/AndroidSenseDM_DB.h2.db);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/carbonapps/Android_Sense.car);\

@ -1,3 +1,6 @@
instructions.configure = \ instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\
instructions.unconfigure = \
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/carbonapps/);\

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>iot-devicetypes-feature</artifactId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.device.mgt.iot.devicetypes.feature</artifactId>
<name> IoT Server Device types Feature</name>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>${carbon.p2.plugin.version}</version>
<executions>
<execution>
<id>p2-feature-generation</id>
<phase>package</phase>
<goals>
<goal>p2-feature-gen</goal>
</goals>
<configuration>
<id>org.wso2.carbon.device.mgt.iot.devicetypes</id>
<propertiesFile>../../../features/etc/feature.properties</propertiesFile>
<adviceFile>
<properties>
<propertyDef>org.wso2.carbon.p2.category.type:server</propertyDef>
<propertyDef>org.eclipse.equinox.p2.type.group:true</propertyDef>
</properties>
</adviceFile>
<includedFeatures>
<includedFeatureDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.feature:${carbon.devicemgt.plugins.version}
</includedFeatureDef>
<includedFeatureDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.arduino.feature:${carbon.devicemgt.plugins.version}
</includedFeatureDef>
<includedFeatureDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.digitaldisplay.feature:${carbon.devicemgt.plugins.version}
</includedFeatureDef>
<includedFeatureDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.droneanalyzer.feature:${carbon.devicemgt.plugins.version}
</includedFeatureDef>
<includedFeatureDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.raspberrypi.feature:${carbon.devicemgt.plugins.version}
</includedFeatureDef>
<includedFeatureDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature:${carbon.devicemgt.plugins.version}
</includedFeatureDef>
</includedFeatures>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>iot-plugins-feature</artifactId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-devicetypes-feature</artifactId>
<name> IoT Server Device types</name>
<packaging>pom</packaging>
<modules>
<module>org.wso2.carbon.device.mgt.iot.devicetypes.feature</module>
</modules>
</project>

@ -42,6 +42,7 @@
<module>raspberrypi-plugin-feature</module> <module>raspberrypi-plugin-feature</module>
<module>virtual-fire-alarm-plugin-feature</module> <module>virtual-fire-alarm-plugin-feature</module>
<module>iot-base-plugin-feature</module> <module>iot-base-plugin-feature</module>
<module>iot-devicetypes-feature</module>
</modules> </modules>
</project> </project>

@ -186,7 +186,7 @@
<properties> <properties>
<propertyDef>org.wso2.carbon.p2.category.type:server <propertyDef>org.wso2.carbon.p2.category.type:server
</propertyDef> </propertyDef>
<propertyDef>org.eclipse.equinox.p2.type.group:false <propertyDef>org.eclipse.equinox.p2.type.group:true
</propertyDef> </propertyDef>
</properties> </properties>
</adviceFile> </adviceFile>

@ -8,3 +8,15 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/android,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/android,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\
instructions.unconfigure = \
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-android-agent.war);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-android-agent);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-wizard);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/android);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/device-types/android.json);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../database/WSO2MobileAndroid_DB.h2.db);\

@ -186,7 +186,7 @@
<properties> <properties>
<propertyDef>org.wso2.carbon.p2.category.type:server <propertyDef>org.wso2.carbon.p2.category.type:server
</propertyDef> </propertyDef>
<propertyDef>org.eclipse.equinox.p2.type.group:false <propertyDef>org.eclipse.equinox.p2.type.group:true
</propertyDef> </propertyDef>
</properties> </properties>
</adviceFile> </adviceFile>

@ -7,3 +7,15 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/windows,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/windows,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\
instructions.unconfigure = \
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-windows-agent.war);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-windows-agent);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-edit);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-wizard);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.type-view);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/windows);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/device-types/windows.json);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../database/WSO2MobileWindows_DB.h2.db);\
Loading…
Cancel
Save