001
014
015 package com.liferay.portlet.calendar.action;
016
017 import com.liferay.portal.kernel.util.ParamUtil;
018 import com.liferay.portal.util.PortalUtil;
019 import com.liferay.portal.util.WebKeys;
020 import com.liferay.portlet.calendar.model.CalEvent;
021 import com.liferay.portlet.calendar.service.CalEventServiceUtil;
022
023 import javax.portlet.PortletRequest;
024
025 import javax.servlet.http.HttpServletRequest;
026
027
030 public class ActionUtil {
031
032 public static void getEvent(HttpServletRequest request) throws Exception {
033 long eventId = ParamUtil.getLong(request, "eventId");
034
035 CalEvent event = null;
036
037 if (eventId > 0) {
038 event = CalEventServiceUtil.getEvent(eventId);
039 }
040
041 request.setAttribute(WebKeys.CALENDAR_EVENT, event);
042 }
043
044 public static void getEvent(PortletRequest portletRequest)
045 throws Exception {
046
047 HttpServletRequest request = PortalUtil.getHttpServletRequest(
048 portletRequest);
049
050 getEvent(request);
051 }
052
053 }