private String getAppOrSystemProperty(String name, String defaultValue) { DeploymentConfiguration deploymentConfiguration = getDeploymentConfiguration(); return deploymentConfiguration.getApplicationOrSystemProperty(name, defaultValue); }
/** * Resolves the URL to use for the {@literal frontend://} protocol. * * @param session * the session of the user to resolve the protocol for * @return the URL that frontend:// resolves to, possibly using another * internal protocol * @since 8.1 */ public static String resolveFrontendUrl(VaadinSession session) { DeploymentConfiguration configuration = session.getConfiguration(); String frontendUrl; if (session.getBrowser().isEs6Supported()) { frontendUrl = configuration.getApplicationOrSystemProperty( ApplicationConstants.FRONTEND_URL_ES6, ApplicationConstants.FRONTEND_URL_ES6_DEFAULT_VALUE); } else { frontendUrl = configuration.getApplicationOrSystemProperty( ApplicationConstants.FRONTEND_URL_ES5, ApplicationConstants.FRONTEND_URL_ES5_DEFAULT_VALUE); } if (!frontendUrl.endsWith("/")) { frontendUrl += "/"; } return frontendUrl; }
/** * Check whether the legacy prefix "v" or the default prefix "vaadin" should * be used when writing designs. The property or context parameter * {@link Constants#SERVLET_PARAMETER_LEGACY_DESIGN_PREFIX} can be used to * switch to the legacy prefix. * * @since 7.5.7 * @return true to use the legacy prefix, false by default */ protected boolean isLegacyPrefixEnabled() { if (legacyDesignPrefix != null) { return legacyDesignPrefix.booleanValue(); } if (VaadinService.getCurrent() == null) { // This will happen at least in JUnit tests. return false; } DeploymentConfiguration configuration = VaadinService.getCurrent() .getDeploymentConfiguration(); legacyDesignPrefix = configuration.getApplicationOrSystemProperty( Constants.SERVLET_PARAMETER_LEGACY_DESIGN_PREFIX, "false") .equals("true"); return legacyDesignPrefix.booleanValue(); }
@Override protected String getMainDivStyle(BootstrapContext context) { VaadinService vaadinService = context.getRequest().getService(); return vaadinService.getDeploymentConfiguration() .getApplicationOrSystemProperty( VaadinPortlet.PORTLET_PARAMETER_STYLE, null); }
@Override @SuppressWarnings("unchecked") public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { Object uiClassNameObj = event.getService() .getDeploymentConfiguration() .getApplicationOrSystemProperty(VaadinSession.UI_PARAMETER, null); if (uiClassNameObj instanceof String) { String uiClassName = uiClassNameObj.toString(); return uiNameToUiClassMap.get(uiClassName); } return null; }
private WebComponentsPolyfillMode checkWebComponentsPolyfillMode( VaadinService vaadinService) { String mode = vaadinService.getDeploymentConfiguration() .getApplicationOrSystemProperty( SERVLET_PARAMETER_LOAD_WEBCOMPONENTS_POLYFILL, WebComponentsPolyfillMode.AUTOMATIC.toString()); try { return Enum.valueOf(WebComponentsPolyfillMode.class, mode.toUpperCase()); } catch (IllegalArgumentException e) { getLogger().warning( WARNING_LOAD_WEBCOMPONENTS_POLYFILL_NOT_RECOGNIZED); return WebComponentsPolyfillMode.AUTOMATIC; } }
/** * Returns the bean name to be retrieved from the application bean context and * used as the UI. The default implementation uses the servlet init property * {@link #BEAN_NAME_PARAMETER} or "ui" if not defined. * * @param request the current Vaadin request * @return the UI bean name in the application context */ protected String getUIBeanName(VaadinRequest request) { String vaadinBeanName = "ui"; Object uiBeanName = request.getService().getDeploymentConfiguration().getApplicationOrSystemProperty(BEAN_NAME_PARAMETER, null); if (uiBeanName != null && uiBeanName instanceof String) { vaadinBeanName = uiBeanName.toString(); } logger.debug("found BEAN_NAME_PARAMETER: {}", vaadinBeanName); return vaadinBeanName; } }
protected void initializePlugin(VaadinPortletService service) { // Spring system messages provider if (systemMessagesBeanName != null && systemMessagesBeanName != "") { SpringVaadinSystemMessagesProvider messagesProvider = new SpringVaadinSystemMessagesProvider(applicationContext, systemMessagesBeanName); logger.debug("set SpringVaadinSystemMessagesProvider"); service.setSystemMessagesProvider(messagesProvider); } String uiProviderProperty = service.getDeploymentConfiguration().getApplicationOrSystemProperty(Constants.SERVLET_PARAMETER_UI_PROVIDER, null); // Add SpringUIProvider if custom provider doesn't defined. if (uiProviderProperty == null) { service.addSessionInitListener(new SessionInitListener() { @Override public void sessionInit(SessionInitEvent event) throws ServiceException { event.getSession().addUIProvider(new SpringUIProvider()); } }); } }
protected void initializePlugin(VaadinServletService service) { // Spring system messages provider if (systemMessagesBeanName != null && systemMessagesBeanName != "") { SpringVaadinSystemMessagesProvider messagesProvider = new SpringVaadinSystemMessagesProvider(applicationContext, systemMessagesBeanName); logger.debug("set SpringVaadinSystemMessagesProvider"); service.setSystemMessagesProvider(messagesProvider); } String uiProviderProperty = service.getDeploymentConfiguration().getApplicationOrSystemProperty(Constants.SERVLET_PARAMETER_UI_PROVIDER, null); // Add SpringUIProvider if custom provider doesn't defined. if (uiProviderProperty == null) { service.addSessionInitListener(new SessionInitListener() { @Override public void sessionInit(SessionInitEvent event) throws ServiceException { event.getSession().addUIProvider(new SpringUIProvider()); } }); } }
.getDeploymentConfiguration(); String definedBundleName = deploymentConfiguration .getApplicationOrSystemProperty(HTML_BUNDLE_NAME, null); if (definedBundleName != null) { if ("".equals(definedBundleName)) {