java.io.IOException { @SuppressWarnings("deprecation") String action = request.getParameter(ActionRequest.ACTION_NAME);
protected void setRenderParameters(ActionRequest request, ActionResponse response) { Enumeration enu = request.getParameterNames(); while (enu.hasMoreElements()) { String key = (String) enu.nextElement(); response.setRenderParameter(key, request.getParameter(key)); } }
/** * 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); } } }
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String next = request.getParameter("nextAction"); return next + BEFORE_ACTION; } }
/** * 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; }
/** * 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 actionRequest, ActionResponse actionResponse) throws PortletException, IOException { String processAction = actionRequest.getParameter("processaction"); PortletResponseHandler handler = (PortletResponseHandler) handlers .get(processAction); if (handler == null) { // throw new RuntimeException( "no handlers for processAction = " + // processAction ); handler = (PortletResponseHandler) handlers.get("viewDestinations"); } handler.processAction(actionRequest, actionResponse); }
public void processAction(ActionRequest request, ActionResponse response) throws IOException, PortletException { String destinationName = request.getParameter(DESTINATION_NAME); String destinationType = request.getParameter(DESTINATION_TYPE); response.setRenderParameter("destinationName", destinationName); response.setRenderParameter("destinationType", destinationType); response.setRenderParameter("processAction", "statistics"); }
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); }
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String[] params = {"id"}; for(int i = 0; i < params.length; ++i) { String value = request.getParameter(params[i]); if(value != null) response.setRenderParameter(params[i], value); } return getMode(); }
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String[] params = {"sNo"}; for(int i = 0; i < params.length; ++i) { String value = request.getParameter(params[i]); if(value != null) response.setRenderParameter(params[i], value); } return getMode(); }
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String[] params = {"subject", "publickey", "requestId"}; for(int i = 0; i < params.length; ++i) { String value = request.getParameter(params[i]); if(value != null) response.setRenderParameter(params[i], value); } return getMode(); }
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String[] params = {"caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo"}; for(int i = 0; i < params.length; ++i) { String value = request.getParameter(params[i]); if(value != null) response.setRenderParameter(params[i], value); } return getMode(); }
@Override public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String messageId = request.getParameter(MESSAGE_ID); response.setRenderParameter(MESSAGE_ID, messageId); return getMode(); }
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String id = request.getParameter("id"); if(id != null) { response.setRenderParameter("id", id); } // else we hope this is after a failure and the actionAfterView took care of it below! return getMode(); }
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String[] params = {"caCN", "caOU", "caO", "caL", "caST", "caC", "alias", "keyAlgorithm", "keySize", "algorithm", "validFrom", "validTo", "sNo", "password"}; for(int i = 0; i < params.length; ++i) { String value = request.getParameter(params[i]); if(value != null) response.setRenderParameter(params[i], value); } return getMode(); }
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String[] params = {"subject", "publickey", "algorithm", "validFrom", "validTo", "sNo", "pkcs10certreq", "requestId"}; for(int i = 0; i < params.length; ++i) { String value = request.getParameter(params[i]); if(value != null) response.setRenderParameter(params[i], value); } return getMode(); }
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 + "]"); } }
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 String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String keystore = request.getParameter("keystore"); KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + keystore)); data.lockEdit(); portlet.addInfoMessage(request, portlet.getLocalizedString(request, "consolebase.infoMsg06", keystore)); return LIST_MODE+BEFORE_ACTION; }