@Override public String getStaticFileLocation(VaadinRequest request) { // /html is default for Liferay String staticFileLocation = getParameter(request, Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, "/html"); if (Constants.PORTLET_CONTEXT.equals(staticFileLocation)) { return request.getContextPath(); } else { return trimTrailingSlashes(staticFileLocation); } }
@Override public String getContextPath() { return request.getContextPath(); }
@Override public String getContextPath() { return request.getContextPath(); }
private String getPathToVaadin() { final URI location = Page.getCurrent().getLocation(); return location.getScheme() + "://" +location.getAuthority() + VaadinService.getCurrentRequest().getContextPath() + "/VAADIN"; } }
@Override public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { String requestPath = request.getPathInfo(); // redirect to base URL if we have unparsable path tail if (!Objects.equals("/", requestPath)) { response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); response.setHeader("Location", request.getContextPath()); return true; } return super.handleRequest(session, request, response); } }
public static String getContext() { if (VaadinService.getCurrentRequest() != null) { return VaadinService.getCurrentRequest().getContextPath(); } else { return (String) VaadinSession.getCurrent().getAttribute( AnnisBaseUI.CONTEXT_PATH); } }
public void logout(UI ui) { close(); VaadinService.getCurrentRequest().getWrappedSession().invalidate(); ui.close(); String contextPath = VaadinService.getCurrentRequest().getContextPath(); ui.getPage().setLocation(contextPath); }
@Override protected MagnoliaRichTextFieldConfig initializeCKEditorConfig() { MagnoliaRichTextFieldConfig config = super.initializeCKEditorConfig(); // MAGNOLIA FILEBROWSER PLUGIN — may be used with/without customConfig boolean isCustomConfig = StringUtils.isNotBlank(definition.getConfigJsFile()); if (definition.isImages() || isCustomConfig) { // Hook in our patched filebrowser plugin for triggering assets choose dialog String path = VaadinService.getCurrentRequest().getContextPath(); config.addExternalPlugin(FILE_BROWSER_PLUGIN, path + "/VAADIN/js/filebrowser/"); config.addListenedEvent(FILE_BROWSER_PLUGIN_CHOOSE_ASSET_EVENT); if (!isCustomConfig) { config.addToExtraPlugins(FILE_BROWSER_PLUGIN); } // Make filebrowser button visible inside image dialog - just needs non-null filebrowser Url properties config.setFilebrowserImageBrowseLinkUrl("dummy"); config.setFilebrowserImageBrowseUrl("dummy"); } return config; }
@Override protected void init(VaadinRequest request) { initLogging(); // store the webservice URL property explicitly in the session in order to // access it from the "external" servlets getSession().getSession().setAttribute(WEBSERVICEURL_KEY, getSession().getAttribute(Helper.KEY_WEB_SERVICE_URL)); getSession().setAttribute(CONTEXT_PATH, request.getContextPath()); alreadyAddedCSS.clear(); initPlugins(); checkIfRemoteLoggedIn(request); getSession().addRequestHandler(new RemoteUserRequestHandler()); }
protected MagnoliaCKEditorConfig initializeCKEditorConfig() { String path = VaadinService.getCurrentRequest().getContextPath();