for (Dependency dependency : deps) { Type type = dependency.getType(); String url = context.getUriResolver() .resolveVaadinUri(dependency.getUrl()); if (type == Type.HTMLIMPORT) {
request, context.getSession(), context.getUIClass(), document, headers, fragmentResponse.getUIProvider()); pageResponse.setUriResolver(context.getUriResolver()); List<Node> fragmentNodes = fragmentResponse.getFragmentNodes(); Element body = document.body();
BootstrapContext context = new BootstrapContext(response, bootstrapResponse); bootstrapResponse.setUriResolver(context.getUriResolver());
context.getUriResolver() .resolveVaadinUri("context://" + ApplicationConstants.VAADIN_STATIC_FILES_PATH context.getUriResolver() .resolveVaadinUri("context://" + ApplicationConstants.VAADIN_STATIC_FILES_PATH
private static void includeDependencies(Element head, JsonObject initialUIDL, BootstrapContext context) { // Extract style sheets and load them eagerly JsonArray dependencies = initialUIDL .getArray(DependencyList.DEPENDENCY_KEY); if (dependencies == null || dependencies.length() == 0) { // No dependencies at all return; } Predicate<? super JsonObject> includeStyleSheets = object -> DependencyList.TYPE_STYLESHEET .equals(object.getString(DependencyList.KEY_TYPE)); com.vaadin.hummingbird.util.JsonUtil.objectStream(dependencies) .filter(includeStyleSheets).forEach(stylesheet -> { Element link = head.appendElement("link"); link.attr("rel", "stylesheet"); link.attr("type", "text/css"); String url = stylesheet.getString(DependencyList.KEY_URL); url = context.getUriResolver().resolveVaadinUri(url); link.attr("href", url); }); // Remove from initial UIDL JsonArray otherDependencies = com.vaadin.hummingbird.util.JsonUtil .objectStream(dependencies).filter(includeStyleSheets.negate()) .collect(com.vaadin.hummingbird.util.JsonUtil.asArray()); initialUIDL.put(DependencyList.DEPENDENCY_KEY, otherDependencies); }
private static String getClientEngineUrl(BootstrapContext context) { // use nocache version of client engine if it // has been compiled by SDM or eclipse // In production mode, this should really be loaded by the static block // so emit a warning if we get here (tests will always get here) final boolean productionMode = context.getSession().getConfiguration() .isProductionMode(); boolean resolveNow = !productionMode || clientEngineFile == null; if (resolveNow && BootstrapHandler.class.getResource( "/META-INF/resources/" + CLIENT_ENGINE_NOCACHE_FILE) != null) { return context.getUriResolver().resolveVaadinUri( "context://" + CLIENT_ENGINE_NOCACHE_FILE); } if (clientEngineFile == null) { throw new BootstrapException( "Client engine file name has not been resolved during initialization"); } return context.getUriResolver() .resolveVaadinUri("context://" + clientEngineFile); }
appConfig.put(ApplicationConstants.VAADIN_DIR_URL, vaadinDir); appConfig.put(ApplicationConstants.FRONTEND_URL, context.getUriResolver().getFrontendUrl());