From 81e57ce78fd26d3fc83ec755c1850cb176353cd4 Mon Sep 17 00:00:00 2001 From: osh Date: Thu, 10 Aug 2023 13:01:41 +0530 Subject: [PATCH] Retrieve extra details --- .../GenericSubscriptionDAOImpl.java | 5 ++- .../application/mgt/core/util/DAOUtil.java | 3 ++ .../impl/ActivityProviderServiceImpl.java | 3 ++ .../mgt/common/operation/mgt/Activity.java | 36 +++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index 429ecc1e35..457de13bee 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -1441,9 +1441,12 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc try { String sql = "SELECT " + "AP.NAME, " + + "AP.TYPE, " + "AR.PACKAGE_NAME, " + + "AR.VERSION, " + "DS.SUBSCRIBED_BY, " - + "DS.STATUS " + + "DS.STATUS, " + + "DS.ACTION_TRIGGERED_FROM " + "FROM AP_APP_SUB_OP_MAPPING SOP " + "JOIN AP_DEVICE_SUBSCRIPTION DS ON SOP.AP_DEVICE_SUBSCRIPTION_ID = DS.ID " + "JOIN AP_APP_RELEASE AR ON DS.AP_APP_RELEASE_ID = AR.ID " diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java index ede8d7ff6d..a41f48e1e9 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java @@ -380,9 +380,12 @@ public class DAOUtil { while (rs.next()) { Activity activity = new Activity(); activity.setAppName(rs.getString("NAME")); + activity.setAppType(rs.getString("TYPE")); activity.setUsername(rs.getString("SUBSCRIBED_BY")); activity.setPackageName(rs.getString("PACKAGE_NAME")); activity.setStatus(rs.getString("STATUS")); + activity.setVersion(rs.getString("VERSION")); + activity.setTriggeredBy(rs.getString("ACTION_TRIGGERED_FROM")); activities.add(activity); } return activities; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java index 60272d589f..d9fec4b91b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java @@ -174,6 +174,9 @@ public class ActivityProviderServiceImpl implements ActivityInfoProviderService activity.setPackageName(appActivity.getPackageName()); activity.setAppName(appActivity.getAppName()); activity.setStatus(appActivity.getStatus()); + activity.setAppType(appActivity.getAppType()); + activity.setVersion(appActivity.getVersion()); + activity.setTriggeredBy(appActivity.getTriggeredBy()); } else { String msg = "Cannot find the app details related to the operation "; log.error(msg); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/Activity.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/Activity.java index e9874778d9..e001d72929 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/Activity.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/Activity.java @@ -93,6 +93,18 @@ public class Activity { value = "Status of app install") private String status; + @ApiModelProperty(name = "version", + value = "Version of app") + private String version; + + @ApiModelProperty(name = "triggeredBy", + value = "Operation triggered by what") + private String triggeredBy; + + @ApiModelProperty(name = "appType", + value = "Type of application") + private String appType; + public String getActivityId() { return activityId; @@ -173,5 +185,29 @@ public class Activity { public void setStatus(String status) { this.status = status; } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getTriggeredBy() { + return triggeredBy; + } + + public void setTriggeredBy(String triggeredBy) { + this.triggeredBy = triggeredBy; + } + + public String getAppType() { + return appType; + } + + public void setAppType(String appType) { + this.appType = appType; + } }