Refine search
java.io.IOException { @SuppressWarnings("deprecation") String action = request.getParameter(ActionRequest.ACTION_NAME);
@Override protected Settings getSettings(ActionRequest actionRequest) { return new PortletPreferencesSettings(actionRequest.getPreferences()); }
/** * Retrieve the character encoding for the request. * * @return The character encoding for the request. */ @Override public String getCharacterEncoding() { return request.getCharacterEncoding(); }
/** * If request is an {@link javax.portlet.ActionRequest ActionRequest}, * get handler mapping parameter and add it to the ActionResponse. */ @Override public boolean preHandleAction(ActionRequest request, ActionResponse response, Object handler) { String mappingParameter = request.getParameter(this.parameterName); if (mappingParameter != null) { response.setRenderParameter(parameterName, mappingParameter); } return true; }
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { Map<String,String[]> paramMap = request.getParameterMap(); Set<String> params = paramMap.keySet(); for(String param:params){ response.setRenderParameter(param, paramMap.get(param)[0]); } }
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { final PortletSession session = request.getPortletSession(); final Map parameterMap = request.getParameterMap(); if (parameterMap.containsKey(START_COMMAND)) { final String reqFname = request.getParameter(FNAME_ATTRIBUTE); session.setAttribute(FNAME_ATTRIBUTE, reqFname); final String servantValue = request.getParameter(VALUE_ATTRIBUTE); response.setRenderParameter(VALUE_ATTRIBUTE, servantValue);
protected void processActionResponseState(String wicketURL, String wicketFilterPath, String wicketFilterQuery, ActionRequest request, ActionResponse response, WicketResponseState responseState) throws PortletException, IOException { if (responseState.getRedirectLocation() != null) { wicketURL = fixWicketUrl(responseState.getRedirectLocation(), wicketFilterPath, wicketFilterQuery); if (wicketURL.startsWith(wicketFilterPath)) { response.setRenderParameter((String)request .getAttribute(WicketPortlet.WICKET_URL_PORTLET_PARAMETER_ATTR) + request.getPortletMode().toString(), wicketURL); } else { response.sendRedirect(responseState.getRedirectLocation()); } } } }
public void showById(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { PortletPreferences prefs = actionRequest.getPreferences(); String id = actionRequest.getParameter("id"); if(id != null) { prefs.setValue("id", id); prefs.store(); } String mvcPath = actionRequest.getParameter("mvcPath"); // this would tell the render method to show the required JSP actionResponse.setRenderParameter("mvcPath", mvcPath); }
/** * For internal use by the framework only - API subject to change. */ public void firePortletActionRequest(UI uI, ActionRequest request, ActionResponse response) { String key = request.getParameter(ActionRequest.ACTION_NAME); if (eventActionDestinationMap.containsKey(key)) { // this action request is only to send queued portlet events response.setEvent(eventActionDestinationMap.get(key), eventActionValueMap.get(key)); // cleanup eventActionDestinationMap.remove(key); eventActionValueMap.remove(key); } else if (sharedParameterActionNameMap.containsKey(key)) { // this action request is only to set shared render parameters response.setRenderParameter(sharedParameterActionNameMap.get(key), sharedParameterActionValueMap.get(key)); // cleanup sharedParameterActionNameMap.remove(key); sharedParameterActionValueMap.remove(key); } else { // normal action request, notify listeners for (PortletListener l : new ArrayList<>(portletListeners)) { l.handleActionRequest(request, response, uI); } } }
protected void processActionResponseState(ActionRequest request, ActionResponse response, String hstDispUrl, HstPortletResponseState portletResponseState) throws PortletException, IOException { PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(hstDispUrl); if (dispatcher != null) { dispatch(dispatcher, request, response, true); // write out Cookies to ActionResponse portletResponseState.flush(); String redirectLocationUrl = portletResponseState.getRedirectLocation(); if (redirectLocationUrl != null) { if (portletResponseState.isRenderRedirect()) { response.setRenderParameter(HST_PATH_PARAM_NAME + request.getPortletMode().toString(), redirectLocationUrl); } else { response.sendRedirect(redirectLocationUrl); } } } else { throw new PortletException("HST URL Dispatcher is not found: " + hstDispUrl); } }
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { JMSResourceData data = (JMSResourceData) model; request.getPortletSession(true).removeAttribute("deploymentPlan"); String next = request.getParameter("nextAction"); if(next.equals(SELECT_DESTINATION_TYPE_MODE)) { data.setCurrentDestinationID(data.getAdminObjects().size()); } else if(next.equals(SELECT_FACTORY_TYPE_MODE)) { data.setCurrentFactoryID(data.getConnectionFactories().size()); } return next+BEFORE_ACTION; } }
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { String source = request.getParameter(SRC_PREF); String height = request.getParameter(HEIGHT_PREF); String width = request.getParameter(WIDTH_PREF); String maxSource = request.getParameter(MAX_SRC_PREF); String maxHeight = request.getParameter(MAX_HEIGHT_PREF); String maxWidth = request.getParameter(MAX_WIDTH_PREF); PortletPreferences prefs = request.getPreferences(); prefs.setValue(SRC_PREF, source); prefs.setValue(HEIGHT_PREF, height); prefs.setValue(WIDTH_PREF, width); prefs.setValue(MAX_SRC_PREF, maxSource); prefs.setValue(MAX_HEIGHT_PREF, maxHeight); prefs.setValue(MAX_WIDTH_PREF, maxWidth); prefs.store(); super.processAction(request, response); }
/** * Process comment action. * * @param request action request * @param response action response * @throws PortletException * @throws IOException */ protected void processCommentAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { // Action name String action = request.getParameter(ActionRequest.ACTION_NAME); // Comment identifier String id = request.getParameter("id"); // Comment content String content = request.getParameter("content"); if (PortletMode.VIEW.equals(request.getPortletMode())) { if ("addComment".equals(action)) { // Add comment action this.addCommentAction(request, response, content, null); } else if ("replyComment".equals(action)) { // Reply comment action this.addCommentAction(request, response, content, id); } else if ("deleteComment".equals(action)) { // Delete comment this.deleteCommentAction(request, response, id); } } }
private void handleConfigForm(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException { PortletPreferences preferences = actionRequest.getPreferences(); String rootSpace = actionRequest.getParameter(ROOT_SPACE_PARAM_NAME); preferences.setValue(XWikiPortletRequest.ROOT_SPACE_PREF_NAME, rootSpace); actionResponse.setPortletMode(PortletMode.VIEW); preferences.store(); if (logger.isDebugEnabled()) { logger.debug("New root space is [" + rootSpace + "]"); } }
ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute( WebKeys.THEME_DISPLAY); (Map<String, String[]>)actionRequest.getAttribute( WebKeys.PORTLET_PREFERENCES_MAP); actionResponse.sendRedirect(redirect);
public void processAction(ActionRequest req, ActionResponse res) throws PortletException, IOException { // record params into the session PortletSession session=req.getPortletSession(); for(Enumeration e=req.getParameterNames();e.hasMoreElements();) { String paramName=(String) e.nextElement(); session.setAttribute(paramName,req.getParameter(paramName)); } }
/** * Save the prefs */ public void processPreferencesAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { PortletPreferences prefs = request.getPreferences(); PreferencesHelper.requestParamsToPreferences(request); prefs.store(); actionResponse.setPortletMode(PortletMode.VIEW); }
@Override public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { log.debug("WingS-Portlet-Bridge: start with processAction()"); // store the parameters PortletSession portletSession = request.getPortletSession(); Map parameters = request.getParameterMap(); String portletMode = request.getPortletMode().toString(); portletSession.setAttribute(portletMode + ':' + Const.SESSION_ATTR_PARAMETERS, parameters, PortletSession.PORTLET_SCOPE); log.debug("WingS-Portlet-Bridge: stored parameters in sesseion under " + portletMode + ':' + Const.SESSION_ATTR_PARAMETERS); log.debug("WingS-Portlet-Bridge: ended processAction()"); }
@Override public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { actionFoo = request.getParameterValues("foo"); actionPortletMode = request.getPortletMode(); actionWindowState = request.getWindowState(); }
/** * @see javax.portlet.PortletRequest#getPortletSession() */ public PortletSession getPortletSession() { return request.getPortletSession(); }