1
22
23 package com.liferay.portlet.journalarticles.action;
24
25 import com.liferay.portal.NoSuchGroupException;
26 import com.liferay.portal.kernel.util.GetterUtil;
27 import com.liferay.portal.kernel.util.StringPool;
28 import com.liferay.portal.service.GroupLocalServiceUtil;
29 import com.liferay.portal.struts.PortletAction;
30
31 import javax.portlet.PortletConfig;
32 import javax.portlet.PortletPreferences;
33 import javax.portlet.RenderRequest;
34 import javax.portlet.RenderResponse;
35
36 import org.apache.struts.action.ActionForm;
37 import org.apache.struts.action.ActionForward;
38 import org.apache.struts.action.ActionMapping;
39
40
45 public class ViewAction extends PortletAction {
46
47 public ActionForward render(
48 ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
49 RenderRequest renderRequest, RenderResponse renderResponse)
50 throws Exception {
51
52 try {
53 PortletPreferences prefs = renderRequest.getPreferences();
54
55 long groupId = GetterUtil.getLong(
56 prefs.getValue("group-id", StringPool.BLANK));
57
58 GroupLocalServiceUtil.getGroup(groupId);
59
60 return mapping.findForward("portlet.journal_articles.view");
61 }
62 catch (NoSuchGroupException nsge) {
63 return mapping.findForward("/portal/portlet_not_setup");
64 }
65 }
66
67 }