Package com.github.dandelion.core.asset

Examples of com.github.dandelion.core.asset.AssetQuery


    if (isRelevant(request, wrappedResponse)) {

      String html = new String(bytes);

      Set<Asset> assetsHead = new AssetQuery(request, context).withPosition(AssetDomPosition.head).perform();

      if (!assetsHead.isEmpty()) {
        StringBuilder htmlHead = new StringBuilder();
        for (Asset asset : assetsHead) {
          HtmlTag tag = HtmlUtils.transformAsset(asset);
          htmlHead.append(tag.toHtml());
          htmlHead.append('\n');
        }

        html = html.replace("</head>", htmlHead + "\n</head>");
      }

      Set<Asset> assetsBody = new AssetQuery(request, context).withPosition(AssetDomPosition.body).perform();

      if (!assetsBody.isEmpty()) {
        StringBuilder htmlBody = new StringBuilder();
        for (Asset asset : assetsBody) {
          HtmlTag tag = HtmlUtils.transformAsset(asset);
View Full Code Here


    StringBuilder sbBody = new StringBuilder();

    String graphView = ResourceUtils.getContentFromInputStream(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream("dandelion/internal/graphViewer/graphViewer.html"));

    Set<Asset> assetsHead = new AssetQuery(request, context).withPosition(AssetDomPosition.head).perform();
    Iterator<Asset> iteratorAssetHead = assetsHead.iterator();
    while (iteratorAssetHead.hasNext()) {
      sbHead.append("    &lt;link href=\"" + iteratorAssetHead.next().getFinalLocation() + "\" />");
      if (iteratorAssetHead.hasNext()) {
        sbHead.append('\n');
      }
    }

    Set<Asset> assetsBody = new AssetQuery(request, context).withPosition(AssetDomPosition.body).perform();
    Iterator<Asset> iteratorAssetBody = assetsBody.iterator();
    while (iteratorAssetBody.hasNext()) {
      sbBody.append("    &lt;script src=\"" + iteratorAssetBody.next().getFinalLocation() + "\"></script>");
      if (iteratorAssetBody.hasNext()) {
        sbBody.append('\n');
View Full Code Here

TOP

Related Classes of com.github.dandelion.core.asset.AssetQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.