Package org.apache.shindig.gadgets.rewrite

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


    return new DomWalker.Rewriter() {
      @Override
      public void rewrite(Gadget gadget, MutableContent content)
          throws RewritingException {
        stringBuilder.append("exceptionThrown");
        throw new RewritingException("sad", 404);
      }

      @Override
      public void rewrite(HttpRequest request, HttpResponseBuilder builder, Gadget gadget)
          throws RewritingException {
        stringBuilder.append("exceptionThrown");
        throw new RewritingException("sad", 404);
      }
    };
  }
View Full Code Here


  public void testReturnOriginalResponseIfRewritingFails() throws Exception {
    ResponseRewriter throwingRewriter = new ResponseRewriter() {
      public void rewrite(HttpRequest request, HttpResponseBuilder response, Gadget gadget)
              throws RewritingException {
        response.setContent(REWRITE_CONTENT);
        throw new RewritingException("", 404);
      }
    };
    rewriterRegistry = new DefaultResponseRewriterRegistry(
        Arrays.<ResponseRewriter>asList(throwingRewriter), null);
    servlet = new HtmlAccelServlet();
View Full Code Here

        injectOnLoadHandlers(body);
      }

      mutableContent.documentChanged();
    } catch (GadgetException e) {
      throw new RewritingException(e.getLocalizedMessage(), e, e.getHttpStatusCode());
    }
  }
View Full Code Here

      Document document = mutableContent.getDocument();
      Element head = (Element)DomUtil.getFirstNamedChildNode(document.getDocumentElement(), "head");
      injectI18NConstants(gadget, head);
      mutableContent.documentChanged();
    } catch (GadgetException e) {
      throw new RewritingException(e, e.getHttpStatusCode());
    }
  }
View Full Code Here

        injectOnLoadHandlers(body);
      }

      mutableContent.documentChanged();
    } catch (GadgetException e) {
      throw new RewritingException(e.getLocalizedMessage(), e, e.getHttpStatusCode());
    }
  }
View Full Code Here

      Document document = mutableContent.getDocument();
      Element head = (Element)DomUtil.getFirstNamedChildNode(document.getDocumentElement(), "head");
      injectI18NConstants(gadget, head);
      mutableContent.documentChanged();
    } catch (GadgetException e) {
      throw new RewritingException(e, e.getHttpStatusCode());
    }
  }
View Full Code Here

      injectOnLoadHandlers(body);

      mutableContent.documentChanged();
    } catch (GadgetException e) {
      throw new RewritingException(e.getLocalizedMessage(), e, e.getHttpStatusCode());
    }
  }
View Full Code Here

      injectOnLoadHandlers(body);

      mutableContent.documentChanged();
    } catch (GadgetException e) {
      throw new RewritingException(e.getLocalizedMessage(), e, e.getHttpStatusCode());
    }
  }
View Full Code Here

      final StringBuilder stringBuilder) {
    return new DomWalker.Rewriter() {
      public void rewrite(Gadget gadget, MutableContent content)
          throws RewritingException {
        stringBuilder.append("exceptionThrown");
        throw new RewritingException("sad", 404);
      }

      public void rewrite(HttpRequest request, HttpResponseBuilder builder)
          throws RewritingException {
        stringBuilder.append("exceptionThrown");
        throw new RewritingException("sad", 404);
      }
    };
  }
View Full Code Here

TOP

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

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.