/** * The default behavior of this method is to call * <code>setPortletMode(portletMode)</code> on the wrapped response object. */ public void setPortletMode(PortletMode portletMode) throws PortletModeException { response.setPortletMode(portletMode); }
public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (response instanceof ActionResponse) ((ActionResponse)response).setPortletMode(portletMode); }
@ActionMapping("configDone") public void configComplete(ActionResponse response) throws PortletModeException { response.setPortletMode(PortletMode.VIEW); } }
public void setPortletMode(PortletMode portletMode) { ActionResponse response = getActionResponse(); try { response.setPortletMode(portletMode); } catch (PortletModeException e) { throw new UnsupportedOperationException("Invalid portlet mode", e); } }
public void setPortletMode(PortletMode portletMode) { ActionResponse response = getActionResponse(); try { response.setPortletMode(portletMode); } catch (PortletModeException e) { throw new UnsupportedOperationException("Invalid portlet mode", e); } }
public static void setPortletMode(PortletMode arg0) throws PortletModeException { ActionResponse actionResponse = getActionResponse(); if (actionResponse == null) { throw new IllegalStateException( "The response is not ActionResponse."); } actionResponse.setPortletMode(arg0); }
public void setPortletMode(ExternalContext externalContext, String portletMode) { final ActionResponse actionResponse; try { actionResponse = (ActionResponse) externalContext.getNativeResponse(); } catch (ClassCastException e) { throw new IllegalArgumentException( "setPortletMode can only be called during an action request", e); } try { actionResponse.setPortletMode(PortletUtils.getPortletMode(portletMode)); } catch (PortletModeException e) { throw new IllegalArgumentException( "The specified PortletMode '" + portletMode + "' is not valid", e); } } }
@ActionMapping(params = "action=cancel") public void cancelUpdate(ActionResponse response) throws IOException, ReadOnlyException, ValidatorException, PortletModeException, WindowStateException { response.setPortletMode(PortletMode.VIEW); // When the config is displayed in a lightbox, need // to make sure we break out of exclusive mode. Normally, // this is handled via the lightbox JS code. The lightbox // JS doesn't support rewriting URLs set via JS though. So, // instead just do it here. response.setWindowState(WindowState.NORMAL); }
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 + "]"); } }
/** * 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); }
/** * 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); }
@ActionMapping(params = "action=update") public void updateSkinConfiguration( ActionRequest request, ActionResponse response, PortletPreferences prefs) throws IOException, ReadOnlyException, ValidatorException, PortletModeException { // Get the list of preferences and pull them from the request and store into preferences Enumeration<String> preferenceNames = prefs.getNames(); while (preferenceNames.hasMoreElements()) { String name = preferenceNames.nextElement(); if ("PREFdynamicSkinName".equals(name)) { SortedSet<String> skins = skinService.getSkinNames(request); String formValue = request.getParameter(name); if (skins.contains(formValue)) { log.debug("Skin name {} found", formValue); prefs.setValue(name, formValue != null ? formValue : ""); } else { log.warn("Skin name {} is not recognized", formValue); } } else if (name.startsWith(DynamicRespondrSkinConstants.CONFIGURABLE_PREFIX)) { String formValue = request.getParameter(name); prefs.setValue(name, formValue != null ? formValue : ""); } } prefs.store(); log.debug("Saved updated configuration"); response.setPortletMode(PortletMode.VIEW); }
@RequestMapping(params = "action=updateConfiguration") public void saveConfiguration( ActionRequest request, ActionResponse response, @ModelAttribute("form") SqlQueryConfigForm form, BindingResult errors, @RequestParam(value = "Save", required = false) String save) throws PortletModeException, IOException, ValidatorException, ReadOnlyException { if (StringUtils.isNotBlank(save)) { PortletPreferences prefs = request.getPreferences(); prefs.setValue( SqlQueryPortletController.DATASOURCE_BEAN_NAME_PARAM_NAME, form.getDataSource()); prefs.setValue(SqlQueryPortletController.SQL_QUERY_PARAM_NAME, form.getSqlQuery()); prefs.setValue(SqlQueryPortletController.VIEW_PARAM_NAME, form.getViewName()); prefs.setValue(SqlQueryPortletController.PREF_CACHE_NAME, form.getCacheName()); prefs.store(); } response.setPortletMode(PortletMode.VIEW); }
@Override public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { response.setRenderParameter("foo", "foo_value"); response.setPortletMode(PortletMode.EDIT); response.setWindowState(WindowState.MAXIMIZED); }
/** * Sets the PortletMode. * @param context the action execution context, for accessing and setting data in "flow scope" or "request scope" * @return the action result event * @throws Exception an <b>unrecoverable</b> exception occured, either checked or unchecked */ protected Event doExecute(RequestContext context) throws Exception { Assert.isInstanceOf(PortletExternalContext.class, context.getExternalContext(), "'" + ClassUtils.getShortName(this.getClass()) + "' can only work with 'PortletExternalContext': "); PortletExternalContext portletContext = (PortletExternalContext) context.getExternalContext(); if (portletContext.getResponse() instanceof ActionResponse) { PortletMode mode = (PortletMode) context.getAttributes().get(PORTLET_MODE_ATTRIBUTE, PortletMode.class, getPortletMode()); ((ActionResponse) portletContext.getResponse()).setPortletMode(mode); return success(); } else { // portlet mode and the window state can be changed through // ActionResponse only, if this is not the case, it means that this // action has been invoked directly in a RenderRequest throw new IllegalStateException("SetPortletModeAction can only be invoked within a Action request -- " + "make sure you are not invoking it in a RenderRequest"); } } }
response.setPortletMode(PortletMode.EDIT); return; PreferencesHelper.requestParamsToPreferences(request); prefs.store(); response.setPortletMode(PortletMode.EDIT); response.setRenderParameter("configPage", editAction); response.setRenderParameter(TABLE_NAME, request.getParameter(TABLE_NAME)); response.setPortletMode(PortletMode.EDIT); return; PreferencesHelper.requestParamsToPreferences(request); prefs.store(); response.setPortletMode(PortletMode.VIEW);
PortletMessaging.publish(request, "DatabaseBrowserPortlet", "dbConnectTest", sm); response.setPortletMode(PortletMode.EDIT); return;
response.setPortletMode(PortletMode.VIEW);
actionResponse.setPortletMode(new PortletMode(portletModeParam));
actionResponse.setPortletMode(new PortletMode(portletModeParam));