mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt-plugins
This commit is contained in:
commit
cd044d73c8
@ -68,7 +68,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
<property name="username">admin</property>
|
<property name="username">admin</property>
|
||||||
<property name="contentValidationParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:3</property>
|
<property name="contentValidationParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:3</property>
|
||||||
<property name="contentValidation">default</property>
|
<property name="contentValidation">default</property>
|
||||||
<property name="dcrUrl">https://localhost:9443/dynamic-client-web/register</property>
|
<property name="dcrUrl">https://${server.host}:${mgt.transport.https.port}/dynamic-client-web/register</property>
|
||||||
<property name="url">tcp://localhost:1883</property>
|
<property name="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property>
|
||||||
<property name="cleanSession">true</property>
|
<property name="cleanSession">true</property>
|
||||||
</from>
|
</from>
|
||||||
<mapping customMapping="disable" type="json"/>
|
<mapping customMapping="disable" type="json"/>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException
|
|||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.transport.AndroidSenseMQTTConnector;
|
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.transport.AndroidSenseMQTTConnector;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.APIUtil;
|
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.APIUtil;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.SensorRecord;
|
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.SensorRecord;
|
||||||
@ -78,7 +79,7 @@ public class AndroidSenseControllerServiceImpl implements AndroidSenseController
|
|||||||
public Response sendThreshold(@PathParam("deviceId") String deviceId, @QueryParam("threshold") String threshold) {
|
public Response sendThreshold(@PathParam("deviceId") String deviceId, @QueryParam("threshold") String threshold) {
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
AndroidSenseConstants.DEVICE_TYPE))) {
|
AndroidSenseConstants.DEVICE_TYPE), DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
androidSenseMQTTConnector.publishDeviceData(deviceId, "threshold", threshold);
|
androidSenseMQTTConnector.publishDeviceData(deviceId, "threshold", threshold);
|
||||||
@ -96,7 +97,7 @@ public class AndroidSenseControllerServiceImpl implements AndroidSenseController
|
|||||||
public Response removeKeyWords(@PathParam("deviceId") String deviceId, @QueryParam("words") String words) {
|
public Response removeKeyWords(@PathParam("deviceId") String deviceId, @QueryParam("words") String words) {
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
AndroidSenseConstants.DEVICE_TYPE))) {
|
AndroidSenseConstants.DEVICE_TYPE), DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
androidSenseMQTTConnector.publishDeviceData(deviceId, "remove", words);
|
androidSenseMQTTConnector.publishDeviceData(deviceId, "remove", words);
|
||||||
@ -127,7 +128,7 @@ public class AndroidSenseControllerServiceImpl implements AndroidSenseController
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
AndroidSenseConstants.DEVICE_TYPE))) {
|
AndroidSenseConstants.DEVICE_TYPE), DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
List<SensorRecord> sensorDatas;
|
List<SensorRecord> sensorDatas;
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.APIUtil;
|
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.APIUtil;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.constants.AndroidSenseConstants;
|
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.constants.AndroidSenseConstants;
|
||||||
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.AndroidConfiguration;
|
import org.wso2.carbon.device.mgt.iot.androidsense.service.impl.util.AndroidConfiguration;
|
||||||
@ -108,7 +109,8 @@ public class AndroidSenseManagerServiceImpl implements AndroidSenseManagerServic
|
|||||||
deviceIdentifier.setId(deviceId);
|
deviceIdentifier.setId(deviceId);
|
||||||
deviceIdentifier.setType(AndroidSenseConstants.DEVICE_TYPE);
|
deviceIdentifier.setType(AndroidSenseConstants.DEVICE_TYPE);
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier, DeviceGroupConstants.
|
||||||
|
Permissions.DEFAULT_ADMIN_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
boolean removed = APIUtil.getDeviceManagementService().disenrollDevice(deviceIdentifier);
|
boolean removed = APIUtil.getDeviceManagementService().disenrollDevice(deviceIdentifier);
|
||||||
@ -133,7 +135,8 @@ public class AndroidSenseManagerServiceImpl implements AndroidSenseManagerServic
|
|||||||
deviceIdentifier.setId(deviceId);
|
deviceIdentifier.setId(deviceId);
|
||||||
deviceIdentifier.setType(AndroidSenseConstants.DEVICE_TYPE);
|
deviceIdentifier.setType(AndroidSenseConstants.DEVICE_TYPE);
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier, DeviceGroupConstants.
|
||||||
|
Permissions.DEFAULT_ADMIN_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
|
Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException
|
|||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
||||||
import org.wso2.carbon.device.mgt.iot.arduino.service.impl.dto.SensorRecord;
|
import org.wso2.carbon.device.mgt.iot.arduino.service.impl.dto.SensorRecord;
|
||||||
import org.wso2.carbon.device.mgt.iot.arduino.service.impl.util.APIUtil;
|
import org.wso2.carbon.device.mgt.iot.arduino.service.impl.util.APIUtil;
|
||||||
import org.wso2.carbon.device.mgt.iot.arduino.plugin.constants.ArduinoConstants;
|
import org.wso2.carbon.device.mgt.iot.arduino.plugin.constants.ArduinoConstants;
|
||||||
@ -54,7 +55,8 @@ public class ArduinoControllerServiceImpl implements ArduinoControllerService {
|
|||||||
public Response switchBulb(@PathParam("deviceId") String deviceId, @QueryParam("state") String state) {
|
public Response switchBulb(@PathParam("deviceId") String deviceId, @QueryParam("state") String state) {
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
ArduinoConstants.DEVICE_TYPE))) {
|
ArduinoConstants.DEVICE_TYPE),
|
||||||
|
DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
LinkedList<String> deviceControlList = internalControlsQueue.get(deviceId);
|
LinkedList<String> deviceControlList = internalControlsQueue.get(deviceId);
|
||||||
@ -79,7 +81,7 @@ public class ArduinoControllerServiceImpl implements ArduinoControllerService {
|
|||||||
public Response readControls(@PathParam("deviceId") String deviceId) {
|
public Response readControls(@PathParam("deviceId") String deviceId) {
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
ArduinoConstants.DEVICE_TYPE))) {
|
ArduinoConstants.DEVICE_TYPE), DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
String result;
|
String result;
|
||||||
@ -121,7 +123,7 @@ public class ArduinoControllerServiceImpl implements ArduinoControllerService {
|
|||||||
@QueryParam("to") long to) {
|
@QueryParam("to") long to) {
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
ArduinoConstants.DEVICE_TYPE))) {
|
ArduinoConstants.DEVICE_TYPE), DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
String fromDate = String.valueOf(from);
|
String fromDate = String.valueOf(from);
|
||||||
|
|||||||
@ -31,16 +31,16 @@
|
|||||||
|
|
||||||
<Permission>
|
<Permission>
|
||||||
<name>control bulb</name>
|
<name>control bulb</name>
|
||||||
<path>device-mgt/user/operations</path>
|
<path>/device-mgt/user/operations</path>
|
||||||
<url>/device/*/bulb</url>
|
<url>/device/*/bulb</url>
|
||||||
<method>POST</method>
|
<method>POST</method>
|
||||||
<scope>arduino_user</scope>
|
<scope>arduino_user</scope>
|
||||||
</Permission>
|
</Permission>
|
||||||
<Permission>
|
<Permission>
|
||||||
<name>get controls</name>
|
<name>get controls</name>
|
||||||
<path>device-mgt/user/operations</path>
|
<path>/device-mgt/user/operations</path>
|
||||||
<url>/device/*/controls</url>
|
<url>/device/*/controls</url>
|
||||||
<method>POST</method>
|
<method>GET</method>
|
||||||
<scope>arduino_device</scope>
|
<scope>arduino_device</scope>
|
||||||
</Permission>
|
</Permission>
|
||||||
<Permission>
|
<Permission>
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
<property name="contentValidation">default</property>
|
<property name="contentValidation">default</property>
|
||||||
<property name="transports">all</property>
|
<property name="transports">all</property>
|
||||||
<property name="maximumTotalHttpConnection">100</property>
|
<property name="maximumTotalHttpConnection">100</property>
|
||||||
<property name="tokenValidationEndpointUrl">https://localhost:9443/services/OAuth2TokenValidationService</property>
|
<property name="tokenValidationEndpointUrl">https://${server.host}:${mgt.transport.https.port}/services/OAuth2TokenValidationService</property>
|
||||||
<property name="password">admin</property>
|
<property name="password">admin</property>
|
||||||
</from>
|
</from>
|
||||||
<mapping customMapping="disable" type="json"/>
|
<mapping customMapping="disable" type="json"/>
|
||||||
|
|||||||
@ -19,12 +19,13 @@
|
|||||||
|
|
||||||
<eventReceiver name="temperature-mqtt" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
|
<eventReceiver name="temperature-mqtt" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
|
||||||
<from eventAdapterType="oauth-mqtt">
|
<from eventAdapterType="oauth-mqtt">
|
||||||
<property name="topic">wso2/carbon.super/+/+/temperature</property>
|
<property name="topic">wso2/carbon.super/raspberrypi/+/temperature</property>
|
||||||
<property name="username">admin</property>
|
<property name="username">admin</property>
|
||||||
<property name="contentValidationParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:3</property>
|
<property name="contentValidationParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:3</property>
|
||||||
<property name="contentValidation">default</property>
|
<property name="contentValidation">default</property>
|
||||||
<property name="dcrUrl">https://localhost:9443/dynamic-client-web/register</property>
|
<property name="dcrUrl">https://${server.host}:${mgt.transport.https.port}/dynamic-client-web/register</property>
|
||||||
<property name="url">tcp://localhost:1883</property>
|
<property name="clientId">temperatureMqttClient</property>
|
||||||
|
<property name="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property>
|
||||||
<property name="cleanSession">true</property>
|
<property name="cleanSession">true</property>
|
||||||
</from>
|
</from>
|
||||||
<mapping customMapping="disable" type="json"/>
|
<mapping customMapping="disable" type="json"/>
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import org.wso2.carbon.analytics.dataservice.commons.SortByField;
|
|||||||
import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
|
import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
||||||
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.raspberrypi.service.impl.dto.SensorRecord;
|
import org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl.dto.SensorRecord;
|
||||||
import org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl.transport.RaspberryPiMQTTConnector;
|
import org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl.transport.RaspberryPiMQTTConnector;
|
||||||
@ -56,7 +57,7 @@ public class RaspberryPiControllerServiceImpl implements RaspberryPiControllerSe
|
|||||||
public Response switchBulb(@PathParam("deviceId") String deviceId, @QueryParam("state") String state) {
|
public Response switchBulb(@PathParam("deviceId") String deviceId, @QueryParam("state") String state) {
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
RaspberrypiConstants.DEVICE_TYPE))) {
|
RaspberrypiConstants.DEVICE_TYPE), DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
String switchToState = state.toUpperCase();
|
String switchToState = state.toUpperCase();
|
||||||
@ -90,7 +91,7 @@ public class RaspberryPiControllerServiceImpl implements RaspberryPiControllerSe
|
|||||||
String sensorTableName = RaspberrypiConstants.TEMPERATURE_EVENT_TABLE;
|
String sensorTableName = RaspberrypiConstants.TEMPERATURE_EVENT_TABLE;
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
||||||
RaspberrypiConstants.DEVICE_TYPE))) {
|
RaspberrypiConstants.DEVICE_TYPE), DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
List<SortByField> sortByFields = new ArrayList<>();
|
List<SortByField> sortByFields = new ArrayList<>();
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -44,6 +44,7 @@ import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.core.Agent
|
|||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.exception.AgentCoreOperationException;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.exception.AgentCoreOperationException;
|
||||||
import sun.security.x509.X509CertImpl;
|
import sun.security.x509.X509CertImpl;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@ -82,6 +83,7 @@ public class EnrollmentManager {
|
|||||||
private static final String KEY_PAIR_ALGORITHM = "RSA";
|
private static final String KEY_PAIR_ALGORITHM = "RSA";
|
||||||
private static final String PROVIDER = "BC";
|
private static final String PROVIDER = "BC";
|
||||||
private static final String SIGNATURE_ALG = "SHA1withRSA";
|
private static final String SIGNATURE_ALG = "SHA1withRSA";
|
||||||
|
private static final String CERT_IS_CA_EXTENSION = "is_ca";
|
||||||
private static final int KEY_SIZE = 2048;
|
private static final int KEY_SIZE = 2048;
|
||||||
|
|
||||||
// Seed to our PRNG. Make sure this is initialised randomly, NOT LIKE THIS
|
// Seed to our PRNG. Make sure this is initialised randomly, NOT LIKE THIS
|
||||||
@ -376,9 +378,9 @@ public class EnrollmentManager {
|
|||||||
log.debug(((X509Certificate) cert).getIssuerDN().getName());
|
log.debug(((X509Certificate) cert).getIssuerDN().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Need to identify the correct certificate.
|
// I have chosen the CA cert based on its BasicConstraintExtension "is_ca" being set to "true"
|
||||||
// I have chosen the CA cert based on its BasicConstraint criticality being set to "true"
|
// This is because the returned keystore may contain many certificates including RAs.
|
||||||
if (((X509CertImpl) cert).getBasicConstraintsExtension().isCritical()) {
|
if (((Boolean) ((X509CertImpl) cert).getBasicConstraintsExtension().get(CERT_IS_CA_EXTENSION))) {
|
||||||
serverCertPublicKey = cert.getPublicKey();
|
serverCertPublicKey = cert.getPublicKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -396,6 +398,10 @@ public class EnrollmentManager {
|
|||||||
String errorMsg = "Could not retrieve [Server-Certificates] from the response message from SCEP-Server.";
|
String errorMsg = "Could not retrieve [Server-Certificates] from the response message from SCEP-Server.";
|
||||||
log.error(errorMsg);
|
log.error(errorMsg);
|
||||||
throw new AgentCoreOperationException(errorMsg, e);
|
throw new AgentCoreOperationException(errorMsg, e);
|
||||||
|
} catch (IOException e) {
|
||||||
|
String errorMsg = "Error occurred whilst trying to get property ['is_ca'] from the retreived Certificates";
|
||||||
|
log.error(errorMsg);
|
||||||
|
throw new AgentCoreOperationException(errorMsg, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return serverCertPublicKey;
|
return serverCertPublicKey;
|
||||||
|
|||||||
@ -27,24 +27,26 @@ import org.wso2.carbon.apimgt.annotations.api.Permission;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
||||||
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.controlqueue.xmpp.XmppConfig;
|
import org.wso2.carbon.device.mgt.iot.controlqueue.xmpp.XmppConfig;
|
||||||
import org.wso2.carbon.device.mgt.iot.service.IoTServerStartupListener;
|
import org.wso2.carbon.device.mgt.iot.service.IoTServerStartupListener;
|
||||||
import org.wso2.carbon.device.mgt.iot.transport.TransportHandlerException;
|
import org.wso2.carbon.device.mgt.iot.transport.TransportHandlerException;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.dto.DeviceData;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.dto.DeviceData;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.transport.VirtualFireAlarmXMPPConnector;
|
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.SecurityManager;
|
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.dto.SensorRecord;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.dto.SensorRecord;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.transport.VirtualFireAlarmMQTTConnector;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.transport.VirtualFireAlarmMQTTConnector;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.transport.VirtualFireAlarmXMPPConnector;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.APIUtil;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.APIUtil;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.SecurityManager;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.VirtualFireAlarmServiceUtils;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.VirtualFireAlarmServiceUtils;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.FormParam;
|
import javax.ws.rs.FormParam;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.PathParam;
|
import javax.ws.rs.PathParam;
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
@ -72,7 +74,7 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo
|
|||||||
// holds a mapping of the IP addresses to Device-IDs for HTTP communication
|
// holds a mapping of the IP addresses to Device-IDs for HTTP communication
|
||||||
private ConcurrentHashMap<String, String> deviceToIpMap = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<String, String> deviceToIpMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Permission(scope = "virtual_firealarm_user", permissions = {"device-mgt/virtual_firealarm/user"})
|
@Permission(scope = "virtual_firealarm_user", permissions = { "device-mgt/virtual_firealarm/user" })
|
||||||
@POST
|
@POST
|
||||||
@Path("device/register/{deviceId}/{ip}/{port}")
|
@Path("device/register/{deviceId}/{ip}/{port}")
|
||||||
public Response registerDeviceIP(@PathParam("deviceId") String deviceId, @PathParam("ip") String deviceIP,
|
public Response registerDeviceIP(@PathParam("deviceId") String deviceId, @PathParam("ip") String deviceIP,
|
||||||
@ -107,8 +109,9 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo
|
|||||||
protocolString);
|
protocolString);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(
|
||||||
VirtualFireAlarmConstants.DEVICE_TYPE))) {
|
new DeviceIdentifier(deviceId, VirtualFireAlarmConstants.DEVICE_TYPE),
|
||||||
|
DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
switch (protocolString) {
|
switch (protocolString) {
|
||||||
@ -138,6 +141,44 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PUT
|
||||||
|
@Path("device/{deviceId}/policy")
|
||||||
|
public Response updatePolicy(@PathParam("deviceId") String deviceId, @QueryParam("protocol") String protocol,
|
||||||
|
@FormParam("policy") String policy) {
|
||||||
|
String protocolString = protocol.toUpperCase();
|
||||||
|
if (log.isDebugEnabled()) {
|
||||||
|
log.debug("Sending request to update-policy of device [" + deviceId + "] via " +
|
||||||
|
protocolString);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(
|
||||||
|
new DeviceIdentifier(deviceId, VirtualFireAlarmConstants.DEVICE_TYPE),
|
||||||
|
DeviceGroupConstants.Permissions.DEFAULT_MANAGE_POLICIES_PERMISSIONS)) {
|
||||||
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
|
}
|
||||||
|
switch (protocolString) {
|
||||||
|
case HTTP_PROTOCOL:
|
||||||
|
throw new UnsupportedOperationException(
|
||||||
|
"Sending request to update-policy via HTTP protocol not supported.");
|
||||||
|
case XMPP_PROTOCOL:
|
||||||
|
String xmppResource = VirtualFireAlarmConstants.POLICY_CONTEXT.replace("/", "");
|
||||||
|
virtualFireAlarmXMPPConnector.publishDeviceData(deviceId, xmppResource, policy);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
String mqttResource = VirtualFireAlarmConstants.POLICY_CONTEXT.replace("/", "");
|
||||||
|
virtualFireAlarmMQTTConnector.publishDeviceData(deviceId, mqttResource, policy);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return Response.ok().build();
|
||||||
|
} catch (TransportHandlerException e) {
|
||||||
|
log.error("Failed to send update-policy request to device [" + deviceId + "] via " + protocolString);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||||
|
} catch (DeviceAccessAuthorizationException e) {
|
||||||
|
log.error(e.getErrorMessage(), e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("device/temperature")
|
@Path("device/temperature")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@ -155,8 +196,8 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo
|
|||||||
return Response.status(Response.Status.CONFLICT).build();
|
return Response.status(Response.Status.CONFLICT).build();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(
|
||||||
VirtualFireAlarmConstants.DEVICE_TYPE))) {
|
new DeviceIdentifier(deviceId, VirtualFireAlarmConstants.DEVICE_TYPE))) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
if (!VirtualFireAlarmServiceUtils.publishToDAS(dataMsg.deviceId, dataMsg.value)) {
|
if (!VirtualFireAlarmServiceUtils.publishToDAS(dataMsg.deviceId, dataMsg.value)) {
|
||||||
@ -175,33 +216,34 @@ public class VirtualFireAlarmControllerServiceImpl implements VirtualFireAlarmCo
|
|||||||
@Produces("application/json")
|
@Produces("application/json")
|
||||||
public Response getVirtualFirealarmStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
|
public Response getVirtualFirealarmStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
|
||||||
@QueryParam("to") long to) {
|
@QueryParam("to") long to) {
|
||||||
String fromDate = String.valueOf(from);
|
String fromDate = String.valueOf(from);
|
||||||
String toDate = String.valueOf(to);
|
String toDate = String.valueOf(to);
|
||||||
String query = "deviceId:" + deviceId + " AND deviceType:" +
|
String query = "deviceId:" + deviceId + " AND deviceType:" +
|
||||||
VirtualFireAlarmConstants.DEVICE_TYPE + " AND time : [" + fromDate + " TO " + toDate + "]";
|
VirtualFireAlarmConstants.DEVICE_TYPE + " AND time : [" + fromDate + " TO " + toDate + "]";
|
||||||
String sensorTableName = VirtualFireAlarmConstants.TEMPERATURE_EVENT_TABLE;
|
String sensorTableName = VirtualFireAlarmConstants.TEMPERATURE_EVENT_TABLE;
|
||||||
try {
|
try {
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(
|
||||||
VirtualFireAlarmConstants.DEVICE_TYPE))) {
|
new DeviceIdentifier(deviceId, VirtualFireAlarmConstants.DEVICE_TYPE),
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) {
|
||||||
}
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
if (sensorTableName != null) {
|
|
||||||
List<SortByField> sortByFields = new ArrayList<>();
|
|
||||||
SortByField sortByField = new SortByField("time", SORT.ASC, false);
|
|
||||||
sortByFields.add(sortByField);
|
|
||||||
List<SensorRecord> sensorRecords = APIUtil.getAllEventsForDevice(sensorTableName, query, sortByFields);
|
|
||||||
return Response.status(Response.Status.OK.getStatusCode()).entity(sensorRecords).build();
|
|
||||||
}
|
|
||||||
} catch (AnalyticsException e) {
|
|
||||||
String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
|
|
||||||
log.error(errorMsg);
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
|
|
||||||
} catch (DeviceAccessAuthorizationException e) {
|
|
||||||
log.error(e.getErrorMessage(), e);
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
|
||||||
}
|
}
|
||||||
return Response.status(Response.Status.BAD_REQUEST).build();
|
if (sensorTableName != null) {
|
||||||
|
List<SortByField> sortByFields = new ArrayList<>();
|
||||||
|
SortByField sortByField = new SortByField("time", SORT.ASC, false);
|
||||||
|
sortByFields.add(sortByField);
|
||||||
|
List<SensorRecord> sensorRecords = APIUtil.getAllEventsForDevice(sensorTableName, query, sortByFields);
|
||||||
|
return Response.status(Response.Status.OK.getStatusCode()).entity(sensorRecords).build();
|
||||||
|
}
|
||||||
|
} catch (AnalyticsException e) {
|
||||||
|
String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
|
||||||
|
log.error(errorMsg);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
|
||||||
|
} catch (DeviceAccessAuthorizationException e) {
|
||||||
|
log.error(e.getErrorMessage(), e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
||||||
}
|
}
|
||||||
|
return Response.status(Response.Status.BAD_REQUEST).build();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean waitForServerStartup() {
|
private boolean waitForServerStartup() {
|
||||||
while (!IoTServerStartupListener.isServerReady()) {
|
while (!IoTServerStartupListener.isServerReady()) {
|
||||||
|
|||||||
@ -30,13 +30,14 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
||||||
import org.wso2.carbon.device.mgt.iot.controlqueue.xmpp.XmppAccount;
|
import org.wso2.carbon.device.mgt.iot.controlqueue.xmpp.XmppAccount;
|
||||||
import org.wso2.carbon.device.mgt.iot.controlqueue.xmpp.XmppConfig;
|
import org.wso2.carbon.device.mgt.iot.controlqueue.xmpp.XmppConfig;
|
||||||
import org.wso2.carbon.device.mgt.iot.controlqueue.xmpp.XmppServerClient;
|
import org.wso2.carbon.device.mgt.iot.controlqueue.xmpp.XmppServerClient;
|
||||||
import org.wso2.carbon.device.mgt.iot.exception.DeviceControllerException;
|
import org.wso2.carbon.device.mgt.iot.exception.DeviceControllerException;
|
||||||
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
|
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.APIUtil;
|
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants;
|
||||||
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.APIUtil;
|
||||||
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.ZipUtil;
|
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl.util.ZipUtil;
|
||||||
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
|
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
|
||||||
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
|
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
|
||||||
@ -75,7 +76,8 @@ public class VirtualFireAlarmManagerServiceImpl implements VirtualFireAlarmManag
|
|||||||
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
||||||
deviceIdentifier.setId(deviceId);
|
deviceIdentifier.setId(deviceId);
|
||||||
deviceIdentifier.setType(VirtualFireAlarmConstants.DEVICE_TYPE);
|
deviceIdentifier.setType(VirtualFireAlarmConstants.DEVICE_TYPE);
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier, DeviceGroupConstants.
|
||||||
|
Permissions.DEFAULT_ADMIN_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
boolean removed = APIUtil.getDeviceManagementService().disenrollDevice(
|
boolean removed = APIUtil.getDeviceManagementService().disenrollDevice(
|
||||||
@ -101,7 +103,8 @@ public class VirtualFireAlarmManagerServiceImpl implements VirtualFireAlarmManag
|
|||||||
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
||||||
deviceIdentifier.setId(deviceId);
|
deviceIdentifier.setId(deviceId);
|
||||||
deviceIdentifier.setType(VirtualFireAlarmConstants.DEVICE_TYPE);
|
deviceIdentifier.setType(VirtualFireAlarmConstants.DEVICE_TYPE);
|
||||||
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
|
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier, DeviceGroupConstants.
|
||||||
|
Permissions.DEFAULT_ADMIN_PERMISSIONS)) {
|
||||||
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
|
||||||
}
|
}
|
||||||
Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
|
Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
|
||||||
@ -158,7 +161,7 @@ public class VirtualFireAlarmManagerServiceImpl implements VirtualFireAlarmManag
|
|||||||
ArrayList<Device> userDevicesforFirealarm = new ArrayList<>();
|
ArrayList<Device> userDevicesforFirealarm = new ArrayList<>();
|
||||||
for (Device device : userDevices) {
|
for (Device device : userDevices) {
|
||||||
if (device.getType().equals(VirtualFireAlarmConstants.DEVICE_TYPE) &&
|
if (device.getType().equals(VirtualFireAlarmConstants.DEVICE_TYPE) &&
|
||||||
device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.ACTIVE)) {
|
device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.ACTIVE)) {
|
||||||
userDevicesforFirealarm.add(device);
|
userDevicesforFirealarm.add(device);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -239,8 +242,9 @@ public class VirtualFireAlarmManagerServiceImpl implements VirtualFireAlarmManag
|
|||||||
//create new device id
|
//create new device id
|
||||||
String deviceId = shortUUID();
|
String deviceId = shortUUID();
|
||||||
if (apiApplicationKey == null) {
|
if (apiApplicationKey == null) {
|
||||||
String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration()
|
String applicationUsername =
|
||||||
.getAdminUserName();
|
PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration()
|
||||||
|
.getAdminUserName();
|
||||||
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
|
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
|
||||||
String[] tags = {VirtualFireAlarmConstants.DEVICE_TYPE};
|
String[] tags = {VirtualFireAlarmConstants.DEVICE_TYPE};
|
||||||
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
|
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
|
||||||
@ -249,7 +253,8 @@ public class VirtualFireAlarmManagerServiceImpl implements VirtualFireAlarmManag
|
|||||||
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
|
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
|
||||||
String scopes = "device_type_" + VirtualFireAlarmConstants.DEVICE_TYPE + " device_" + deviceId;
|
String scopes = "device_type_" + VirtualFireAlarmConstants.DEVICE_TYPE + " device_" + deviceId;
|
||||||
AccessTokenInfo accessTokenInfo = jwtClient.getAccessToken(apiApplicationKey.getConsumerKey(),
|
AccessTokenInfo accessTokenInfo = jwtClient.getAccessToken(apiApplicationKey.getConsumerKey(),
|
||||||
apiApplicationKey.getConsumerSecret(), owner, scopes);
|
apiApplicationKey.getConsumerSecret(), owner,
|
||||||
|
scopes);
|
||||||
String accessToken = accessTokenInfo.getAccessToken();
|
String accessToken = accessTokenInfo.getAccessToken();
|
||||||
String refreshToken = accessTokenInfo.getRefreshToken();
|
String refreshToken = accessTokenInfo.getRefreshToken();
|
||||||
//adding registering data
|
//adding registering data
|
||||||
@ -266,8 +271,8 @@ public class VirtualFireAlarmManagerServiceImpl implements VirtualFireAlarmManag
|
|||||||
if (!status) {
|
if (!status) {
|
||||||
String msg =
|
String msg =
|
||||||
"XMPP Account was not created for device - " + deviceId + " of owner - " + owner +
|
"XMPP Account was not created for device - " + deviceId + " of owner - " + owner +
|
||||||
".XMPP might have been disabled in org.wso2.carbon.device.mgt.iot" +
|
".XMPP might have been disabled in org.wso2.carbon.device.mgt.iot" +
|
||||||
".common.config.server.configs";
|
".common.config.server.configs";
|
||||||
throw new DeviceManagementException(msg);
|
throw new DeviceManagementException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ public class VirtualFireAlarmConstants {
|
|||||||
|
|
||||||
public static final String URL_PREFIX = "http://";
|
public static final String URL_PREFIX = "http://";
|
||||||
public static final String BULB_CONTEXT = "/BULB/";
|
public static final String BULB_CONTEXT = "/BULB/";
|
||||||
|
public static final String POLICY_CONTEXT = "/POLICY/";
|
||||||
public static final String HUMIDITY_CONTEXT = "/HUMIDITY/";
|
public static final String HUMIDITY_CONTEXT = "/HUMIDITY/";
|
||||||
public static final String TEMPERATURE_CONTEXT = "/TEMPERATURE/";
|
public static final String TEMPERATURE_CONTEXT = "/TEMPERATURE/";
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -1,11 +1,8 @@
|
|||||||
{{#zone "topCss"}}
|
<span id="details" data-devices="{{devices}}" data-devicename="{{device.name}}" data-deviceid="{{device.deviceIdentifier}}"
|
||||||
{{css "css/graph.css"}}
|
|
||||||
{{/zone}}
|
|
||||||
<span id="details" data-devicename="{{device.name}}" data-deviceid="{{device.deviceIdentifier}}"
|
|
||||||
data-appcontext="{{@app.context}}"></span>
|
data-appcontext="{{@app.context}}"></span>
|
||||||
<div id="div-chart">
|
<div id="div-chart">
|
||||||
<div class="chartWrapper" id="chartWrapper">
|
<div class="chartWrapper" id="chartWrapper">
|
||||||
<span id="span-title">Temperature</span>
|
<h3 id="span-title">Temperature</h3>
|
||||||
<div id="y_axis" class="custom_y_axis"></div>
|
<div id="y_axis" class="custom_y_axis"></div>
|
||||||
<div class="legend_container">
|
<div class="legend_container">
|
||||||
<div id="smoother" title="Smoothing"></div>
|
<div id="smoother" title="Smoothing"></div>
|
||||||
@ -18,8 +15,5 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
{{js "js/d3.min.js"}}
|
|
||||||
{{js "js/rickshaw.min.js"}}
|
|
||||||
{{js "js/moment.min.js"}}
|
|
||||||
{{js "js/devicetype-graph.js"}}
|
{{js "js/devicetype-graph.js"}}
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|||||||
@ -17,14 +17,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function onRequest(context) {
|
function onRequest(context) {
|
||||||
|
var devices = context.unit.params.devices;
|
||||||
var deviceType = context.uriParams.deviceType;
|
var deviceType = context.uriParams.deviceType;
|
||||||
var deviceId = request.getParameter("deviceId");
|
var deviceId = request.getParameter("deviceId");
|
||||||
|
|
||||||
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
if (devices) {
|
||||||
|
return {
|
||||||
|
"devices": stringify(devices),
|
||||||
|
"backendApiUri": devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/"
|
||||||
|
};
|
||||||
|
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
|
||||||
var deviceModule = require("/app/modules/device.js").deviceModule;
|
var deviceModule = require("/app/modules/device.js").deviceModule;
|
||||||
var device = deviceModule.viewDevice(deviceType, deviceId);
|
var device = deviceModule.viewDevice(deviceType, deviceId);
|
||||||
if (device && device.status != "error") {
|
if (device && device.status != "error") {
|
||||||
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/" + deviceId};
|
return {
|
||||||
|
"device": device,
|
||||||
|
"backendApiUri": devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/" + deviceId
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@ -1,470 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* graph */
|
|
||||||
|
|
||||||
.rickshaw_graph {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph svg {
|
|
||||||
display: block;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ticks */
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 0;
|
|
||||||
border-left: 1px dotted rgba(0, 0, 0, 0.2);
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick .title {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 12px;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
opacity: 0.5;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-left: 3px;
|
|
||||||
bottom: -20px;
|
|
||||||
height: auto;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* annotations */
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline {
|
|
||||||
height: 1px;
|
|
||||||
border-top: 1px solid #e0e0e0;
|
|
||||||
margin-top: 10px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation {
|
|
||||||
position: absolute;
|
|
||||||
height: 6px;
|
|
||||||
width: 6px;
|
|
||||||
margin-left: -2px;
|
|
||||||
top: -3px;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: rgba(0, 0, 0, 0.25);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_line {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: -6px;
|
|
||||||
width: 0;
|
|
||||||
border-left: 2px solid rgba(0, 0, 0, 0.3);
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_line.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_range {
|
|
||||||
background: rgba(0, 0, 0, 0.1);
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_range.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_range.active.offscreen {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation .content {
|
|
||||||
background: white;
|
|
||||||
color: black;
|
|
||||||
opacity: 0.9;
|
|
||||||
box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
|
|
||||||
border-radius: 3px;
|
|
||||||
position: relative;
|
|
||||||
z-index: 20;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 6px 8px 8px;
|
|
||||||
top: 18px;
|
|
||||||
left: -11px;
|
|
||||||
width: 160px;
|
|
||||||
display: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation .content:before {
|
|
||||||
content: "\25b2";
|
|
||||||
position: absolute;
|
|
||||||
top: -11px;
|
|
||||||
color: white;
|
|
||||||
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation.active,
|
|
||||||
.rickshaw_annotation_timeline .annotation:hover {
|
|
||||||
background-color: rgba(0, 0, 0, 0.8);
|
|
||||||
cursor: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation .content:hover {
|
|
||||||
z-index: 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation.active .content {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation:hover .content {
|
|
||||||
display: block;
|
|
||||||
z-index: 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_axis,
|
|
||||||
.rickshaw_graph .x_axis_d3 {
|
|
||||||
fill: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_ticks .tick line,
|
|
||||||
.rickshaw_graph .x_ticks_d3 .tick {
|
|
||||||
stroke: rgba(0, 0, 0, 0.16);
|
|
||||||
stroke-width: 2px;
|
|
||||||
shape-rendering: crisp-edges;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_grid .tick,
|
|
||||||
.rickshaw_graph .x_grid_d3 .tick {
|
|
||||||
z-index: -1;
|
|
||||||
stroke: rgba(0, 0, 0, 0.20);
|
|
||||||
stroke-width: 1px;
|
|
||||||
stroke-dasharray: 1 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_grid .tick[data-y-value="0"] {
|
|
||||||
stroke-dasharray: 1 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_grid path,
|
|
||||||
.rickshaw_graph .x_grid_d3 path {
|
|
||||||
fill: none;
|
|
||||||
stroke: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_ticks path,
|
|
||||||
.rickshaw_graph .x_ticks_d3 path {
|
|
||||||
fill: none;
|
|
||||||
stroke: #808080;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_ticks text,
|
|
||||||
.rickshaw_graph .x_ticks_d3 text {
|
|
||||||
opacity: 0.5;
|
|
||||||
font-size: 12px;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick.glow .title,
|
|
||||||
.rickshaw_graph .y_ticks.glow text {
|
|
||||||
fill: black;
|
|
||||||
color: black;
|
|
||||||
text-shadow: -1px 1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
1px -1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
1px 1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
0 1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
0 -1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
1px 0 0 rgba(255, 255, 255, 0.1),
|
|
||||||
-1px 0 0 rgba(255, 255, 255, 0.1),
|
|
||||||
-1px -1px 0 rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick.inverse .title,
|
|
||||||
.rickshaw_graph .y_ticks.inverse text {
|
|
||||||
fill: white;
|
|
||||||
color: white;
|
|
||||||
text-shadow: -1px 1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
1px -1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
1px 1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
0 1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
0 -1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
1px 0 0 rgba(0, 0, 0, 0.8),
|
|
||||||
-1px 0 0 rgba(0, 0, 0, 0.8),
|
|
||||||
-1px -1px 0 rgba(0, 0, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_rickshaw_graph {
|
|
||||||
position: relative;
|
|
||||||
left: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_y_axis {
|
|
||||||
position: absolute;
|
|
||||||
width: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_slider {
|
|
||||||
left: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_x_axis {
|
|
||||||
position: relative;
|
|
||||||
left: 40px;
|
|
||||||
height: 30px;
|
|
||||||
width: 97%;
|
|
||||||
top: 20px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chartWrapper {
|
|
||||||
padding-top: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*detail*/
|
|
||||||
|
|
||||||
.rickshaw_graph .detail {
|
|
||||||
pointer-events: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
z-index: 2;
|
|
||||||
background: rgba(0, 0, 0, 0.1);
|
|
||||||
bottom: 0;
|
|
||||||
width: 1px;
|
|
||||||
transition: opacity 0.25s linear;
|
|
||||||
-moz-transition: opacity 0.25s linear;
|
|
||||||
-o-transition: opacity 0.25s linear;
|
|
||||||
-webkit-transition: opacity 0.25s linear;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail.inactive {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.active {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .x_label {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 6px;
|
|
||||||
opacity: 0.5;
|
|
||||||
border: 1px solid #e0e0e0;
|
|
||||||
font-size: 12px;
|
|
||||||
position: absolute;
|
|
||||||
background: white;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .x_label.left {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .x_label.right {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 2;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 0.25em;
|
|
||||||
font-size: 12px;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
opacity: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.4);
|
|
||||||
color: white;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
|
||||||
margin-left: 1em;
|
|
||||||
margin-right: 1em;
|
|
||||||
margin-top: -1em;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.left {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.right {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.active {
|
|
||||||
opacity: 1;
|
|
||||||
background: rgba(0, 0, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item:after {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
|
|
||||||
content: "";
|
|
||||||
|
|
||||||
border: 5px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.left:after {
|
|
||||||
top: 1em;
|
|
||||||
left: -5px;
|
|
||||||
margin-top: -5px;
|
|
||||||
border-right-color: rgba(0, 0, 0, 0.8);
|
|
||||||
border-left-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.right:after {
|
|
||||||
top: 1em;
|
|
||||||
right: -5px;
|
|
||||||
margin-top: -5px;
|
|
||||||
border-left-color: rgba(0, 0, 0, 0.8);
|
|
||||||
border-right-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .dot {
|
|
||||||
width: 4px;
|
|
||||||
height: 4px;
|
|
||||||
margin-left: -3px;
|
|
||||||
margin-top: -3.5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
position: absolute;
|
|
||||||
box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
|
|
||||||
box-sizing: content-box;
|
|
||||||
-moz-box-sizing: content-box;
|
|
||||||
background: white;
|
|
||||||
border-width: 2px;
|
|
||||||
border-style: solid;
|
|
||||||
display: none;
|
|
||||||
background-clip: padding-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .dot.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*legend*/
|
|
||||||
.rickshaw_legend {
|
|
||||||
font-family: Arial;
|
|
||||||
font-size: 12px;
|
|
||||||
color: white;
|
|
||||||
background: #404040;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 12px 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
position: relative;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend:hover {
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .swatch {
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .line {
|
|
||||||
clear: both;
|
|
||||||
line-height: 140%;
|
|
||||||
padding-right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .line .swatch {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .label {
|
|
||||||
margin: 0;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline;
|
|
||||||
font-size: inherit;
|
|
||||||
background-color: transparent;
|
|
||||||
color: inherit;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: normal;
|
|
||||||
padding: 0;
|
|
||||||
text-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .action:hover {
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .action {
|
|
||||||
margin-right: 0.2em;
|
|
||||||
opacity: 0.2;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .line.disabled {
|
|
||||||
opacity: 0.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend ul {
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 2px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend li {
|
|
||||||
padding: 0 0 0 2px;
|
|
||||||
min-width: 80px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend li:hover {
|
|
||||||
background: rgba(255, 255, 255, 0.08);
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend li:active {
|
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend {
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend_container {
|
|
||||||
float: right;
|
|
||||||
padding-right: 10px;
|
|
||||||
width: 0;
|
|
||||||
z-index: 1;
|
|
||||||
position: relative;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spaced {
|
|
||||||
margin-top: 20px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -18,27 +18,20 @@
|
|||||||
|
|
||||||
var palette = new Rickshaw.Color.Palette({scheme: "classic9"});
|
var palette = new Rickshaw.Color.Palette({scheme: "classic9"});
|
||||||
|
|
||||||
function drawGraph(from, to) {
|
function drawGraph_virtual_firealarm(from, to) {
|
||||||
var backendApiUrl = $("#chart").data("backend-api-url") + "?from=" + from + "&to=" + to;
|
$("#y_axis").html("");
|
||||||
|
$("#smoother").html("");
|
||||||
|
$("#legend").html("");
|
||||||
|
$("#chart").html("");
|
||||||
|
$("#x_axis").html("");
|
||||||
|
$("#slider").html("");
|
||||||
|
|
||||||
var successCallback = function (data) {
|
var devices = $("#details").data("devices");
|
||||||
if (data) {
|
|
||||||
drawLineGraph(JSON.parse(data));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
invokerUtil.get(backendApiUrl, successCallback, function (message) {
|
|
||||||
console.log(message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawLineGraph(data) {
|
var tzOffset = new Date().getTimezoneOffset() * 60;
|
||||||
var chartWrapperElmId = "#div-chart";
|
|
||||||
var graphWidth = $(chartWrapperElmId).width() - 50;
|
var chartWrapperElmId = "#div-chart";
|
||||||
if (data.length == 0 || data.length == undefined) {
|
var graphWidth = $(chartWrapperElmId).width() - 50;
|
||||||
$("#chart").html("<br/>No data available...");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$("#chart").empty();
|
|
||||||
var graphConfig = {
|
var graphConfig = {
|
||||||
element: document.getElementById("chart"),
|
element: document.getElementById("chart"),
|
||||||
width: graphWidth,
|
width: graphWidth,
|
||||||
@ -53,47 +46,28 @@ function drawLineGraph(data) {
|
|||||||
series: []
|
series: []
|
||||||
};
|
};
|
||||||
|
|
||||||
var tzOffset = new Date().getTimezoneOffset() * 60;
|
if (devices) {
|
||||||
|
for (var i = 0; i < devices.length; i++) {
|
||||||
var min = Number.MAX_VALUE;
|
graphConfig['series'].push(
|
||||||
var max = Number.MIN_VALUE;
|
{
|
||||||
var range_min = 99999, range_max = 0;
|
'color': palette.color(),
|
||||||
var max_val = parseInt(data[0].values.temperature);
|
'data': [{
|
||||||
var min_val = max_val;
|
x: parseInt(new Date().getTime() / 1000),
|
||||||
var chartData = [];
|
y: 0
|
||||||
for (var i = 0; i < data.length; i++) {
|
}],
|
||||||
var y_val = parseInt(data[i].values.temperature);
|
'name': devices[i].name
|
||||||
if (y_val > max_val) {
|
});
|
||||||
max_val = y_val;
|
|
||||||
} else if (y_val < min_val) {
|
|
||||||
min_val = y_val;
|
|
||||||
}
|
}
|
||||||
chartData.push(
|
} else {
|
||||||
|
graphConfig['series'].push(
|
||||||
{
|
{
|
||||||
x: parseInt(data[i].values.time) - tzOffset,
|
'color': palette.color(),
|
||||||
y: y_val
|
'data': [{
|
||||||
}
|
x: parseInt(new Date().getTime() / 1000),
|
||||||
);
|
y: 0
|
||||||
}
|
}],
|
||||||
if (range_max < max_val) {
|
'name': $("#details").data("devicename")
|
||||||
range_max = max_val;
|
});
|
||||||
}
|
|
||||||
if (range_min > min_val) {
|
|
||||||
range_min = min_val;
|
|
||||||
}
|
|
||||||
graphConfig['series'].push(
|
|
||||||
{
|
|
||||||
'color': palette.color(),
|
|
||||||
'data': chartData,
|
|
||||||
'name': $("#details").data("devicename"),
|
|
||||||
'scale': d3.scale.linear().domain([Math.min(min, min_val), Math.max(max, max_val)])
|
|
||||||
.nice()
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (graphConfig['series'].length == 0) {
|
|
||||||
$(chartWrapperElmId).html("No data available...");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var graph = new Rickshaw.Graph(graphConfig);
|
var graph = new Rickshaw.Graph(graphConfig);
|
||||||
@ -106,13 +80,12 @@ function drawLineGraph(data) {
|
|||||||
|
|
||||||
xAxis.render();
|
xAxis.render();
|
||||||
|
|
||||||
var yAxis = new Rickshaw.Graph.Axis.Y.Scaled({
|
var yAxis = new Rickshaw.Graph.Axis.Y({
|
||||||
graph: graph,
|
graph: graph,
|
||||||
orientation: 'left',
|
orientation: 'left',
|
||||||
element: document.getElementById("y_axis"),
|
element: document.getElementById("y_axis"),
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 410,
|
height: 410
|
||||||
'scale': d3.scale.linear().domain([Math.min(min, range_min), Math.max(max, range_max)]).nice()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
yAxis.render();
|
yAxis.render();
|
||||||
@ -152,4 +125,59 @@ function drawLineGraph(data) {
|
|||||||
graph: graph,
|
graph: graph,
|
||||||
legend: legend
|
legend: legend
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var deviceIndex = 0;
|
||||||
|
|
||||||
|
if (devices) {
|
||||||
|
getData();
|
||||||
|
} else {
|
||||||
|
var backendApiUrl = $("#chart").data("backend-api-url") + "?from=" + from + "&to=" + to;
|
||||||
|
var successCallback = function (data) {
|
||||||
|
if (data) {
|
||||||
|
drawLineGraph(JSON.parse(data));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
invokerUtil.get(backendApiUrl, successCallback, function (message) {
|
||||||
|
console.log(message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getData() {
|
||||||
|
if (deviceIndex >= devices.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var backendApiUrl = $("#chart").data("backend-api-url") + devices[deviceIndex].deviceIdentifier
|
||||||
|
+ "?from=" + from + "&to=" + to;
|
||||||
|
var successCallback = function (data) {
|
||||||
|
if (data) {
|
||||||
|
drawLineGraph(JSON.parse(data));
|
||||||
|
}
|
||||||
|
deviceIndex++;
|
||||||
|
getData();
|
||||||
|
};
|
||||||
|
invokerUtil.get(backendApiUrl, successCallback, function (message) {
|
||||||
|
console.log(message);
|
||||||
|
deviceIndex++;
|
||||||
|
getData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawLineGraph(data) {
|
||||||
|
if (data.length === 0 || data.length === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var chartData = [];
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
chartData.push(
|
||||||
|
{
|
||||||
|
x: parseInt(data[i].values.time) - tzOffset,
|
||||||
|
y: parseInt(data[i].values.temperature)
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
graphConfig.series[deviceIndex].data = chartData;
|
||||||
|
graph.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,9 +1,8 @@
|
|||||||
{{#zone "topCss"}}
|
{{unit "cdmf.unit.lib.rickshaw-graph"}}
|
||||||
{{css "css/graph.css"}}
|
|
||||||
{{/zone}}
|
|
||||||
<div id="div-chart" data-websocketurl="{{websocketEndpoint}}">
|
<div id="div-chart" data-websocketurl="{{websocketEndpoint}}">
|
||||||
<div class="chartWrapper" id="chartWrapper">
|
<div class="chartWrapper" id="chartWrapper">
|
||||||
<div id="y_axis" class="custom_y_axis">Temperature</div>
|
<div id="y_axis" class="custom_y_axis" style="margin-top: -20px;">Temperature</div>
|
||||||
<div class="legend_container">
|
<div class="legend_container">
|
||||||
<div id="smoother" title="Smoothing"></div>
|
<div id="smoother" title="Smoothing"></div>
|
||||||
<div id="legend"></div>
|
<div id="legend"></div>
|
||||||
@ -21,8 +20,6 @@
|
|||||||
</a>
|
</a>
|
||||||
<!-- /statistics -->
|
<!-- /statistics -->
|
||||||
{{#zone "bottomJs"}}
|
{{#zone "bottomJs"}}
|
||||||
{{js "js/d3.min.js"}}
|
|
||||||
{{js "js/rickshaw.min.js"}}
|
|
||||||
{{js "js/moment.min.js"}}
|
{{js "js/moment.min.js"}}
|
||||||
{{js "js/socket.io.min.js"}}
|
{{js "js/socket.io.min.js"}}
|
||||||
{{js "js/device-stats.js"}}
|
{{js "js/device-stats.js"}}
|
||||||
|
|||||||
@ -1,471 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* graph */
|
|
||||||
|
|
||||||
.rickshaw_graph {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph svg {
|
|
||||||
display: block;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ticks */
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 0;
|
|
||||||
border-left: 1px dotted rgba(0, 0, 0, 0.2);
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick .title {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 12px;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
opacity: 0.5;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-left: 3px;
|
|
||||||
bottom: -20px;
|
|
||||||
height: auto;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* annotations */
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline {
|
|
||||||
height: 1px;
|
|
||||||
border-top: 1px solid #e0e0e0;
|
|
||||||
margin-top: 10px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation {
|
|
||||||
position: absolute;
|
|
||||||
height: 6px;
|
|
||||||
width: 6px;
|
|
||||||
margin-left: -2px;
|
|
||||||
top: -3px;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: rgba(0, 0, 0, 0.25);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_line {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: -6px;
|
|
||||||
width: 0;
|
|
||||||
border-left: 2px solid rgba(0, 0, 0, 0.3);
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_line.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_range {
|
|
||||||
background: rgba(0, 0, 0, 0.1);
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_range.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .annotation_range.active.offscreen {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation .content {
|
|
||||||
background: white;
|
|
||||||
color: black;
|
|
||||||
opacity: 0.9;
|
|
||||||
box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
|
|
||||||
border-radius: 3px;
|
|
||||||
position: relative;
|
|
||||||
z-index: 20;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 6px 8px 8px;
|
|
||||||
top: 18px;
|
|
||||||
left: -11px;
|
|
||||||
width: 160px;
|
|
||||||
display: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation .content:before {
|
|
||||||
content: "\25b2";
|
|
||||||
position: absolute;
|
|
||||||
top: -11px;
|
|
||||||
color: white;
|
|
||||||
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation.active,
|
|
||||||
.rickshaw_annotation_timeline .annotation:hover {
|
|
||||||
background-color: rgba(0, 0, 0, 0.8);
|
|
||||||
cursor: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation .content:hover {
|
|
||||||
z-index: 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation.active .content {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_annotation_timeline .annotation:hover .content {
|
|
||||||
display: block;
|
|
||||||
z-index: 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_axis,
|
|
||||||
.rickshaw_graph .x_axis_d3 {
|
|
||||||
fill: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_ticks .tick line,
|
|
||||||
.rickshaw_graph .x_ticks_d3 .tick {
|
|
||||||
stroke: rgba(0, 0, 0, 0.16);
|
|
||||||
stroke-width: 2px;
|
|
||||||
shape-rendering: crisp-edges;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_grid .tick,
|
|
||||||
.rickshaw_graph .x_grid_d3 .tick {
|
|
||||||
z-index: -1;
|
|
||||||
stroke: rgba(0, 0, 0, 0.20);
|
|
||||||
stroke-width: 1px;
|
|
||||||
stroke-dasharray: 1 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_grid .tick[data-y-value="0"] {
|
|
||||||
stroke-dasharray: 1 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_grid path,
|
|
||||||
.rickshaw_graph .x_grid_d3 path {
|
|
||||||
fill: none;
|
|
||||||
stroke: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_ticks path,
|
|
||||||
.rickshaw_graph .x_ticks_d3 path {
|
|
||||||
fill: none;
|
|
||||||
stroke: #808080;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .y_ticks text,
|
|
||||||
.rickshaw_graph .x_ticks_d3 text {
|
|
||||||
opacity: 0.5;
|
|
||||||
font-size: 12px;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick.glow .title,
|
|
||||||
.rickshaw_graph .y_ticks.glow text {
|
|
||||||
fill: black;
|
|
||||||
color: black;
|
|
||||||
text-shadow: -1px 1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
1px -1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
1px 1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
0 1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
0 -1px 0 rgba(255, 255, 255, 0.1),
|
|
||||||
1px 0 0 rgba(255, 255, 255, 0.1),
|
|
||||||
-1px 0 0 rgba(255, 255, 255, 0.1),
|
|
||||||
-1px -1px 0 rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .x_tick.inverse .title,
|
|
||||||
.rickshaw_graph .y_ticks.inverse text {
|
|
||||||
fill: white;
|
|
||||||
color: white;
|
|
||||||
text-shadow: -1px 1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
1px -1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
1px 1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
0 1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
0 -1px 0 rgba(0, 0, 0, 0.8),
|
|
||||||
1px 0 0 rgba(0, 0, 0, 0.8),
|
|
||||||
-1px 0 0 rgba(0, 0, 0, 0.8),
|
|
||||||
-1px -1px 0 rgba(0, 0, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_rickshaw_graph {
|
|
||||||
position: relative;
|
|
||||||
left: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_y_axis {
|
|
||||||
position: absolute;
|
|
||||||
width: 40px;
|
|
||||||
margin-top: -20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_slider {
|
|
||||||
left: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom_x_axis {
|
|
||||||
position: relative;
|
|
||||||
left: 40px;
|
|
||||||
height: 30px;
|
|
||||||
width: 97%;
|
|
||||||
top: 20px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chartWrapper {
|
|
||||||
padding-top: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*detail*/
|
|
||||||
|
|
||||||
.rickshaw_graph .detail {
|
|
||||||
pointer-events: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
z-index: 2;
|
|
||||||
background: rgba(0, 0, 0, 0.1);
|
|
||||||
bottom: 0;
|
|
||||||
width: 1px;
|
|
||||||
transition: opacity 0.25s linear;
|
|
||||||
-moz-transition: opacity 0.25s linear;
|
|
||||||
-o-transition: opacity 0.25s linear;
|
|
||||||
-webkit-transition: opacity 0.25s linear;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail.inactive {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.active {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .x_label {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 6px;
|
|
||||||
opacity: 0.5;
|
|
||||||
border: 1px solid #e0e0e0;
|
|
||||||
font-size: 12px;
|
|
||||||
position: absolute;
|
|
||||||
background: white;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .x_label.left {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .x_label.right {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 2;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 0.25em;
|
|
||||||
font-size: 12px;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
opacity: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.4);
|
|
||||||
color: white;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
|
||||||
margin-left: 1em;
|
|
||||||
margin-right: 1em;
|
|
||||||
margin-top: -1em;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.left {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.right {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.active {
|
|
||||||
opacity: 1;
|
|
||||||
background: rgba(0, 0, 0, 0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item:after {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
|
|
||||||
content: "";
|
|
||||||
|
|
||||||
border: 5px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.left:after {
|
|
||||||
top: 1em;
|
|
||||||
left: -5px;
|
|
||||||
margin-top: -5px;
|
|
||||||
border-right-color: rgba(0, 0, 0, 0.8);
|
|
||||||
border-left-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .item.right:after {
|
|
||||||
top: 1em;
|
|
||||||
right: -5px;
|
|
||||||
margin-top: -5px;
|
|
||||||
border-left-color: rgba(0, 0, 0, 0.8);
|
|
||||||
border-right-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .dot {
|
|
||||||
width: 4px;
|
|
||||||
height: 4px;
|
|
||||||
margin-left: -3px;
|
|
||||||
margin-top: -3.5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
position: absolute;
|
|
||||||
box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
|
|
||||||
box-sizing: content-box;
|
|
||||||
-moz-box-sizing: content-box;
|
|
||||||
background: white;
|
|
||||||
border-width: 2px;
|
|
||||||
border-style: solid;
|
|
||||||
display: none;
|
|
||||||
background-clip: padding-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_graph .detail .dot.active {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*legend*/
|
|
||||||
.rickshaw_legend {
|
|
||||||
font-family: Arial;
|
|
||||||
font-size: 12px;
|
|
||||||
color: white;
|
|
||||||
background: #404040;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 12px 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
position: relative;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend:hover {
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .swatch {
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .line {
|
|
||||||
clear: both;
|
|
||||||
line-height: 140%;
|
|
||||||
padding-right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .line .swatch {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .label {
|
|
||||||
margin: 0;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline;
|
|
||||||
font-size: inherit;
|
|
||||||
background-color: transparent;
|
|
||||||
color: inherit;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: normal;
|
|
||||||
padding: 0;
|
|
||||||
text-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .action:hover {
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .action {
|
|
||||||
margin-right: 0.2em;
|
|
||||||
opacity: 0.2;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend .line.disabled {
|
|
||||||
opacity: 0.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend ul {
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 2px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend li {
|
|
||||||
padding: 0 0 0 2px;
|
|
||||||
min-width: 80px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend li:hover {
|
|
||||||
background: rgba(255, 255, 255, 0.08);
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rickshaw_legend li:active {
|
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend {
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legend_container {
|
|
||||||
float: right;
|
|
||||||
padding-right: 10px;
|
|
||||||
width: 0;
|
|
||||||
z-index: 1;
|
|
||||||
position: relative;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spaced {
|
|
||||||
margin-top: 20px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -35,6 +35,7 @@ $(window).load(function () {
|
|||||||
width: $("#div-chart").width() - 50,
|
width: $("#div-chart").width() - 50,
|
||||||
height: 300,
|
height: 300,
|
||||||
renderer: "line",
|
renderer: "line",
|
||||||
|
interpolation: "linear",
|
||||||
padding: {top: 0.2, left: 0.0, right: 0.0, bottom: 0.2},
|
padding: {top: 0.2, left: 0.0, right: 0.0, bottom: 0.2},
|
||||||
xScale: d3.time.scale(),
|
xScale: d3.time.scale(),
|
||||||
series: [{
|
series: [{
|
||||||
|
|||||||
@ -1,21 +1,3 @@
|
|||||||
/*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//! moment.js
|
//! moment.js
|
||||||
//! version : 2.10.2
|
//! version : 2.10.2
|
||||||
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -41,7 +41,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.5.5</version>
|
<version>2.5.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
|
<finalName>${project.artifactId}-${carbon.devicemgt.plugins.version}</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
|||||||
@ -207,7 +207,7 @@
|
|||||||
</bundles>
|
</bundles>
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
<includedFeatures>
|
<includedFeatures>
|
||||||
<includedFeatureDef>
|
<includedFeatureDef>
|
||||||
|
|||||||
@ -197,7 +197,7 @@
|
|||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}
|
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
<includedFeatures>
|
<includedFeatures>
|
||||||
|
|||||||
@ -28,8 +28,6 @@ void readControls() {
|
|||||||
client.fastrprint(F("\n"));
|
client.fastrprint(F("\n"));
|
||||||
client.fastrprint(host.c_str());client.fastrprint(F("\n"));
|
client.fastrprint(host.c_str());client.fastrprint(F("\n"));
|
||||||
client.fastrprint(F("Authorization: Bearer ")); client.fastrprint(F(DEVICE_TOKEN)); client.fastrprint(F("\n"));
|
client.fastrprint(F("Authorization: Bearer ")); client.fastrprint(F(DEVICE_TOKEN)); client.fastrprint(F("\n"));
|
||||||
client.fastrprint(F("Content-Type: application/json")); client.fastrprint(F("\n"));
|
|
||||||
client.fastrprint(F("Accept: application/json")); client.fastrprint(F("\n"));
|
|
||||||
client.fastrprint(F("\n"));
|
client.fastrprint(F("\n"));
|
||||||
client.fastrprint(F("protocol: HTTP\n"));
|
client.fastrprint(F("protocol: HTTP\n"));
|
||||||
|
|
||||||
@ -77,6 +75,7 @@ void readControls() {
|
|||||||
digitalWrite(6, LOW);
|
digitalWrite(6, LOW);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
responseMsg = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -156,7 +156,7 @@
|
|||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}
|
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -196,7 +196,7 @@
|
|||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}
|
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
<includedFeatures>
|
<includedFeatures>
|
||||||
|
|||||||
@ -240,7 +240,7 @@
|
|||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}
|
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
<includedFeatures>
|
<includedFeatures>
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
define stream fireAlarmEventStream (deviceID string, temp int);
|
||||||
|
from fireAlarmEventStream#window.time(7886776 sec)
|
||||||
|
select deviceID, max(temp) as maxValue
|
||||||
|
group by deviceID
|
||||||
|
insert into analyzeStream for expired-events;
|
||||||
|
from analyzeStream[maxValue < 88]
|
||||||
|
select maxValue
|
||||||
|
insert into bulbOnStream;
|
||||||
|
from fireAlarmEventStream[temp > 1093]
|
||||||
|
select deviceID, temp
|
||||||
|
insert into bulbOffStream;
|
||||||
@ -192,7 +192,7 @@
|
|||||||
</adviceFile>
|
</adviceFile>
|
||||||
<bundles>
|
<bundles>
|
||||||
<bundleDef>
|
<bundleDef>
|
||||||
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android:${carbon.mobile.device.mgt.version}
|
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android:${carbon.devicemgt.plugins.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
</bundles>
|
</bundles>
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
@ -200,7 +200,7 @@
|
|||||||
org.wso2.carbon.core.server:${carbon.kernel.version}
|
org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
<importFeatureDef>
|
<importFeatureDef>
|
||||||
org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}
|
org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -141,13 +141,13 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</adviceFile>
|
</adviceFile>
|
||||||
<bundles>
|
<bundles>
|
||||||
<bundleDef>org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile:${carbon.mobile.device.mgt.version}</bundleDef>
|
<bundleDef>org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile:${carbon.devicemgt.plugins.version}</bundleDef>
|
||||||
<bundleDef>org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.url.printer:${carbon.mobile.device.mgt.version}</bundleDef>
|
<bundleDef>org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.url.printer:${carbon.devicemgt.plugins.version}</bundleDef>
|
||||||
</bundles>
|
</bundles>
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}</importFeatureDef>
|
||||||
<importFeatureDef>org.wso2.carbon.device.mgt.extensions:${carbon.device.mgt.version}</importFeatureDef>
|
<importFeatureDef>org.wso2.carbon.device.mgt.extensions:${carbon.devicemgt.version}</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|||||||
@ -192,7 +192,7 @@
|
|||||||
</adviceFile>
|
</adviceFile>
|
||||||
<bundles>
|
<bundles>
|
||||||
<bundleDef>
|
<bundleDef>
|
||||||
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.windows:${carbon.mobile.device.mgt.version}
|
org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.windows:${carbon.devicemgt.plugins.version}
|
||||||
</bundleDef>
|
</bundleDef>
|
||||||
</bundles>
|
</bundles>
|
||||||
<importFeatures>
|
<importFeatures>
|
||||||
@ -200,7 +200,7 @@
|
|||||||
org.wso2.carbon.core.server:${carbon.kernel.version}
|
org.wso2.carbon.core.server:${carbon.kernel.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
<importFeatureDef>
|
<importFeatureDef>
|
||||||
org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version}
|
org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
|
||||||
</importFeatureDef>
|
</importFeatureDef>
|
||||||
</importFeatures>
|
</importFeatures>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
44
pom.xml
44
pom.xml
@ -213,54 +213,54 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.policy.mgt.common</artifactId>
|
<artifactId>org.wso2.carbon.policy.mgt.common</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId>
|
||||||
<type>zip</type>
|
<type>zip</type>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.extensions.feature</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.extensions.feature</artifactId>
|
||||||
<type>zip</type>
|
<type>zip</type>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
|
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.dynamic.client.registration</artifactId>
|
<artifactId>org.wso2.carbon.dynamic.client.registration</artifactId>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.devicemgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
@ -431,46 +431,46 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile.api</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile.api</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile.url.printer</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile.url.printer</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Android dependencies-->
|
<!--Android dependencies-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile.android</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile.android</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile.android.api</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile.android.api</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Windows dependencies-->
|
<!--Windows dependencies-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile.windows</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile.windows</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.mobile.windows.api</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.mobile.windows.api</artifactId>
|
||||||
<version>${carbon.mobile.device.mgt.version}</version>
|
<version>${carbon.devicemgt.plugins.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Osgi dependencies-->
|
<!--Osgi dependencies-->
|
||||||
@ -1028,6 +1028,7 @@
|
|||||||
|
|
||||||
<!-- Carbon Device Management -->
|
<!-- Carbon Device Management -->
|
||||||
<carbon.devicemgt.version>1.1.0-SNAPSHOT</carbon.devicemgt.version>
|
<carbon.devicemgt.version>1.1.0-SNAPSHOT</carbon.devicemgt.version>
|
||||||
|
<carbon.devicemgt.version.range>[0.8.0, 2.0.0)</carbon.devicemgt.version.range>
|
||||||
|
|
||||||
<!-- Carbon Device Management Plugins -->
|
<!-- Carbon Device Management Plugins -->
|
||||||
<carbon.devicemgt.plugins.version>2.1.0-SNAPSHOT</carbon.devicemgt.plugins.version>
|
<carbon.devicemgt.plugins.version>2.1.0-SNAPSHOT</carbon.devicemgt.plugins.version>
|
||||||
@ -1051,16 +1052,9 @@
|
|||||||
<!-- Carbon Governance -->
|
<!-- Carbon Governance -->
|
||||||
<carbon.governance.version>4.5.8</carbon.governance.version>
|
<carbon.governance.version>4.5.8</carbon.governance.version>
|
||||||
|
|
||||||
<!-- Carbon Device Management -->
|
|
||||||
<carbon.device.mgt.version>1.1.0-SNAPSHOT</carbon.device.mgt.version>
|
|
||||||
<carbon.device.mgt.version.range>[0.8.0, 2.0.0)</carbon.device.mgt.version.range>
|
|
||||||
|
|
||||||
<!-- Carbon API Management -->
|
<!-- Carbon API Management -->
|
||||||
<carbon.api.mgt.version>5.0.3</carbon.api.mgt.version>
|
<carbon.api.mgt.version>5.0.3</carbon.api.mgt.version>
|
||||||
|
|
||||||
<!-- Mobile Device Management -->
|
|
||||||
<carbon.mobile.device.mgt.version>2.1.0-SNAPSHOT</carbon.mobile.device.mgt.version>
|
|
||||||
|
|
||||||
<!-- XMPP/MQTT Version -->
|
<!-- XMPP/MQTT Version -->
|
||||||
<smack.wso2.version>3.0.4.wso2v1</smack.wso2.version>
|
<smack.wso2.version>3.0.4.wso2v1</smack.wso2.version>
|
||||||
<smackx.wso2.version>3.0.4.wso2v1</smackx.wso2.version>
|
<smackx.wso2.version>3.0.4.wso2v1</smackx.wso2.version>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user