private static boolean hasParameter(VaadinRequest request, String parameterName) { return request.getParameter(parameterName) != null; }
/** * Constructs an embed id based on information in the request. * * @since 7.2 * * @param request * the request to get embed information from * @return the embed id, or <code>null</code> if id is not available. * * @see UI#getEmbedId() */ protected String getEmbedId(VaadinRequest request) { // Parameters sent by vaadinBootstrap.js String windowName = request.getParameter("v-wn"); String appId = request.getParameter("v-appId"); if (windowName != null && appId != null) { return windowName + '.' + appId; } else { return null; } }
public void init(VaadinRequest request) { // NOTE: UI.refresh makes assumptions about the semantics of this // method. // It should be kept in sync if this method is changed. // Extract special parameter sent by vaadinBootstrap.js String location = request.getParameter("v-loc"); String clientWidth = request.getParameter("v-cw"); String clientHeight = request.getParameter("v-ch"); windowName = request.getParameter("v-wn"); if (location != null) { try { this.location = new URI(location); } catch (URISyntaxException e) { throw new RuntimeException( "Invalid location URI received from client", e); } } if (clientWidth != null && clientHeight != null) { try { browserWindowWidth = Integer.parseInt(clientWidth); browserWindowHeight = Integer.parseInt(clientHeight); } catch (NumberFormatException e) { throw new RuntimeException( "Invalid window size received from client", e); } } }
public static boolean isUIInitRequest(VaadinRequest request) { return "POST".equals(request.getMethod()) && request .getParameter(UIInitHandler.BROWSER_DETAILS_PARAMETER) != null; }
/** * For internal use by VaadinServlet/VaadinPortlet only. Updates all * properties in the class according to the given information. * * @param request * the Vaadin request to read the information from */ public void updateRequestDetails(VaadinRequest request) { locale = request.getLocale(); address = request.getRemoteAddr(); secureConnection = request.isSecure(); // Headers are case insensitive according to the specification but are // case sensitive in Weblogic portal... String agent = request.getHeader("User-Agent"); if (agent != null) { browserApplication = agent; browserDetails = new VBrowserDetails(agent); } if (request.getParameter("v-sw") != null) { updateClientSideDetails(request.getParameter("v-sw"), request.getParameter("v-sh"), request.getParameter("v-tzo"), request.getParameter("v-rtzo"), request.getParameter("v-dstd"), request.getParameter("v-dston"), request.getParameter("v-tzid"), request.getParameter("v-curdate"), request.getParameter("v-td") != null); } }
@Override public String getThemeName(BootstrapContext context) { String themeName = context.getRequest() .getParameter(VaadinServlet.URL_PARAMETER_THEME); if (themeName == null) { themeName = super.getThemeName(context); } return themeName; }
/** * Finds the {@link UI} that belongs to the provided request. This is * generally only supported for UIDL requests as other request types are not * related to any particular UI or have the UI information encoded in a * non-standard way. The returned UI is also set as the current UI ( * {@link UI#setCurrent(UI)}). * * @param request * the request for which a UI is desired * @return the UI belonging to the request or null if no UI is found * */ public UI findUI(VaadinRequest request) { // getForSession asserts that the lock is held VaadinSession session = loadSession(request.getWrappedSession()); // Get UI id from the request String uiIdString = request.getParameter(UIConstants.UI_ID_PARAMETER); UI ui = null; if (uiIdString != null && session != null) { int uiId = Integer.parseInt(uiIdString); ui = session.getUIById(uiId); } UI.setCurrent(ui); return ui; }
setTheme(request.getParameter("theme"));
@Override public String getParameter(String name) { return instance.getParameter(name); }
private boolean loadSemanticZoomLevel(VaadinRequest request) { String szl = request.getParameter(TopologyLinkBuilder.PARAMETER_SEMANTIC_ZOOM_LEVEL); if (szl != null) { try { m_graphContainer.setSemanticZoomLevel(Integer.parseInt(szl)); return true; } catch (NumberFormatException e) { LOG.warn("Invalid SZL found in {} parameter: {}", TopologyLinkBuilder.PARAMETER_SEMANTIC_ZOOM_LEVEL, szl); } } return false; }
private boolean loadSemanticZoomLevel(VaadinRequest request) { String szl = request.getParameter(TopologyLinkBuilder.PARAMETER_SEMANTIC_ZOOM_LEVEL); if (szl != null) { try { m_graphContainer.setSemanticZoomLevel(Integer.parseInt(szl)); return true; } catch (NumberFormatException e) { LOG.warn("Invalid SZL found in {} parameter: {}", TopologyLinkBuilder.PARAMETER_SEMANTIC_ZOOM_LEVEL, szl); } } return false; }
private boolean loadGraphProvider(VaadinRequest request) { String graphProviderName = request.getParameter(TopologyLinkBuilder.PARAMETER_GRAPH_PROVIDER); return executeOperationWithLabel(graphProviderName); }
private boolean loadLayout(VaadinRequest request) { String layoutName = request.getParameter(TopologyLinkBuilder.PARAMETER_LAYOUT); return executeOperationWithLabel(layoutName); }
private boolean loadLayout(VaadinRequest request) { String layoutName = request.getParameter(TopologyLinkBuilder.PARAMETER_LAYOUT); return executeOperationWithLabel(layoutName); }
private boolean loadHistoryFragment(VaadinRequest request) { String fragment = request.getParameter(PARAMETER_HISTORY_FRAGMENT); if (!Strings.isNullOrEmpty(fragment) && getPage() != null) { applyHistory(m_applicationContext.getUsername(), fragment); return true; } return false; }
private boolean loadHistoryFragment(VaadinRequest request) { String fragment = request.getParameter(PARAMETER_HISTORY_FRAGMENT); if (!Strings.isNullOrEmpty(fragment) && getPage() != null) { applyHistory(m_applicationContext.getUsername(), fragment); return true; } return false; }
@Override protected void init(VaadinRequest request) { String errorUri = request.getParameter("errorUri"); WiretapEvent<String> wiretapEvent = (WiretapEvent<String>)VaadinService.getCurrentRequest().getWrappedSession().getAttribute("wiretapEvent"); WiretapPayloadViewPanel panel = new WiretapPayloadViewPanel(wiretapEvent); this.setContent(panel); }
@SuppressWarnings("deprecation") private void prepAttach() { when(request.getParameter("v-loc")).thenReturn(baseUri + "/#home"); ui.getPage() .init(request); when(session.createConnectorId(Matchers.any(ClientConnector.class))).thenAnswer(new ConnectorIdAnswer()); when(session.getLocale()).thenReturn(Locale.FRANCE); when(session.hasLock()).thenReturn(true); ui.setSession(session); }
@Override protected void init(VaadinRequest request) { String errorUri = request.getParameter("errorUri"); ErrorReportingService errorReportingService = (ErrorReportingService)VaadinService.getCurrentRequest().getWrappedSession().getAttribute("errorReportService"); ErrorReportingManagementService errorReportingManagementService = (ErrorReportingManagementService)VaadinService.getCurrentRequest().getWrappedSession().getAttribute("errorReportManagementService"); ActionedErrorOccurrenceViewPanel panel = new ActionedErrorOccurrenceViewPanel(errorUri, errorReportingManagementService, errorReportingService); this.setContent(panel); }
if (request.getParameter( VaadinService.URL_PARAMETER_RESTART_APPLICATION) != null) { appConfig.put("extraParams", "&" + IGNORE_RESTART_PARAM + "=1");