From 0b539c825760f4249cdc0d0a494434dca52dba63 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Fri, 7 Jun 2024 18:28:01 +0100 Subject: [PATCH] feat: Rename Analytics Artifacts - MEED-6999 - Meeds-io/meeds#2097 --- pom.xml | 2 +- services/pom.xml | 4 +-- .../TaskAttachmentAnalyticsListener.java | 32 +++++++++++++++---- .../analytics/TaskCommentListener.java | 6 ++-- .../listener/analytics/TaskLabelListener.java | 4 +-- .../listener/analytics/TaskSavedListener.java | 6 ++-- 6 files changed, 36 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 026dc11ae..f04746c63 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ - org.exoplatform.addons.analytics + io.meeds.analytics analytics-parent ${addon.exo.analytics.version} pom diff --git a/services/pom.xml b/services/pom.xml index d2486c465..ba16dfaba 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -47,12 +47,12 @@ - org.exoplatform.addons.analytics + io.meeds.analytics analytics-api provided - org.exoplatform.addons.analytics + io.meeds.analytics analytics-listeners provided diff --git a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskAttachmentAnalyticsListener.java b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskAttachmentAnalyticsListener.java index c57a6c813..c919a4f43 100644 --- a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskAttachmentAnalyticsListener.java +++ b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskAttachmentAnalyticsListener.java @@ -18,18 +18,36 @@ */ package org.exoplatform.tasks.listener.analytics; -import org.exoplatform.analytics.model.StatisticData; +import java.util.List; + import org.exoplatform.container.xml.InitParams; import org.exoplatform.services.listener.Asynchronous; import org.exoplatform.social.attachment.AttachmentService; import org.exoplatform.social.attachment.model.ObjectAttachmentId; import org.exoplatform.social.core.space.spi.SpaceService; -import org.exoplatform.analytics.listener.social.BaseAttachmentAnalyticsListener; + +import io.meeds.analytics.listener.social.BaseAttachmentAnalyticsListener; + +import lombok.Getter; @Asynchronous public class TaskAttachmentAnalyticsListener extends BaseAttachmentAnalyticsListener { - public TaskAttachmentAnalyticsListener(AttachmentService attachmentService, SpaceService spaceService, InitParams initParam) { - super(attachmentService, spaceService, initParam); + + @Getter + private AttachmentService attachmentService; + + @Getter + private SpaceService spaceService; + + @Getter + private List supportedObjectType; + + public TaskAttachmentAnalyticsListener(AttachmentService attachmentService, + SpaceService spaceService, + InitParams initParam) { + this.attachmentService = attachmentService; + this.spaceService = spaceService; + this.supportedObjectType = initParam.getValuesParam("supported-type").getValues(); } @Override @@ -40,9 +58,9 @@ protected String getModule(ObjectAttachmentId objectAttachment) { @Override protected String getSubModule(ObjectAttachmentId objectAttachment) { return switch (objectAttachment.getObjectType()) { - case "task" -> "taskDescription"; - case "taskComment" -> "taskComment"; - default -> "task"; + case "task" -> "taskDescription"; + case "taskComment" -> "taskComment"; + default -> "task"; }; } } diff --git a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskCommentListener.java b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskCommentListener.java index cb4d72ceb..5bd825493 100644 --- a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskCommentListener.java +++ b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskCommentListener.java @@ -18,15 +18,15 @@ */ package org.exoplatform.tasks.listener.analytics; -import static org.exoplatform.analytics.utils.AnalyticsUtils.addSpaceStatistics; +import static io.meeds.analytics.utils.AnalyticsUtils.addSpaceStatistics; import java.util.*; import java.util.concurrent.CompletableFuture; import org.apache.commons.lang3.StringUtils; -import org.exoplatform.analytics.model.StatisticData; -import org.exoplatform.analytics.utils.AnalyticsUtils; +import io.meeds.analytics.model.StatisticData; +import io.meeds.analytics.utils.AnalyticsUtils; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.container.PortalContainer; import org.exoplatform.container.component.RequestLifeCycle; diff --git a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskLabelListener.java b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskLabelListener.java index 7601ab4dd..6a98621bb 100644 --- a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskLabelListener.java +++ b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskLabelListener.java @@ -18,8 +18,8 @@ */ package org.exoplatform.tasks.listener.analytics; -import org.exoplatform.analytics.model.StatisticData; -import org.exoplatform.analytics.utils.AnalyticsUtils; +import io.meeds.analytics.model.StatisticData; +import io.meeds.analytics.utils.AnalyticsUtils; import org.exoplatform.commons.api.persistence.ExoTransactional; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.container.PortalContainer; diff --git a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskSavedListener.java b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskSavedListener.java index fe1cb5b65..35f19ca47 100644 --- a/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskSavedListener.java +++ b/services/src/main/java/org/exoplatform/tasks/listener/analytics/TaskSavedListener.java @@ -18,7 +18,7 @@ */ package org.exoplatform.tasks.listener.analytics; -import static org.exoplatform.analytics.utils.AnalyticsUtils.addSpaceStatistics; +import static io.meeds.analytics.utils.AnalyticsUtils.addSpaceStatistics; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -26,8 +26,8 @@ import org.apache.commons.lang3.StringUtils; -import org.exoplatform.analytics.model.StatisticData; -import org.exoplatform.analytics.utils.AnalyticsUtils; +import io.meeds.analytics.model.StatisticData; +import io.meeds.analytics.utils.AnalyticsUtils; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.container.PortalContainer; import org.exoplatform.container.component.RequestLifeCycle;