List of usage examples for com.liferay.portal.kernel.servlet SessionErrors add
public static void add(PortletRequest portletRequest, String key)
From source file:com.liferay.portlet.softwarecatalog.action.EditProductEntryAction.java
License:Open Source License
@Override public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try {/*from ww w . java 2s . c om*/ ActionUtil.getProductEntry(renderRequest); } catch (Exception e) { if (e instanceof NoSuchProductEntryException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.software_catalog.error"); } else { throw e; } } return mapping.findForward(getForward(renderRequest, "portlet.software_catalog.edit_product_entry")); }
From source file:com.liferay.portlet.softwarecatalog.action.EditProductVersionAction.java
License:Open Source License
@Override public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { String cmd = ParamUtil.getString(actionRequest, Constants.CMD); try {//from w ww.ja v a2 s .c o m if (cmd.equals(Constants.ADD) || cmd.equals(Constants.UPDATE)) { updateProductVersion(actionRequest); } else if (cmd.equals(Constants.DELETE)) { deleteProductVersion(actionRequest); } sendRedirect(actionRequest, actionResponse); } catch (Exception e) { if (e instanceof NoSuchProductVersionException || e instanceof PrincipalException) { SessionErrors.add(actionRequest, e.getClass().getName()); setForward(actionRequest, "portlet.software_catalog.error"); } else if (e instanceof DuplicateProductVersionDirectDownloadURLException || e instanceof ProductVersionChangeLogException || e instanceof ProductVersionDownloadURLException || e instanceof ProductVersionFrameworkVersionException || e instanceof ProductVersionNameException || e instanceof UnavailableProductVersionDirectDownloadURLException) { SessionErrors.add(actionRequest, e.getClass().getName()); } else { throw e; } } }
From source file:com.liferay.portlet.softwarecatalog.action.EditProductVersionAction.java
License:Open Source License
@Override public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try {// w ww . ja va 2 s . c o m ActionUtil.getProductVersion(renderRequest); } catch (Exception e) { if (e instanceof NoSuchProductVersionException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.software_catalog.error"); } else { throw e; } } return mapping.findForward(getForward(renderRequest, "portlet.software_catalog.edit_product_version")); }
From source file:com.liferay.portlet.softwarecatalog.action.ViewProductEntryAction.java
License:Open Source License
@Override public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try {//from w w w.jav a 2 s .c om ActionUtil.getProductEntry(renderRequest); SCProductEntry productEntry = (SCProductEntry) renderRequest .getAttribute(WebKeys.SOFTWARE_CATALOG_PRODUCT_ENTRY); if (productEntry == null) { throw new NoSuchProductEntryException(); } } catch (Exception e) { if (e instanceof NoSuchProductEntryException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.software_catalog.error"); } else { throw e; } } return mapping.findForward("portlet.software_catalog.view_product_entry"); }
From source file:com.liferay.portlet.stagingbar.action.EditLayoutBranchAction.java
License:Open Source License
@Override public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try {//from w w w . j a va2 s . c o m checkPermissions(renderRequest); } catch (PrincipalException pe) { SessionErrors.add(renderRequest, PrincipalException.class.getName()); return mapping.findForward("portlet.staging_bar.error"); } try { getGroup(renderRequest); } catch (Exception e) { if (e instanceof NoSuchGroupException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.staging_bar.error"); } else { throw e; } } return mapping.findForward(getForward(renderRequest, "portlet.staging_bar.edit_layout_branch")); }
From source file:com.liferay.portlet.stagingbar.action.EditLayoutSetBranchAction.java
License:Open Source License
@Override public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try {//from ww w. j a v a 2s . co m checkPermissions(renderRequest); } catch (PrincipalException pe) { SessionErrors.add(renderRequest, PrincipalException.class.getName()); return mapping.findForward("portlet.staging_bar.error"); } try { getGroup(renderRequest); } catch (Exception e) { if (e instanceof NoSuchGroupException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.staging_bar.error"); } else { throw e; } } return mapping.findForward(getForward(renderRequest, "portlet.staging_bar.edit_layout_set_branch")); }
From source file:com.liferay.portlet.usergroupsadmin.action.EditUserGroupAction.java
License:Open Source License
@Override public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { String cmd = ParamUtil.getString(actionRequest, Constants.CMD); try {//ww w . j av a2 s .c om if (cmd.equals(Constants.ADD) || cmd.equals(Constants.UPDATE)) { updateUserGroup(actionRequest); } else if (cmd.equals(Constants.DELETE)) { deleteUserGroups(actionRequest); } sendRedirect(actionRequest, actionResponse); } catch (Exception e) { if (e instanceof PrincipalException) { SessionErrors.add(actionRequest, e.getClass().getName()); setForward(actionRequest, "portlet.user_groups_admin.error"); } else if (e instanceof DuplicateUserGroupException || e instanceof NoSuchUserGroupException || e instanceof RequiredUserGroupException || e instanceof UserGroupNameException) { SessionErrors.add(actionRequest, e.getClass().getName()); if (cmd.equals(Constants.DELETE)) { String redirect = PortalUtil.escapeRedirect(ParamUtil.getString(actionRequest, "redirect")); if (Validator.isNotNull(redirect)) { actionResponse.sendRedirect(redirect); } } } else { throw e; } } }
From source file:com.liferay.portlet.usergroupsadmin.action.EditUserGroupAction.java
License:Open Source License
@Override public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try {/*from www .ja v a 2 s . co m*/ ActionUtil.getUserGroup(renderRequest); } catch (Exception e) { if (e instanceof NoSuchUserGroupException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.user_groups_admin.error"); } else { throw e; } } return mapping.findForward(getForward(renderRequest, "portlet.user_groups_admin.edit_user_group")); }
From source file:com.liferay.portlet.usergroupsadmin.action.EditUserGroupAssignmentsAction.java
License:Open Source License
@Override public void processAction(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { String cmd = ParamUtil.getString(actionRequest, Constants.CMD); try {//from w w w. ja v a 2 s . c o m if (cmd.equals("user_group_users")) { updateUserGroupUsers(actionRequest); } if (Validator.isNotNull(cmd)) { String redirect = ParamUtil.getString(actionRequest, "assignmentsRedirect"); sendRedirect(actionRequest, actionResponse, redirect); } } catch (Exception e) { if (e instanceof NoSuchUserGroupException || e instanceof PrincipalException) { SessionErrors.add(actionRequest, e.getClass().getName()); setForward(actionRequest, "portlet.user_groups_admin.error"); } else { throw e; } } }
From source file:com.liferay.portlet.usergroupsadmin.action.EditUserGroupAssignmentsAction.java
License:Open Source License
@Override public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { try {/*ww w. jav a 2s . c o m*/ ActionUtil.getUserGroup(renderRequest); } catch (Exception e) { if (e instanceof NoSuchUserGroupException || e instanceof PrincipalException) { SessionErrors.add(renderRequest, e.getClass().getName()); return mapping.findForward("portlet.user_groups_admin.error"); } else { throw e; } } return mapping .findForward(getForward(renderRequest, "portlet.user_groups_admin.edit_user_group_assignments")); }