001
014
015 package com.liferay.portlet.journalarticles.action;
016
017 import com.liferay.portal.NoSuchGroupException;
018 import com.liferay.portal.kernel.util.GetterUtil;
019 import com.liferay.portal.kernel.util.StringPool;
020 import com.liferay.portal.service.GroupLocalServiceUtil;
021 import com.liferay.portlet.journalcontent.action.WebContentAction;
022
023 import javax.portlet.PortletConfig;
024 import javax.portlet.PortletPreferences;
025 import javax.portlet.RenderRequest;
026 import javax.portlet.RenderResponse;
027
028 import org.apache.struts.action.ActionForm;
029 import org.apache.struts.action.ActionForward;
030 import org.apache.struts.action.ActionMapping;
031
032
036 public class ViewAction extends WebContentAction {
037
038 @Override
039 public ActionForward render(
040 ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
041 RenderRequest renderRequest, RenderResponse renderResponse)
042 throws Exception {
043
044 try {
045 PortletPreferences preferences = renderRequest.getPreferences();
046
047 long groupId = GetterUtil.getLong(
048 preferences.getValue("groupId", StringPool.BLANK));
049
050 GroupLocalServiceUtil.getGroup(groupId);
051
052 return mapping.findForward("portlet.journal_articles.view");
053 }
054 catch (NoSuchGroupException nsge) {
055 return mapping.findForward("/portal/portlet_not_setup");
056 }
057 }
058
059 }