Skip to content

Commit

Permalink
Merge Spring Integration - Meeds-io/MIPs#57 (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker committed Jan 11, 2024
2 parents 29ab631 + 59be4ce commit f864dae
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 57 deletions.
2 changes: 1 addition & 1 deletion perk-store-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<rest.api.doc.version>1.0</rest.api.doc.version>
<rest.api.doc.description>Perk Store addon rest endpoints</rest.api.doc.description>

<exo.test.coverage.ratio>0.61</exo.test.coverage.ratio>
<exo.test.coverage.ratio>0.53</exo.test.coverage.ratio>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import java.time.temporal.ChronoUnit;
import java.util.*;

import javax.persistence.TypedQuery;
import jakarta.persistence.TypedQuery;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl;
import org.exoplatform.perkstore.entity.ProductOrderEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
/*
* This file is part of the Meeds project (https://meeds.io/).
* Copyright (C) 2020 Meeds Association
* contact@meeds.io
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.exoplatform.perkstore.dao;

import java.util.List;

import javax.persistence.TypedQuery;

import org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl;
import org.exoplatform.perkstore.entity.ProductEntity;

public class PerkStoreProductDAO extends GenericDAOJPAImpl<ProductEntity, Long> {
@Override
public void deleteAll() {
throw new UnsupportedOperationException();
}

@Override
public void deleteAll(List<ProductEntity> entities) {
throw new UnsupportedOperationException();
}

public List<ProductEntity> getAllProducts() {
TypedQuery<ProductEntity> query = getEntityManager().createNamedQuery("Product.getAllProducts", ProductEntity.class);
return query.getResultList();
}

}
/*
* This file is part of the Meeds project (https://meeds.io/).
* Copyright (C) 2020 Meeds Association
* contact@meeds.io
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.exoplatform.perkstore.dao;

import java.util.List;

import jakarta.persistence.TypedQuery;

import org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl;
import org.exoplatform.perkstore.entity.ProductEntity;

public class PerkStoreProductDAO extends GenericDAOJPAImpl<ProductEntity, Long> {
@Override
public void deleteAll() {
throw new UnsupportedOperationException();
}

@Override
public void deleteAll(List<ProductEntity> entities) {
throw new UnsupportedOperationException();
}

public List<ProductEntity> getAllProducts() {
TypedQuery<ProductEntity> query = getEntityManager().createNamedQuery("Product.getAllProducts", ProductEntity.class);
return query.getResultList();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;
import java.util.Set;

import javax.persistence.*;
import jakarta.persistence.*;

import org.exoplatform.commons.api.persistence.ExoEntity;
import org.exoplatform.perkstore.model.constant.ProductOrderPeriodType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import java.io.Serializable;

import javax.persistence.*;
import jakarta.persistence.*;

import org.exoplatform.commons.api.persistence.ExoEntity;
import org.exoplatform.perkstore.model.constant.ProductOrderStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.io.Serializable;
import java.text.MessageFormat;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.helpers.MessageFormatter;

public enum PerkStoreError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.*;
import java.util.stream.Collectors;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.picocontainer.Startable;

import org.exoplatform.commons.api.settings.SettingService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import java.util.*;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import org.exoplatform.commons.api.notification.NotificationContext;
import org.exoplatform.commons.api.notification.channel.template.TemplateProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</changeSet>

<changeSet author="perkstore" id="1.0.0-11">
<validCheckSum>8:0c254d780bc77fd5448845d21e98004d</validCheckSum>
<validCheckSum>8:d41d8cd98f00b204e9800998ecf8427e</validCheckSum>
<sql dbms="postgresql" >
ALTER TABLE ADDONS_PERKSTORE_PRODUCT ALTER COLUMN DELETED DROP DEFAULT;
ALTER TABLE ADDONS_PERKSTORE_PRODUCT ALTER DELETED TYPE bool USING DELETED::boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
} else {
String modifierLink = "<a class=\"user-name text-bold\" href=\"javascript:void(0)\">" + modifierName + "</a>";
String key = "Notification.perkstore.order.modified." + orderStatusLabel;
if (org.apache.commons.lang.StringUtils.isBlank(modifierName)) {
if (org.apache.commons.lang3.StringUtils.isBlank(modifierName)) {
// System modification
key += ".system";
}
Expand All @@ -81,25 +81,25 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<p style="margin: 5px 0; line-height: 16px; font-family: HelveticaNeue, Helvetica, Arial, sans-serif">
<%= _ctx.appRes("Notification.perkstore.order.status") %>: <%= orderStatus %>
</p>
<% if(org.apache.commons.lang.StringUtils.equalsIgnoreCase(orderStatus, "error")) { %>
<% if(org.apache.commons.lang3.StringUtils.equalsIgnoreCase(orderStatus, "error")) { %>
<p style="margin: 5px 0; line-height: 16px; font-family: HelveticaNeue, Helvetica, Arial, sans-serif">
<%= _ctx.appRes("Notification.perkstore.order.error") %>
</p>
<% } %>
<p style="margin: 5px 0; line-height: 16px; font-family: HelveticaNeue, Helvetica, Arial, sans-serif">
<%= _ctx.appRes("Notification.perkstore.order.quantity") %>: <%= orderQuantity %>
</p>
<% if(org.apache.commons.lang.StringUtils.isNotBlank(orderDeliveredQuantity) && !org.apache.commons.lang.StringUtils.equalsIgnoreCase(orderDeliveredQuantity, "0")) { %>
<% if(org.apache.commons.lang3.StringUtils.isNotBlank(orderDeliveredQuantity) && !org.apache.commons.lang3.StringUtils.equalsIgnoreCase(orderDeliveredQuantity, "0")) { %>
<p style="margin: 5px 0; line-height: 16px; font-family: HelveticaNeue, Helvetica, Arial, sans-serif">
<%= _ctx.appRes("Notification.perkstore.order.deliveredQuantity") %>: <%= orderDeliveredQuantity %>
</p>
<% } %>
<% if(org.apache.commons.lang.StringUtils.isNotBlank(orderRefundedQuantity) && !org.apache.commons.lang.StringUtils.equalsIgnoreCase(orderRefundedQuantity, "0")) { %>
<% if(org.apache.commons.lang3.StringUtils.isNotBlank(orderRefundedQuantity) && !org.apache.commons.lang3.StringUtils.equalsIgnoreCase(orderRefundedQuantity, "0")) { %>
<p style="margin: 5px 0; line-height: 16px; font-family: HelveticaNeue, Helvetica, Arial, sans-serif">
<%= _ctx.appRes("Notification.perkstore.order.refundedQuantity") %>: <%= orderRefundedQuantity %>
</p>
<% } %>
<% if(org.apache.commons.lang.StringUtils.isNotBlank(orderRemainingQuantity) && !org.apache.commons.lang.StringUtils.equalsIgnoreCase(orderRemainingQuantity, "0")) { %>
<% if(org.apache.commons.lang3.StringUtils.isNotBlank(orderRemainingQuantity) && !org.apache.commons.lang3.StringUtils.equalsIgnoreCase(orderRemainingQuantity, "0")) { %>
<p style="margin: 5px 0; line-height: 16px; font-family: HelveticaNeue, Helvetica, Arial, sans-serif">
<%= _ctx.appRes("Notification.perkstore.order.remainingQuantity") %>: <%= orderRemainingQuantity %>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<tbody>
<tr>
<td align="left" bgcolor="#ffffff" style="background-color: #f9f9f9; padding: 15px 20px;">
<% if(org.apache.commons.lang.StringUtils.isNotBlank(productSupply) && !org.apache.commons.lang.StringUtils.equals(productSupply, "0")) { %>
<% if(org.apache.commons.lang3.StringUtils.isNotBlank(productSupply) && !org.apache.commons.lang3.StringUtils.equals(productSupply, "0")) { %>
<p style="margin: 5px 0; line-height: 16px; font-family: HelveticaNeue, Helvetica, Arial, sans-serif">
<%= _ctx.appRes("Notification.perkstore.product.supply") %>: <%= productSupply %>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
message = _ctx.appRes("Notification.perkstore.order.created", senderName, orderQuantity, productTitle);
} else {
String key = "Notification.perkstore.order.modified." + orderStatusLabel;
if (org.apache.commons.lang.StringUtils.isBlank(modifierName)) {
if (org.apache.commons.lang3.StringUtils.isBlank(modifierName)) {
// System modification
key += ".system";
}
Expand Down

0 comments on commit f864dae

Please sign in to comment.