Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.PageRenderRequestParameters


    @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();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
View Full Code Here


        }

        // Let subclasses do more.
        configure(config);

        renderSupport.addInit("autocompleter", new JSONArray(id, menuId, link.toAbsoluteURI(), config));
    }
View Full Code Here

        "class", "t-autocomplete-menu");
        writer.end();

        Link link = resources.createEventLink(EVENT_NAME);

        JSONObject config = new JSONObject();
        config.put("paramName", PARAM_NAME);
        config.put("indicator", loaderId);

        if (resources.isBound("minChars"))
            config.put("minChars", minChars);

        if (resources.isBound("frequency"))
            config.put("frequency", frequency);

        if (resources.isBound("tokens"))
        {
            for (int i = 0; i < tokens.length(); i++)
            {
                config.accumulate("tokens", tokens.substring(i, i + 1));
            }
        }

        // Let subclasses do more.
        configure(config);
View Full Code Here

        map.put("alpha", validator);
        map.put("beta", validator);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map, null);

        try
        {
            source.createValidator(field, "foo", null);
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(), "Unknown validator type 'foo'.  Configured validators are alpha, beta.");
View Full Code Here

        train_isSecure(request, true);

        replay();
       
        PageRenderRequestParameters parameters = new PageRenderRequestParameters(PAGE_NAME, new EmptyEventContext(), false);

        RequestSecurityManager manager
                = new RequestSecurityManagerImpl(request, response, encoder, locator, source, true);

        assertFalse(manager.checkForInsecurePageRenderRequest(parameters));
View Full Code Here

        train_isSecure(locator, PAGE_NAME, false);

        replay();
       
        PageRenderRequestParameters parameters = new PageRenderRequestParameters(PAGE_NAME, new EmptyEventContext(), false);

        RequestSecurityManager manager
                = new RequestSecurityManagerImpl(request, response, encoder, locator, source, true);

        assertFalse(manager.checkForInsecurePageRenderRequest(parameters));
View Full Code Here

        train_isSecure(request, false);

        train_isSecure(locator, PAGE_NAME, true);
       
        PageRenderRequestParameters parameters = new PageRenderRequestParameters(PAGE_NAME, new EmptyEventContext(), false);

        train_createPageRenderLink(encoder, parameters, link);

        response.sendRedirect(link);
View Full Code Here

        try
        {
            // This is needed otherwise PageMarkupRendererImpl would clear the environment
            request.setAttribute(InternalConstants.GENERATING_RENDERED_PAGE, true);
           
            this.handler.handle(new PageRenderRequestParameters(pageName, context, false));
        }
        finally
        {
            request.setAttribute(InternalConstants.GENERATING_RENDERED_PAGE, generatingRederedPage);
        }
View Full Code Here

        replay();

        ComponentEventLinkEncoder encoder = new ComponentEventLinkEncoderImpl(null, contextPathEncoder, null, request,
                response, manager, optimizer, null, false);

        PageRenderRequestParameters parameters = new PageRenderRequestParameters("MyPage", new EmptyEventContext());

        Link link = encoder.createPageRenderLink(parameters);

        assertEquals(link.toAbsoluteURI(), "MAGIC");
View Full Code Here

        replay();

        ComponentEventLinkEncoder encoder = new ComponentEventLinkEncoderImpl(null, contextPathEncoder, null, request,
                response, manager, optimizer, null, false);

        PageRenderRequestParameters parameters = new PageRenderRequestParameters("admin/Index", new ArrayEventContext(
                typeCoercer, "abc"));

        Link link = encoder.createPageRenderLink(parameters);

        assertEquals(link.toAbsoluteURI(), "MAGIC");
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.PageRenderRequestParameters

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.