我正在使用 liferay 6.1 CE,我想为日历 portlet 中的事件覆盖 remiderUser
方法。
我试图找到但我找到了覆盖 CalEventLocalService
的方法,但我没有找到任何向用户发送 eventReminder
的方法。
我浏览了以下链接。
https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/overriding-a-portal-service-using-a-hook https://www.liferay.com/community/forums/-/message_boards/message/29120467 https://www.liferay.com/community/forums/-/message_boards/message/29120467
已更新
下面是我创建的类,我正在尝试重写 checkEvents
方法
public class MyCalEventServiceImple extends CalEventLocalServiceWrapper {
public MyCalEventServiceImple(CalEventLocalService calEventLocalService) {
super(calEventLocalService);
// TODO Auto-generated constructor stub
}
public CalEvent addEvent(
long userId, String title, String description, String location,
int startDateMonth, int startDateDay, int startDateYear,
int startDateHour, int startDateMinute, int endDateMonth,
int endDateDay, int endDateYear, int durationHour,
int durationMinute, boolean allDay, boolean timeZoneSensitive,
String type, boolean repeating, TZSRecurrence recurrence,
int remindBy, int firstReminder, int secondReminder,
ServiceContext serviceContext)
throws PortalException, SystemException {
// Event
System.out.println("*****************CALLED Success.....**********");
return null;
}
}
但没有找到任何方法来实现这一目标。
谁能帮忙??
提前致谢。
最佳答案
如果您查看 liferay 源代码,remindUser
( protected )是向用户发送事件提醒的方法。如果您深入研究 liferay 源代码,您会发现 checkEvents
(它是公共(public)的)是最终调用 remindUser
方法的方法。所以,我认为您可以根据您的要求使用 checkEvents
方法。
编辑:您可以使用服务包装器 Hook 来覆盖 liferay 服务类。 Service Wrapper Hook
关于java - 如何覆盖 liferay 中的日历 portlet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31047478/