Package com.google.caja.opensocial

Examples of com.google.caja.opensocial.DefaultGadgetRewriter


        }
      };

      MessageQueue mq = new SimpleMessageQueue();
      BuildInfo bi = BuildInfo.getInstance();
      DefaultGadgetRewriter rw = new DefaultGadgetRewriter(bi, mq);
      rw.setValijaMode(true);
      InputSource is = new InputSource(retrievedUri);
      String origContent = content.getContent();
      CharProducer input = CharProducer.Factory.create(
          new StringReader(origContent),
          FilePosition.instance(is, 5, 5, 5));
      StringBuilder output = new StringBuilder();

      // Secure default to remove content in case there
      // are problems cajoling a gadget
      content.setContent("");
      try {
        rw.rewriteContent(retrievedUri, input, cb, output);
      } catch (GadgetRewriteException e) {
        content.setContent(messagesToHtml(is, origContent, mq));
        throwCajolingException(e, mq);
        return;
      } catch (IOException e) {
View Full Code Here


          return;
        }
      }
      MessageQueue mq = new SimpleMessageQueue();
      BuildInfo bi = BuildInfo.getInstance();
      DefaultGadgetRewriter rw = new DefaultGadgetRewriter(bi, mq);
      InputSource is = new InputSource(retrievedUri);
      boolean safe = false;
     
      try {
        Pair<Node, Element> htmlAndJs = rw.rewriteContent(retrievedUri, root, cb);
        Node html = htmlAndJs.a;
        Element script = htmlAndJs.b;

        cajoledOutput = doc.createElement("div");
        cajoledOutput.setAttribute("id", "cajoled-output");
View Full Code Here

TOP

Related Classes of com.google.caja.opensocial.DefaultGadgetRewriter

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.