|
|
|
@ -8,15 +8,6 @@
|
|
|
|
|
|
|
|
|
|
package it.tref.liferay.portos.deployalert.service.impl; |
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.deployalert.NotificationNomePluginException; |
|
|
|
|
import it.tref.liferay.portos.deployalert.NotificationNomeTemplateException; |
|
|
|
|
import it.tref.liferay.portos.deployalert.model.NotificationMail; |
|
|
|
|
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.deployalert.service.base.NotificationMailLocalServiceBaseImpl; |
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import com.liferay.portal.kernel.dao.orm.Disjunction; |
|
|
|
|
import com.liferay.portal.kernel.dao.orm.DynamicQuery; |
|
|
|
|
import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; |
|
|
|
@ -28,6 +19,15 @@ import com.liferay.portal.kernel.util.Validator;
|
|
|
|
|
import com.liferay.portal.model.User; |
|
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.deployalert.NotificationNomePluginException; |
|
|
|
|
import it.tref.liferay.portos.deployalert.NotificationNomeTemplateException; |
|
|
|
|
import it.tref.liferay.portos.deployalert.model.NotificationMail; |
|
|
|
|
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; |
|
|
|
|
import it.tref.liferay.portos.deployalert.service.base.NotificationMailLocalServiceBaseImpl; |
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The implementation of the notification mail local service. |
|
|
|
|
* <p> |
|
|
|
@ -44,7 +44,6 @@ import com.liferay.portal.service.ServiceContext;
|
|
|
|
|
*/ |
|
|
|
|
public class NotificationMailLocalServiceImpl extends NotificationMailLocalServiceBaseImpl { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public NotificationMail addNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext) |
|
|
|
|
throws PortalException, SystemException { |
|
|
|
|
|
|
|
|
@ -76,7 +75,6 @@ public class NotificationMailLocalServiceImpl extends NotificationMailLocalServi
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public NotificationMail updateNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext, |
|
|
|
|
long notificationId) throws SystemException, PortalException { |
|
|
|
|
|
|
|
|
@ -91,10 +89,10 @@ public class NotificationMailLocalServiceImpl extends NotificationMailLocalServi
|
|
|
|
|
return notification; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<NotificationMail> findNotifications(long companyId, int start, int end) throws SystemException { |
|
|
|
|
|
|
|
|
|
DynamicQuery query = dynamicQuery(); |
|
|
|
|
// return notificationMailPersistence.findBycompanyId(companyId, start, end);
|
|
|
|
|
DynamicQuery query = notificationMailLocalService.dynamicQuery(); |
|
|
|
|
query.addOrder(OrderFactoryUtil.asc("nomePlugin")); |
|
|
|
|
List<NotificationMail> notifications = null; |
|
|
|
|
try { |
|
|
|
@ -105,30 +103,30 @@ public class NotificationMailLocalServiceImpl extends NotificationMailLocalServi
|
|
|
|
|
return notifications; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<NotificationMail> findNotifications(long companyId) throws SystemException { |
|
|
|
|
|
|
|
|
|
return notificationMailPersistence.findBycompanyId(companyId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int getNotificationCount(long companyId) throws SystemException { |
|
|
|
|
|
|
|
|
|
return notificationMailPersistence.countBycompanyId(companyId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<NotificationMail> findNotifications(long companyId, String servletContextName) throws SystemException { |
|
|
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQuery(); |
|
|
|
|
DynamicQuery dynamicQuery = notificationMailLocalService.dynamicQuery(); |
|
|
|
|
|
|
|
|
|
if (Validator.isNull(servletContextName)) { |
|
|
|
|
Disjunction or = RestrictionsFactoryUtil.disjunction(); |
|
|
|
|
or.add(RestrictionsFactoryUtil.isNull("nomePlugin")); |
|
|
|
|
or.add(RestrictionsFactoryUtil.eq("nomePlugin", StringPool.BLANK)); |
|
|
|
|
|
|
|
|
|
dynamicQuery.add(or); |
|
|
|
|
} else { |
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("nomePlugin", servletContextName)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return notificationMailPersistence.findWithDynamicQuery(dynamicQuery); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|