Package org.apache.tapestry5.urlrewriter

Examples of org.apache.tapestry5.urlrewriter.URLRewriteContext


    @SuppressWarnings("unchecked")
    @Test
    public void multiple_validators_via_specification() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator required = mockValidator();
        Validator minLength = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void validator_with_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here

        }
    }

    public Request processRequest(Request request)
    {
        request = process(request,incomingRules,new URLRewriteContext(){
            public boolean isIncoming()
            {
                return true;
            }
View Full Code Here

    public Link createComponentEventLink(final ComponentEventRequestParameters parameters, boolean forForm)
    {
        Link standardLink = delegate.createComponentEventLink(parameters, forForm);

        URLRewriteContext rewriteContext = new URLRewriteContext()
        {
            public boolean isIncoming()
            {
                return false;
            }
View Full Code Here

    public Link createPageRenderLink(final PageRenderRequestParameters parameters)
    {
        Link standardLink = delegate.createPageRenderLink(parameters);

        URLRewriteContext rewriteContext = new URLRewriteContext()
        {
            public boolean isIncoming()
            {
                return false;
            }
View Full Code Here

    {
        invocation.proceed();
        String name = invocation.getMethodName();

        Link link = (Link) invocation.getResult();
        URLRewriteContext context = setupContext(invocation);
        Link newLink = rewriteIfNeeded(link,context);

        if (newLink != null)
        {
            invocation.overrideResult(newLink);
View Full Code Here

    }

    private URLRewriteContext setupContext(final Invocation invocation) {

        if (forPageLink) {
            return new URLRewriteContext()
            {

                public boolean isIncoming()
                {
                    return false;
                }

                public PageRenderRequestParameters getPageParameters()
                {
                    return (PageRenderRequestParameters) invocation.getParameter(CONTEXT_PARAMETER_INDEX);
                }

                public ComponentEventRequestParameters getComponentEventParameters()
                {
                    return null;
                }
            };
        }
        return new URLRewriteContext()
        {

            public boolean isIncoming()
            {
                return false;
View Full Code Here

        }
    }

    public Request processRequest(Request request)
    {
        request = process(request,incomingRules,new URLRewriteContext(){
            public boolean isIncoming()
            {
                return true;
            }
View Full Code Here

  public void advise(MethodInvocation invocation) {
    invocation.proceed();

    Link link = (Link) invocation.getReturnValue();
    URLRewriteContext context = setupContext(invocation);
    Link newLink = rewriteIfNeeded(link, context);

    if (newLink != null) {
      invocation.setReturnValue(newLink);
    }
View Full Code Here

  }

  private URLRewriteContext setupContext(final MethodInvocation invocation) {

    if (forPageLink) {
      return new URLRewriteContext() {

        public boolean isIncoming() {
          return false;
        }

        public PageRenderRequestParameters getPageParameters() {
          return (PageRenderRequestParameters) invocation
              .getParameter(CONTEXT_PARAMETER_INDEX);
        }

        public ComponentEventRequestParameters getComponentEventParameters() {
          return null;
        }
      };
    }
    return new URLRewriteContext() {

      public boolean isIncoming() {
        return false;
      }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.urlrewriter.URLRewriteContext

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.