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