Skip to content

Commit

Permalink
feat: Rename Analytics Artifacts - MEED-6999 - Meeds-io/meeds#2097
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker committed Jun 7, 2024
1 parent 260f87f commit 0b539c8
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</dependency>
<!-- Import versions from analytics project -->
<dependency>
<groupId>org.exoplatform.addons.analytics</groupId>
<groupId>io.meeds.analytics</groupId>
<artifactId>analytics-parent</artifactId>
<version>${addon.exo.analytics.version}</version>
<type>pom</type>
Expand Down
4 changes: 2 additions & 2 deletions services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@

<!--Analytics API -->
<dependency>
<groupId>org.exoplatform.addons.analytics</groupId>
<groupId>io.meeds.analytics</groupId>
<artifactId>analytics-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.exoplatform.addons.analytics</groupId>
<groupId>io.meeds.analytics</groupId>
<artifactId>analytics-listeners</artifactId>
<scope>provided</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> supportedObjectType;

public TaskAttachmentAnalyticsListener(AttachmentService attachmentService,
SpaceService spaceService,
InitParams initParam) {
this.attachmentService = attachmentService;
this.spaceService = spaceService;
this.supportedObjectType = initParam.getValuesParam("supported-type").getValues();
}

@Override
Expand All @@ -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";
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
*/
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 java.util.stream.Collectors;

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;
Expand Down

0 comments on commit 0b539c8

Please sign in to comment.