Package org.apache.tapestry

Examples of org.apache.tapestry.IPage


     * @since 1.0.2
     */

    public void rewindForm(IForm form)
    {
        IPage page = form.getPage();
        String pageName = page.getPageName();

        _rewinding = true;

        _monitor.pageRewindBegin(pageName);

        // Fake things a little for getNextActionId() / isRewound()
        // This used to be more involved (and include service parameters, and a parameter
        // to this method), when the actionId was part of the Form name. That's not longer
        // necessary (no service parameters), and we can fake things here easily enough with
        // fixed actionId of 0.

        _targetActionId = 0;
        _actionId = -1;

        _targetComponent = form;

        try
        {
            page.beginPageRender();

            form.rewind(NullWriter.getSharedInstance(), this);

            // Shouldn't get this far, because the form should
            // throw the RenderRewoundException.

            throw new StaleLinkException(Tapestry.format("RequestCycle.form-rewind-failure", form
                    .getExtendedId()), form);
        }
        catch (RenderRewoundException ex)
        {
            // This is acceptible and expected.
        }
        catch (ApplicationRuntimeException ex)
        {
            // RequestCycleExceptions don't need to be wrapped.
            throw ex;
        }
        catch (Throwable ex)
        {
            // But wrap other exceptions in a ApplicationRuntimeException ... this
            // will ensure that some of the context is available.

            throw new ApplicationRuntimeException(ex.getMessage(), page, null, ex);
        }
        finally
        {
            page.endPageRender();

            _monitor.pageRewindEnd(pageName);

            reset();
            _rewinding = false;
View Full Code Here


    /** @since 3.0 * */

    public void activate(String name)
    {
        IPage page = getPage(name);

        activate(page);
    }
View Full Code Here

        {
            startTime = System.currentTimeMillis();

            writeDocType(writer, cycle);

            IPage page = getPage();

            writer.comment("Application: " + getApplicationSpecification().getName());

            writer.comment("Page: " + page.getPageName());
            writer.comment("Generated: " + new Date());

            writer.begin("html");
            writer.println();
            writer.begin("head");
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

        Defense.isAssignable(parameter, ActionServiceParameter.class, "parameter");

        ActionServiceParameter asp = (ActionServiceParameter) parameter;

        IComponent component = asp.getComponent();
        IPage activePage = cycle.getPage();
        IPage componentPage = component.getPage();

        Map parameters = new HashMap();

        boolean stateful = _request.getSession(false) != null;

        parameters.put(ServiceConstants.SERVICE, Tapestry.ACTION_SERVICE);
        parameters.put(ServiceConstants.COMPONENT, component.getIdPath());
        parameters.put(ServiceConstants.PAGE, activePage.getPageName());
        parameters.put(ServiceConstants.CONTAINER, activePage == componentPage ? null
                : componentPage.getPageName());
        parameters.put(ACTION, asp.getActionId());
        parameters.put(ServiceConstants.SESSION, stateful ? "T" : null);

        return _linkFactory.constructLink(cycle, parameters, true);
    }
View Full Code Here

        String componentPageName = cycle.getParameter(ServiceConstants.CONTAINER);
        String activePageName = cycle.getParameter(ServiceConstants.PAGE);
        String actionId = cycle.getParameter(ACTION);
        boolean activeSession = cycle.getParameter(ServiceConstants.SESSION) != null;

        IPage page = cycle.getPage(activePageName);

        // Setup the page for the rewind, then do the rewind.

        cycle.activate(page);

        IPage componentPage = componentPageName == null ? page : cycle.getPage(componentPageName);

        IComponent component = componentPage.getNestedComponent(componentId);

        IAction action = null;

        try
        {
View Full Code Here

    public void pageBeginRender(PageEvent event)
    {
        Inspector inspector = (Inspector) getPage();

        IPage inspectedPage = inspector.getInspectedPage();

        String pageName = inspectedPage.getPageName();

        PropertyPersistenceStrategySource source = getPropertySource();

        Collection properties = source.getAllStoredChanges(pageName);
View Full Code Here

    public abstract String getSubtitle();

    public void finishLoad()
    {
        IPage page = getPage();

        String pageName = page.getPageName();

        _pageType = page.getSpecification().getProperty("page-type");

        if (_pageType == null)
            _pageType = pageName;

        _titleImage = getAsset("title_" + pageName);
View Full Code Here

    {
        IRequestCycle cycle = newCycle();
        ErrorLog log = newLog();

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        IComponentSpecification spec = newSpec("foobar", "session");

        page.getSpecification();
        pagec.setReturnValue(spec);

        page.getIdPath();
        pagec.setReturnValue(null);

        MockControl sourcec = newControl(PropertyPersistenceStrategySource.class);
        PropertyPersistenceStrategySource source = (PropertyPersistenceStrategySource) sourcec
                .getMock();
View Full Code Here

    {
        IRequestCycle cycle = newCycle();
        ErrorLog log = newLog();

        MockControl pagec = newControl(IPage.class);
        IPage page = (IPage) pagec.getMock();

        IComponent component = (IComponent) newMock(IComponent.class);

        MockControl sourcec = newControl(PropertyPersistenceStrategySource.class);
        PropertyPersistenceStrategySource source = (PropertyPersistenceStrategySource) sourcec
                .getMock();

        PropertyChange pc = new PropertyChangeImpl("fred.barney", "id", "ziff");

        source.getAllStoredChanges("MyPage", cycle);
        sourcec.setReturnValue(Collections.singletonList(pc));

        page.getNestedComponent("fred.barney");
        pagec.setReturnValue(component);

        component.setId("ziff");

        replayControls();
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.