Examples of rewrite()


Examples of org.apache.portals.applications.webcontent.proxy.impl.DefaultReverseProxyLinkRewritingParserAaptor.rewrite()

        BeanUtils.setProperty(parserAdaptor, "customPatterns", new String [] { "\\/lazyLoader" });
        BeanUtils.setProperty(parserAdaptor, "customReplaces", new String [] { "/busyLoader" });
       
        StringReader reader = new StringReader(html);
        StringWriter writer = new StringWriter();
        parserAdaptor.rewrite(null, reader, writer);
       
        log.info("source: \n" + html);
        log.info("result: \n" + writer);
       
        List<String> lines = (List<String>) IOUtils.readLines(new StringReader(writer.toString()));
View Full Code Here

Examples of org.apache.portals.applications.webcontent.proxy.impl.DefaultReverseProxyLinkRewritingParserAdaptor.rewrite()

        BeanUtils.setProperty(parserAdaptor, "customPatterns", new String [] { "\\/lazyLoader" });
        BeanUtils.setProperty(parserAdaptor, "customReplaces", new String [] { "/busyLoader" });
       
        StringReader reader = new StringReader(html);
        StringWriter writer = new StringWriter();
        parserAdaptor.rewrite(null, reader, writer);
       
        log.info("source: \n" + html);
        log.info("result: \n" + writer);
       
        List<String> lines = (List<String>) IOUtils.readLines(new StringReader(writer.toString()));
View Full Code Here

Examples of org.apache.shindig.gadgets.rewrite.GadgetRewriter.rewrite()

  private String rewrite(Gadget gadget, String content, Set<String> tags, Set<String> attributes)
      throws Exception {
    GadgetRewriter rewriter = createRewriter(tags, attributes);

    MutableContent mc = new MutableContent(parser, content);
    rewriter.rewrite(gadget, mc);

    Matcher matcher = BODY_REGEX.matcher(mc.getContent());
    if (matcher.matches()) {
      return matcher.group(1);
    }
View Full Code Here

Examples of org.apache.shindig.gadgets.rewrite.GadgetRewriter.rewrite()

    String fullMarkup = mc.getContent();
   
    Element paragraphTag = (Element) document.getElementsByTagName("p").item(0);
    // Mark the paragraph tag element as trusted
    SanitizingGadgetRewriter.bypassSanitization(paragraphTag, true);
    rewriter.rewrite(gadget, mc);
    
    // The document should be unchanged
    assertEquals(fullMarkup, mc.getContent());
  }
    
View Full Code Here

Examples of org.apache.shindig.gadgets.rewrite.GadgetRewriter.rewrite()

    Document document = mc.getDocument();
   
    Element paragraphTag = (Element) document.getElementsByTagName("p").item(0);
    // Mark the paragraph tag element as trusted
    SanitizingGadgetRewriter.bypassSanitization(paragraphTag, false);
    rewriter.rewrite(gadget, mc);
    
    // The document should be unchanged
    String content = mc.getContent();
    Matcher matcher = BODY_REGEX.matcher(content);
    matcher.matches();
View Full Code Here

Examples of org.apache.shindig.gadgets.rewrite.GadgetRewriter.rewrite()

    // Now, clone the paragraph tag and replace the paragraph tag
    Element cloned = (Element) paragraphTag.cloneNode(true);
    paragraphTag.getParentNode().replaceChild(cloned, paragraphTag);

    rewriter.rewrite(gadget, mc);
    
    // The document should be unchanged
    String content = mc.getContent();
    Matcher matcher = BODY_REGEX.matcher(content);
    matcher.matches();
View Full Code Here

Examples of org.apache.shindig.gadgets.rewrite.RequestRewriter.rewrite()

    request.setSanitizationRequested(true);
    RequestRewriter rewriter = createRewriter(Collections.<String>emptySet(),
        Collections.<String>emptySet());

    MutableContent mc = new MutableContent(parser, response);
    if (!rewriter.rewrite(request, response, mc)) {
      return null;
    }
    return mc.getContent();
  }
View Full Code Here

Examples of org.apache.shindig.gadgets.rewrite.ResponseRewriter.rewrite()

  private String rewrite(HttpRequest request, HttpResponse response) throws Exception {
    request.setSanitizationRequested(true);
    ResponseRewriter rewriter = createRewriter();

    HttpResponseBuilder hrb = new HttpResponseBuilder(parser, response);
    rewriter.rewrite(request, hrb);
    return hrb.getContent();
  }

  private ResponseRewriter createRewriter() {
    return new CajaResponseRewriter(new RequestPipeline() {
View Full Code Here

Examples of org.aspectj.weaver.patterns.PointcutRewriter.rewrite()

  }

  private ShadowMunger rewritePointcutInMunger(ShadowMunger munger) {
    PointcutRewriter pr = new PointcutRewriter();
    Pointcut p = munger.getPointcut();
    Pointcut newP = pr.rewrite(p);
    if (p.m_ignoreUnboundBindingForNames.length != 0) {
      // *sigh* dirty fix for dirty hacky implementation pr149305
      newP.m_ignoreUnboundBindingForNames = p.m_ignoreUnboundBindingForNames;
    }
    munger.setPointcut(newP);
View Full Code Here

Examples of org.aspectj.weaver.patterns.PointcutRewriter.rewrite()

   */
  private void rewritePointcuts(List<ShadowMunger> shadowMungers) {
    PointcutRewriter rewriter = new PointcutRewriter();
    for (ShadowMunger munger : shadowMungers) {
      Pointcut p = munger.getPointcut();
      Pointcut newP = rewriter.rewrite(p);
      // validateBindings now whilst we still have around the pointcut
      // that resembles what the user actually wrote in their program
      // text.
      if (munger instanceof Advice) {
        Advice advice = (Advice) munger;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.