Package com.google.caja.plugin

Examples of com.google.caja.plugin.UriPolicy


      }
    }

    if (cajoledData == null) {
      UriFetcher fetcher = makeFetcher(gadget);
      UriPolicy policy = makePolicy(gadget);
      URI javaGadgetUri = gadgetContext.getUrl().toJavaUri();
      MessageQueue mq = new SimpleMessageQueue();
      MessageContext context = new MessageContext();
      PluginMeta meta = new PluginMeta(fetcher, policy);
      PluginCompiler compiler = makePluginCompiler(meta, mq);
View Full Code Here


  }
 
  private UriPolicy makePolicy(Gadget gadget) {
    final Uri gadgetUri = gadget.getContext().getUrl();

    return new UriPolicy() {
      public String rewriteUri(ExternalReference ref, UriEffect effect,
          LoaderType loader, Map<String, ?> hints) {
        URI uri = ref.getUri();
        if (uri.getScheme().equalsIgnoreCase("https") ||
            uri.getScheme().equalsIgnoreCase("http")) {
View Full Code Here

  private UriPolicy proxyUriPolicy(HttpRequest request) {
    final Uri contextUri = request.getUri();
    final Gadget stubGadget = DomWalker.makeGadget(request);

    return new UriPolicy() {
      public String rewriteUri(ExternalReference ref, UriEffect effect,
          LoaderType loader, Map<String, ?> hints) {

        Uri resourceUri = Uri.fromJavaUri(ref.getUri());
        if (contextUri != null) {
View Full Code Here

      }
    }

    if (cajoledData == null) {
      UriFetcher fetcher = makeFetcher(gadget);
      UriPolicy policy = makePolicy(gadget);
      URI javaGadgetUri = gadgetContext.getUrl().toJavaUri();
      MessageQueue mq = new SimpleMessageQueue();
      MessageContext context = new MessageContext();
      PluginMeta meta = new PluginMeta(fetcher, policy);
      PluginCompiler compiler = makePluginCompiler(meta, mq);
View Full Code Here

  }
 
  private UriPolicy makePolicy(Gadget gadget) {
    final Uri gadgetUri = gadget.getContext().getUrl();

    return new UriPolicy() {
      public String rewriteUri(ExternalReference ref, UriEffect effect,
          LoaderType loader, Map<String, ?> hints) {
        URI uri = ref.getUri();
        if (uri.getScheme().equalsIgnoreCase("https") ||
            uri.getScheme().equalsIgnoreCase("http")) {
View Full Code Here

    final Holder<ExternalReference> savedRef = new Holder<ExternalReference>();

    meta = new PluginMeta(
        UriFetcher.NULL_NETWORK,
        new UriPolicy() {
          public String rewriteUri(
              ExternalReference u, UriEffect effect, LoaderType loader,
              Map<String, ?> hints) {
            assertEquals("a::href", UriPolicyHintKey.XML_ATTR.valueFrom(hints));
            savedRef.value = u;
View Full Code Here

        htmlFragment(fromString("<div></div>")),
        new Block(), true);
  }

  public final void testStyleAttrsWithUriPolicy() throws Exception {
    UriPolicy policy = new UriPolicy() {
      @Override
      public String rewriteUri(
          ExternalReference u,
          UriEffect effect,
          LoaderType loader,
View Full Code Here

TOP

Related Classes of com.google.caja.plugin.UriPolicy

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.