@Override protected Settings getSettings(ActionRequest actionRequest) { return new PortletPreferencesSettings(actionRequest.getPreferences()); }
/** * @see javax.portlet.PortletRequest#getPreferences() */ public PortletPreferences getPreferences() { return request.getPreferences(); }
public PortletPreferences getPreferences() { return request.getPreferences(); }
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); }
PortletPreferences prefs = request.getPreferences(); Map prefsMap = prefs.getMap();
@ActionMapping public void submitSearch( ActionRequest request, ActionResponse response, @RequestParam(value = "query", required = false) String query) { // Should we request to maximize? PortletPreferences prefs = request.getPreferences(); boolean maximize = Boolean.parseBoolean( prefs.getValue(MAXIMIZE_ON_SEARCH_PREFERENCE, "true")); // default is true if (maximize) { try { response.setWindowState(WindowState.MAXIMIZED); } catch (WindowStateException e) { log.warn("Failed to set the window state to MAXIMIZED", e); } } // Forward the query parameter... if (query != null) { response.setRenderParameter("query", query); } }
PortletPreferences prefs = request.getPreferences(); Map prefsMap = prefs.getMap();
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); }
@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); }
PortletPreferences prefs = req.getPreferences();
/** * Save the prefs */ public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { processPreferencesAction(request, actionResponse); String url = request.getPreferences().getValue("url", "http://www.npr.org/rss/rss.php?topicId=4"); String stylesheet = getPortletConfig().getInitParameter("stylesheet"); String key = cache.constructKey(url, stylesheet); // TODO: use the entire parameter list cache.remove(key); }
PortletPreferences prefs = request.getPreferences(); PreferencesHelper.requestParamsToPreferences(request); prefs.store();
/** * save submitted value * * @see javax.portlet.GenericPortlet#processActions * */ public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { String location = request.getParameter( "location" ); String mapHeight = request.getParameter( "mapheight" ); String apiKey = request.getParameter( "apikey" ); PortletPreferences preferences = request.getPreferences(); if ( location != null ) preferences.setValue( "Location", location ); if ( mapHeight != null ) preferences.setValue( "MapHeight", mapHeight ); if ( apiKey != null ) preferences.setValue( "APIKey", apiKey ); preferences.store(); }
/** * save submitted value * * @see javax.portlet.GenericPortlet#processActions * */ public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { String location = request.getParameter( "location" ); String mapHeight = request.getParameter( "mapheight" ); String apiKey = request.getParameter( "apikey" ); PortletPreferences preferences = request.getPreferences(); if ( location != null ) preferences.setValue( "Location", location ); if ( mapHeight != null ) preferences.setValue( "MapHeight", mapHeight ); if ( apiKey != null ) preferences.setValue( "APIKey", apiKey ); preferences.store(); }
String apiKey = request.getParameter( "apikey" ); PortletPreferences preferences = request.getPreferences();
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); }
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); }
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); }