Package org.apache.shindig.gadgets.rewrite

Examples of org.apache.shindig.gadgets.rewrite.LinkRewriter


      Integer expires = rewriterFeatureFactory.getDefault(gadget.getContext().getContainer()).getExpires();
      ContentRewriterFeature rewriterFeature =
          rewriterFeatureFactory.createRewriteAllFeature(expires == null ? -1 : expires);

      String proxyBaseNoGadget = rewriterUris.getProxyBase(gadget.getContext().getContainer());
      LinkRewriter cssImportRewriter = new SanitizingProxyingLinkRewriter(gadget.getSpec().getUrl(),
          rewriterFeature, proxyBaseNoGadget, "text/css");
      LinkRewriter imageRewriter = new SanitizingProxyingLinkRewriter(gadget.getSpec().getUrl(),
          rewriterFeature, proxyBaseNoGadget, "image/*");

      // Create the set of filters to process in order.
      filters = ImmutableList.of(
        new BasicElementFilter(allowedTags, allowedAttributes),
View Full Code Here


  @Override
  protected void setUp() throws Exception {
    super.setUp();
    parser = new CajaCssParser();
    sanitizer = new CajaCssSanitizer(parser);
    importRewriter = new LinkRewriter() {
      public String rewrite(String link, Uri context) {
        return link + "&" + ProxyBase.SANITIZE_CONTENT_PARAM + "=1&rewriteMime=text/css";
      }
    };
    imageRewriter = new LinkRewriter() {
      public String rewrite(String link, Uri context) {
        return link + "&" + ProxyBase.SANITIZE_CONTENT_PARAM + "=1&rewriteMime=image/*";
      }
    };
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    parser = new CajaCssParser();
    sanitizer = new CajaCssSanitizer(parser);
    importRewriter = new LinkRewriter() {
      public String rewrite(String link, Uri context) {
        return link + '&' + ProxyBase.SANITIZE_CONTENT_PARAM + "=1&rewriteMime=text/css";
      }
    };
    imageRewriter = new LinkRewriter() {
      public String rewrite(String link, Uri context) {
        return link + '&' + ProxyBase.SANITIZE_CONTENT_PARAM + "=1&rewriteMime=image/*";
      }
    };
  }
View Full Code Here

    }
    if (isHTML(mimeType)) {
      Map<String, HtmlTagTransformer> transformerMap = Maps.newHashMap();

      if (getProxyUrl() != null) {
        LinkRewriter linkRewriter = createLinkRewriter(spec, rewriterFeature);
        LinkingTagRewriter rewriter = new LinkingTagRewriter(
            linkRewriter,
            source);
        Set<String> toProcess = Sets.newHashSet(rewriter.getSupportedTags());
        toProcess.retainAll(rewriterFeature.getIncludedTags());
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.rewrite.LinkRewriter

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.