/** * @param request * @param response * @throws PortletException * @throws IOException * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @Deprecated protected void handleRequest(PortletRequest request, PortletResponse response) throws PortletException, IOException { CurrentInstance.clearAll(); try { getService().handleRequest(createVaadinRequest(request), createVaadinResponse(response)); } catch (ServiceException e) { throw new PortletException(e); } }
private PortletContext getPortletContext() { return getPortlet().getPortletContext(); }
@Override public String getServiceName() { return getPortlet().getPortletName(); }
DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration( initParameters); try { vaadinService = createPortletService(deploymentConfiguration); } catch (ServiceException e) { throw new PortletException("Could not initialized VaadinPortlet", portletInitialized();
@Override public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); getService().addSessionInitListener((SessionInitEvent event) -> { try { onVaadinSessionStarted( (VaadinPortletRequest) event.getRequest(), (VaadinPortletSession) event.getSession()); } catch (PortletException e) { throw new ServiceException(e); } }); }
@Override protected VaadinPortletService createPortletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException { final VaadinPortletService service = super.createPortletService(deploymentConfiguration); initializePlugin(service); return service; } }
/** * Gets the request type for the request. * * @param request * the request to get a request type for * @return the request type * * @deprecated As of 7.0. Will likely change or be removed in a future * version */ @Deprecated protected RequestType getRequestType(VaadinRequest request) { RequestType type = (RequestType) request .getAttribute(RequestType.class.getName()); if (type == null) { type = getPortlet().getRequestType((VaadinPortletRequest) request); request.setAttribute(RequestType.class.getName(), type); } return type; }
/** * Returns the JSR-286 portlet configuration that provides access to the * portlet context and init parameters. * * @return portlet configuration */ public PortletConfig getPortletConfig() { VaadinPortletResponse response = (VaadinPortletResponse) CurrentInstance .get(VaadinResponse.class); return response.getService().getPortlet().getPortletConfig(); }
@Override protected LegacyApplication createApplication() { VaadinPortlet portlet = VaadinPortlet.getCurrent(); if (portlet instanceof LegacyVaadinPortlet) { LegacyVaadinPortlet legacyPortlet = (LegacyVaadinPortlet) portlet; PortletRequest request = VaadinPortletService .getCurrentPortletRequest(); if (legacyPortlet.shouldCreateApplication(request)) { try { return legacyPortlet.getNewApplication(request); } catch (PortletException e) { throw new RuntimeException(e); } } } return null; } };
@Override public void init(PortletConfig config) throws PortletException { applicationContext = PortletApplicationContextUtils.getWebApplicationContext(config.getPortletContext()); if (config.getInitParameter(CONTEXT_CONFIG_LOCATION_PARAMETER) != null) { XmlPortletApplicationContext context = new XmlPortletApplicationContext(); context.setParent(applicationContext); context.setConfigLocation(config.getInitParameter(CONTEXT_CONFIG_LOCATION_PARAMETER)); context.setPortletConfig(config); context.setPortletContext(config.getPortletContext()); context.refresh(); applicationContext = context; } if (config.getInitParameter(SYSTEM_MESSAGES_BEAN_NAME_PARAMETER) != null) { systemMessagesBeanName = config.getInitParameter(SYSTEM_MESSAGES_BEAN_NAME_PARAMETER); logger.debug("found SYSTEM_MESSAGES_BEAN_NAME_PARAMETER: {}", systemMessagesBeanName); } if (SpringApplicationContext.getApplicationContext() == null) { SpringApplicationContext.setApplicationContext(applicationContext); } super.init(config); }