Package org.apache.tapestry

Examples of org.apache.tapestry.IPage


    }

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

        IExternalPage page = null;

        try
        {
View Full Code Here


    }

    private IPage newPage(String name)
    {
        MockControl control = newControl(IPage.class);
        IPage page = (IPage) control.getMock();

        page.getPageName();
        control.setReturnValue(name);

        return page;
    }
View Full Code Here

        return cycle;
    }

    public void testSuccess() throws Exception
    {
        IPage page = newPage("Frodo");
        IRequestCycle cycle = newCycle(page);
        ActionResponse response = newResponse();

        response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.RENDER_SERVICE);
        response.setRenderParameter(ServiceConstants.PAGE, "Frodo");
View Full Code Here

    public IPage getPage(IRequestCycle cycle, String pageName)
    {
        IEngine engine = cycle.getEngine();
        Object key = buildKey(engine, pageName);
        IPage result = (IPage) _pool.get(key);

        if (result == null)
        {
            _pageSpecificationResolver.resolve(cycle, pageName);

            // The loader is responsible for invoking attach(),
            // and for firing events to PageAttachListeners

            result = _loader.loadPage(
                    _pageSpecificationResolver.getSimplePageName(),
                    _pageSpecificationResolver.getNamespace(),
                    cycle,
                    _pageSpecificationResolver.getSpecification());
        }
        else
        {
            // But for pooled pages, we are responsible.
            // This call will also fire events to any PageAttachListeners

            result.attach(engine, cycle);
        }

        return result;
    }
View Full Code Here

    public void service(IRequestCycle cycle) throws IOException
    {
        String pageName = cycle.getParameter(ServiceConstants.PAGE);
        String componentId = cycle.getParameter(ServiceConstants.COMPONENT);

        IPage page = cycle.getPage(pageName);
        IComponent component = page.getNestedComponent(componentId);

        try
        {
            IChartProvider provider = (IChartProvider) component;
View Full Code Here

    public void renderPage(IRequestCycle cycle, String pageName) throws IOException
    {
        cycle.activate(pageName);

        IPage page = cycle.getPage();

        ContentType contentType = page.getResponseContentType();

        PrintWriter printWriter = _response.getPrintWriter(contentType);

        IMarkupWriter writer = _markupWriterSource.newMarkupWriter(printWriter, contentType);

        String namespace = _response.getNamespace();

        PageRenderSupportImpl support = new PageRenderSupportImpl(_assetService, namespace, null);

        TapestryUtils.storePageRenderSupport(cycle, support);

        IMarkupWriter nested = writer.getNestedWriter();

        cycle.renderPage(nested);

        String id = "Tapestry Portlet " + _applicationId + " " + namespace;

        writer.comment("BEGIN " + id);
        writer.comment("Page: " + page.getPageName());
        writer.comment("Generated: " + new Date());
        writer.comment("Framework version: " + Tapestry.VERSION);

        support.writeBodyScript(writer, cycle);
View Full Code Here

                break;
            }
            catch (RemoteException ex)
            {
                IPage page = getPage();

                if (i++ == 0)
                    getListener().actionTriggered(this, page.getRequestCycle());
                else
                {
                    VirtualLibraryEngine vengine = (VirtualLibraryEngine) page.getEngine();
                    vengine.rmiFailure("Unable to retrieve query results.", ex, i);
                }

            }
        }
View Full Code Here

    public void renderResponse(IRequestCycle cycle)
    throws IOException
    {
        _localeManager.persistLocale();
       
        IPage page = cycle.getPage();
       
        ContentType contentType = page.getResponseContentType();
       
        String encoding = contentType.getParameter(ENCODING_KEY);
       
        if (encoding == null)
        {
View Full Code Here

public class BaseTagWriter implements IRender
{

    public void render(IMarkupWriter writer, IRequestCycle cycle)
    {
        IPage page = cycle.getPage();

        StringBuffer sb = new StringBuffer();
        sb.append("/");

        if (page.getNamespace().getId() == null)
        {
            String name = page.getPageName();
            int slashx = name.lastIndexOf('/');

            // Include the directory and trailing slash.
            if (slashx > 0)
                sb.append(name.substring(0, slashx + 1));
View Full Code Here

    {
        if (_writer == null) {
           
            _localeManager.persistLocale();
           
            IPage page = cycle.getPage();

            ContentType contentType = page.getResponseContentType();

            String encoding = contentType.getParameter(ENCODING_KEY);

            if (encoding == null)
            {
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IPage

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.