1
14
15 package com.liferay.portlet.bookmarks.action;
16
17 import com.liferay.portal.kernel.util.ParamUtil;
18 import com.liferay.portal.struts.ActionConstants;
19 import com.liferay.portal.util.PortalUtil;
20 import com.liferay.portal.util.WebKeys;
21 import com.liferay.portlet.bookmarks.model.BookmarksEntry;
22 import com.liferay.portlet.bookmarks.service.BookmarksEntryServiceUtil;
23
24 import javax.servlet.http.HttpServletRequest;
25 import javax.servlet.http.HttpServletResponse;
26
27 import org.apache.struts.action.Action;
28 import org.apache.struts.action.ActionForm;
29 import org.apache.struts.action.ActionForward;
30 import org.apache.struts.action.ActionMapping;
31
32
37 public class OpenEntryAction extends Action {
38
39 public ActionForward execute(
40 ActionMapping mapping, ActionForm form, HttpServletRequest request,
41 HttpServletResponse response)
42 throws Exception {
43
44 try {
45 long entryId = ParamUtil.getLong(request, "entryId");
46
47 BookmarksEntry entry =
48 BookmarksEntryServiceUtil.openEntry(entryId);
49
50 request.setAttribute(WebKeys.FORWARD_URL, entry.getUrl());
51
52 return mapping.findForward(ActionConstants.COMMON_FORWARD);
53 }
54 catch (Exception e) {
55 PortalUtil.sendError(e, request, response);
56
57 return null;
58 }
59 }
60
61 }