Examples of IExternalPage


Examples of org.apache.tapestry.IExternalPage

        verify();
    }

    public void testByNameNoParameters()
    {
        IExternalPage page = newExternalPage();
        IRequestCycle cycle = newCycleGetPage("Fred", page);

        cycle.activate(page);

        page.activateExternalPage(null, cycle);

        replay();

        ExternalCallback callback = new ExternalCallback("Fred", null);
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void testByPage()
    {
        Object[] parameters =
        { "param1", "param2" };

        IExternalPage page = newExternalPage("Barney");
        IRequestCycle cycle = newCycleGetPage("Barney", page);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        replay();

        ExternalCallback callback = new ExternalCallback(page, parameters);
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    {
        Defense.notNull(cycle, "cycle");

        try
        {
            IExternalPage page = (IExternalPage) cycle.getPage(_pageName);
           
            cycle.activate(page);
           
            page.activateExternalPage(_parameters, cycle);
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
        }
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    }

    public void testService() throws Exception
    {
        IRequestCycle cycle = newCycle();
        IExternalPage page = (IExternalPage) newMock(IExternalPage.class);
        Object[] parameters = new Object[0];
        LinkFactory lf = newLinkFactory();
        ResponseRenderer rr = newResponseRenderer();

        trainGetParameter(cycle, ServiceConstants.PAGE, "ActivePage");

        trainGetPage(cycle, "ActivePage", page);

        trainExtractListenerParameters(lf, cycle, parameters);

        cycle.setListenerParameters(parameters);
        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        rr.renderResponse(cycle);

        replayControls();
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void service(IRequestCycle cycle) throws IOException
    {
        String pageName = cycle.getParameter(ServiceConstants.PAGE);
        IPage rawPage = cycle.getPage(pageName);

        IExternalPage page = null;

        try
        {
            page = (IExternalPage) rawPage;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(EngineMessages.pageNotCompatible(
                    rawPage,
                    IExternalPage.class), rawPage, null, ex);
        }

        Object[] parameters = _linkFactory.extractListenerParameters(cycle);

        cycle.setListenerParameters(parameters);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        _responseRenderer.renderResponse(cycle);
    }
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    {
        Defense.notNull(cycle, "cycle");

        try
        {
            IExternalPage page = (IExternalPage) cycle.getPage(_pageName);

            cycle.activate(page);

            page.activateExternalPage(_parameters, cycle);
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(CallbackMessages.pageNotExternal(_pageName), ex);
        }
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void performCallback(IRequestCycle cycle)
    {       
        try
        {
            IExternalPage page = (IExternalPage) cycle.getPage(_pageName);
           
            cycle.activate(page);
   
            page.activateExternalPage(_parameters, cycle);           
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ExternalCallback.page-not-compatible", _pageName),
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

        IEngineServiceView engine,
        IRequestCycle cycle,
        ResponseOutputStream output)
        throws ServletException, IOException
    {
        IExternalPage page = null;

        String[] context = getServiceContext(cycle.getRequestContext());

        if (context == null || context.length != 1)
            throw new ApplicationRuntimeException(
                Tapestry.format("service-single-context-parameter", Tapestry.EXTERNAL_SERVICE));

        String pageName = context[0];

        try
        {
            page = (IExternalPage) cycle.getPage(pageName);
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ExternalService.page-not-compatible", pageName),
                ex);
        }

        Object[] parameters = getParameters(cycle);

        cycle.setServiceParameters(parameters);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        // Render the response.
        engine.renderResponse(cycle, output);
    }
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

    public void performCallback(IRequestCycle cycle)
    {       
        try
        {
            IExternalPage page = (IExternalPage) cycle.getPage(_pageName);
           
            cycle.activate(page);
   
            page.activateExternalPage(_parameters, cycle);           
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ExternalCallback.page-not-compatible", _pageName),
View Full Code Here

Examples of org.apache.tapestry.IExternalPage

        IEngineServiceView engine,
        IRequestCycle cycle,
        ResponseOutputStream output)
        throws ServletException, IOException
    {
        IExternalPage page = null;

        String[] context = getServiceContext(cycle.getRequestContext());

        if (context == null || context.length != 1)
            throw new ApplicationRuntimeException(
                Tapestry.format("service-single-context-parameter", Tapestry.EXTERNAL_SERVICE));

        String pageName = context[0];

        try
        {
            page = (IExternalPage) cycle.getPage(pageName);
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ExternalService.page-not-compatible", pageName),
                ex);
        }

        Object[] parameters = getParameters(cycle);

        cycle.setServiceParameters(parameters);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        // Render the response.
        engine.renderResponse(cycle, output);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.