Skip to content

Commit

Permalink
feat: Rename Analytics Artifacts - MEED-6999 - Meeds-io/meeds#2097 (#498
Browse files Browse the repository at this point in the history
)
  • Loading branch information
boubaker authored and rdenarie committed Jun 13, 2024
1 parent aa8d188 commit ffae340
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion kudos-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</properties>
<dependencies>
<dependency>
<groupId>org.exoplatform.addons.analytics</groupId>
<groupId>io.meeds.analytics</groupId>
<artifactId>analytics-api</artifactId>
<scope>provided</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
*/
package org.exoplatform.kudos.listener.analytics;

import static org.exoplatform.analytics.utils.AnalyticsUtils.addSpaceStatistics;
import static org.exoplatform.analytics.utils.AnalyticsUtils.getIdentity;
import static io.meeds.analytics.utils.AnalyticsUtils.addSpaceStatistics;
import static io.meeds.analytics.utils.AnalyticsUtils.getIdentity;

import org.apache.commons.lang3.StringUtils;

import org.exoplatform.analytics.model.StatisticData;
import org.exoplatform.analytics.utils.AnalyticsUtils;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.kudos.model.Kudos;
import org.exoplatform.kudos.service.KudosService;
import org.exoplatform.services.listener.*;
import org.exoplatform.services.listener.Asynchronous;
import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.Listener;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.social.core.activity.model.ActivityStream;
Expand All @@ -42,6 +42,9 @@
import org.exoplatform.social.core.space.model.Space;
import org.exoplatform.social.core.space.spi.SpaceService;

import io.meeds.analytics.model.StatisticData;
import io.meeds.analytics.utils.AnalyticsUtils;

@Asynchronous
public class KudosSentListener extends Listener<KudosService, Kudos> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
import org.exoplatform.webui.utils.TimeConvertUtils;

public class KudosTemplateBuilder extends AbstractTemplateBuilder {

private static final String ACTIVITY_PARAM = "ACTIVITY";

private TemplateProvider templateProvider;

private boolean pushNotification;
Expand Down Expand Up @@ -68,7 +71,7 @@ protected MessageInfo makeMessage(NotificationContext ctx) { // NOSONAR
templateContext.put("LAST_UPDATED_TIME",
TimeConvertUtils.convertXTimeAgoByTimeServer(cal.getTime(),
"EE, dd yyyy",
new Locale(language),
Locale.of(language),
TimeConvertUtils.YEAR));

Identity senderIdentity = Utils.getIdentityManager()
Expand Down Expand Up @@ -130,16 +133,16 @@ protected MessageInfo makeMessage(NotificationContext ctx) { // NOSONAR
if (activity != null) {
if (StringUtils.isNotBlank(activity.getParentCommentId())) {
String parentCommentTitle = getActivityTitle(activity.getParentCommentId(), language);
templateContext.put("ACTIVITY", parentCommentTitle);
templateContext.put(ACTIVITY_PARAM, parentCommentTitle);
} else if (StringUtils.isNotBlank(activity.getParentId())) {
String parentActivityTitle = getActivityTitle(activity.getParentId(), language);
templateContext.put("ACTIVITY", parentActivityTitle);
templateContext.put(ACTIVITY_PARAM, parentActivityTitle);
} else {
templateContext.put("ACTIVITY", "");
templateContext.put(ACTIVITY_PARAM, "");
}
messageInfo.body(TemplateUtils.processGroovy(templateContext));
} else {
templateContext.put("ACTIVITY", "");
templateContext.put(ACTIVITY_PARAM, "");
messageInfo.body(TemplateUtils.processGroovy(templateContext));
}
ctx.setException(templateContext.getException());
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- 3rd party libraries versions -->
<org.exoplatform.social.version>7.0.x-exo-SNAPSHOT</org.exoplatform.social.version>
<org.exoplatform.platform-ui.version>7.0.x-exo-SNAPSHOT</org.exoplatform.platform-ui.version>
<addon.exo.analytics.version>7.0.x-exo-SNAPSHOT</addon.exo.analytics.version>
<addon.meeds.analytics.version>7.0.x-exo-SNAPSHOT</addon.meeds.analytics.version>

<!-- **************************************** -->
<!-- Jenkins Settings -->
Expand Down Expand Up @@ -59,9 +59,9 @@
</dependency>

<dependency>
<groupId>org.exoplatform.addons.analytics</groupId>
<groupId>io.meeds.analytics</groupId>
<artifactId>analytics-parent</artifactId>
<version>${addon.exo.analytics.version}</version>
<version>${addon.meeds.analytics.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down

0 comments on commit ffae340

Please sign in to comment.