From abb3aea9a99c56df3c5a165a7ce6214ce64d381e Mon Sep 17 00:00:00 2001 From: kamidu Date: Tue, 30 Aug 2016 16:36:26 +0530 Subject: [PATCH] fixes for notification isses --- .../common/notification/mgt/Notification.java | 29 ++++++++++++++++++- .../mgt/dao/util/NotificationDAOUtil.java | 2 ++ .../public/templates/notification-listing.hbs | 4 +-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/notification/mgt/Notification.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/notification/mgt/Notification.java index c5c2656fc62..3a383b19dc9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/notification/mgt/Notification.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/notification/mgt/Notification.java @@ -21,7 +21,6 @@ package org.wso2.carbon.device.mgt.common.notification.mgt; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; /** * DTO of Notification object which is used to communicate Operation notifications to MDM core. @@ -58,6 +57,16 @@ public class Notification { "CHECKED: The message is in the read state.", required = true) private Status status; + @JsonProperty(value = "deviceIdentifier", required = false) + @ApiModelProperty(name = "deviceIdentifier", value = "Defines the device ID related to the notification.", + required = false) + private String deviceIdentifier; + + @JsonProperty(value = "devieType", required = false) + @ApiModelProperty(name = "devieType", value = "Defines the device type related to the notification.", + required = false) + private String deviceType; + public Status getStatus() { return status; } @@ -90,6 +99,22 @@ public class Notification { this.operationId = operationId; } + public String getDeviceIdentifier() { + return deviceIdentifier; + } + + public void setDeviceIdentifier(String deviceIdentifier) { + this.deviceIdentifier = deviceIdentifier; + } + + public String getDevcieType() { + return deviceType; + } + + public void setDeviceType(String devieType) { + this.deviceType = devieType; + } + @Override public String toString() { return "notification {" + @@ -97,6 +122,8 @@ public class Notification { ", status=" + status + ", description='" + description + '\'' + ", operationId='" + operationId + '\'' + + ", deviceIdentifier='" + deviceIdentifier + '\'' + + ", deviceType='" + deviceType + '\'' + '}'; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java index 36f7df6be0a..daa5c37d29c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java @@ -131,6 +131,8 @@ public class NotificationDAOUtil { notification.setOperationId(rs.getInt("OPERATION_ID")); notification.setDescription(rs.getString("DESCRIPTION")); notification.setStatus(rs.getString("STATUS")); + notification.setDeviceIdentifier(rs.getString("DEVICE_IDENTIFICATION")); + notification.setDeviceType(rs.getString("DEVICE_TYPE")); return notification; } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs index 39d96b17e8b..4f98c03e9be 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs @@ -19,7 +19,7 @@ {{description}} - + @@ -57,7 +57,7 @@ {{description}} - +