Package org.apache.tapestry

Examples of org.apache.tapestry.IAction


        IPage componentPage = (IPage) componentPagec.getMock();

        cycle.getPage("ComponentPage");
        cyclec.setReturnValue(componentPage);

        IAction action = (IAction) newMock(IAction.class);

        componentPage.getNestedComponent("fred.barney");
        componentPagec.setReturnValue(action);

        cycle.rewindPage("action-id", action);
View Full Code Here


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

        IComponent component = componentPage.getNestedComponent(componentId);

        IAction action = null;

        try
        {
            action = (IAction) component;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(EngineMessages.wrongComponentType(
                    component,
                    IAction.class), component, null, ex);
        }

        // Only perform the stateful check if the application was stateful
        // when the URL was rendered.

        if (activeSession && action.getRequiresSession())
        {
            WebSession session = _request.getSession(false);

            if (session == null || session.isNew())
                throw new StaleSessionException(EngineMessages.requestStateSession(component),
View Full Code Here

        cycle.getPage("ActivePage");
        cyclec.setReturnValue(page);

        cycle.activate(page);

        IAction action = (IAction) newMock(IAction.class);

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

        cycle.rewindPage("action-id", action);
View Full Code Here

        cyclec.setReturnValue(page);

        cycle.activate(page);

        MockControl actionc = newControl(IAction.class);
        IAction action = (IAction) actionc.getMock();

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

        action.getRequiresSession();
        actionc.setReturnValue(true);

        WebSession session = newWebSession(false);
        WebRequest request = newWebRequest(session);
View Full Code Here

        cyclec.setReturnValue(page);

        cycle.activate(page);

        MockControl actionc = newControl(IAction.class);
        IAction action = (IAction) actionc.getMock();

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

        action.getRequiresSession();
        actionc.setReturnValue(true);

        WebRequest request = newWebRequest(null);

        action.getExtendedId();
        actionc.setReturnValue("ActivePage/fred.barney");

        Location l = fabricateLocation(2);

        page.getLocation();
View Full Code Here

        IPage componentPage = (IPage) componentPagec.getMock();

        cycle.getPage("ComponentPage");
        cyclec.setReturnValue(componentPage);

        IAction action = (IAction) newMock(IAction.class);

        componentPage.getNestedComponent("fred.barney");
        componentPagec.setReturnValue(action);

        cycle.rewindPage("action-id", action);
View Full Code Here

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

        IComponent component = componentPage.getNestedComponent(componentId);

        IAction action = null;

        try
        {
            action = (IAction) component;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(EngineMessages.wrongComponentType(
                    component,
                    IAction.class), component, null, ex);
        }

        // Only perform the stateful check if the application was stateful
        // when the URL was rendered.

        if (activeSession && action.getRequiresSession())
        {
            WebSession session = _request.getSession(false);

            if (session == null || session.isNew())
                throw new StaleSessionException(EngineMessages.requestStateSession(component),
View Full Code Here

    } finally { }}

    public void service(IEngineServiceView engine, IRequestCycle cycle, ResponseOutputStream output)
            throws ServletException, IOException
    {try { __CLOVER_73_0.M[3023]++;
        __CLOVER_73_0.S[12423]++;IAction action = null;
        __CLOVER_73_0.S[12424]++;String componentPageName;
        __CLOVER_73_0.S[12425]++;int count = 0;

        __CLOVER_73_0.S[12426]++;String[] serviceContext = getServiceContext(cycle.getRequestContext());

        __CLOVER_73_0.S[12427]++;if ((((serviceContext != null) && (++__CLOVER_73_0.CT[2130] != 0)) || (++__CLOVER_73_0.CF[2130] == 0))){
            __CLOVER_73_0.S[12428]++;count = serviceContext.length;}

        __CLOVER_73_0.S[12429]++;if ((((count != 4 && count != 5) && (++__CLOVER_73_0.CT[2131] != 0)) || (++__CLOVER_73_0.CF[2131] == 0))){
            __CLOVER_73_0.S[12430]++;throw new ApplicationRuntimeException(Tapestry
                    .getMessage("ActionService.context-parameters"));}

        __CLOVER_73_0.S[12431]++;boolean complex = count == 5;

        __CLOVER_73_0.S[12432]++;int i = 0;
        __CLOVER_73_0.S[12433]++;String stateful = serviceContext[i++];
        __CLOVER_73_0.S[12434]++;String pageName = serviceContext[i++];
        __CLOVER_73_0.S[12435]++;String targetActionId = serviceContext[i++];

        __CLOVER_73_0.S[12436]++;if ((((complex) && (++__CLOVER_73_0.CT[2132] != 0)) || (++__CLOVER_73_0.CF[2132] == 0))){
            __CLOVER_73_0.S[12437]++;componentPageName = serviceContext[i++];}
        else{
            __CLOVER_73_0.S[12438]++;componentPageName = pageName;}

        __CLOVER_73_0.S[12439]++;String targetIdPath = serviceContext[i++];

        __CLOVER_73_0.S[12440]++;IPage page = cycle.getPage(pageName);

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

        __CLOVER_73_0.S[12441]++;cycle.activate(page);

        __CLOVER_73_0.S[12442]++;IPage componentPage = cycle.getPage(componentPageName);
        __CLOVER_73_0.S[12443]++;IComponent component = componentPage.getNestedComponent(targetIdPath);

        __CLOVER_73_0.S[12444]++;try
        {
            __CLOVER_73_0.S[12445]++;action = (IAction) component;
        }
        catch (ClassCastException ex)
        {
            __CLOVER_73_0.S[12446]++;throw new ApplicationRuntimeException(Tapestry.format(
                    "ActionService.component-wrong-type",
                    component.getExtendedId()), component, null, ex);
        }

        // Only perform the stateful check if the application was stateful
        // when the URL was rendered.

        __CLOVER_73_0.S[12447]++;if ((((stateful.equals(STATEFUL_ON) && action.getRequiresSession()) && (++__CLOVER_73_0.CT[2133] != 0)) || (++__CLOVER_73_0.CF[2133] == 0))){
        {
            __CLOVER_73_0.S[12448]++;HttpSession session = cycle.getRequestContext().getSession();

            __CLOVER_73_0.S[12449]++;if ((((session == null || session.isNew()) && (++__CLOVER_73_0.CT[2134] != 0)) || (++__CLOVER_73_0.CF[2134] == 0))){
                __CLOVER_73_0.S[12450]++;throw new StaleSessionException();}
View Full Code Here

        IEngineServiceView engine,
        IRequestCycle cycle,
        ResponseOutputStream output)
        throws ServletException, IOException
    {try { __CLOVER_73_0.M[432]++;
        __CLOVER_73_0.S[1835]++;IAction action = null;
        __CLOVER_73_0.S[1836]++;String componentPageName;
        __CLOVER_73_0.S[1837]++;int count = 0;

        __CLOVER_73_0.S[1838]++;String[] serviceContext = getServiceContext(cycle.getRequestContext());

        __CLOVER_73_0.S[1839]++;if ((((serviceContext != null) && (++__CLOVER_73_0.CT[343] != 0)) || (++__CLOVER_73_0.CF[343] == 0))){
            __CLOVER_73_0.S[1840]++;count = serviceContext.length;}

        __CLOVER_73_0.S[1841]++;if ((((count != 4 && count != 5) && (++__CLOVER_73_0.CT[344] != 0)) || (++__CLOVER_73_0.CF[344] == 0))){
            __CLOVER_73_0.S[1842]++;throw new ApplicationRuntimeException(
                Tapestry.getMessage("ActionService.context-parameters"));}

        __CLOVER_73_0.S[1843]++;boolean complex = count == 5;

        __CLOVER_73_0.S[1844]++;int i = 0;
        __CLOVER_73_0.S[1845]++;String stateful = serviceContext[i++];
        __CLOVER_73_0.S[1846]++;String pageName = serviceContext[i++];
        __CLOVER_73_0.S[1847]++;String targetActionId = serviceContext[i++];

        __CLOVER_73_0.S[1848]++;if ((((complex) && (++__CLOVER_73_0.CT[345] != 0)) || (++__CLOVER_73_0.CF[345] == 0))){
            __CLOVER_73_0.S[1849]++;componentPageName = serviceContext[i++];}
        else{
            __CLOVER_73_0.S[1850]++;componentPageName = pageName;}

        __CLOVER_73_0.S[1851]++;String targetIdPath = serviceContext[i++];

        __CLOVER_73_0.S[1852]++;IPage page = cycle.getPage(pageName);

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

    __CLOVER_73_0.S[1853]++;cycle.activate(page);
   
        __CLOVER_73_0.S[1854]++;IPage componentPage = cycle.getPage(componentPageName);
        __CLOVER_73_0.S[1855]++;IComponent component = componentPage.getNestedComponent(targetIdPath);

        __CLOVER_73_0.S[1856]++;try
        {
            __CLOVER_73_0.S[1857]++;action = (IAction) component;
        }
        catch (ClassCastException ex)
        {
            __CLOVER_73_0.S[1858]++;throw new ApplicationRuntimeException(
                Tapestry.format("ActionService.component-wrong-type", component.getExtendedId()),
                component,
                null,
                ex);
        }

        // Only perform the stateful check if the application was stateful
        // when the URL was rendered.

        __CLOVER_73_0.S[1859]++;if ((((stateful.equals(STATEFUL_ON) && action.getRequiresSession()) && (++__CLOVER_73_0.CT[346] != 0)) || (++__CLOVER_73_0.CF[346] == 0))){
        {
            __CLOVER_73_0.S[1860]++;HttpSession session = cycle.getRequestContext().getSession();

            __CLOVER_73_0.S[1861]++;if ((((session == null || session.isNew()) && (++__CLOVER_73_0.CT[347] != 0)) || (++__CLOVER_73_0.CF[347] == 0))){
                __CLOVER_73_0.S[1862]++;throw new StaleSessionException();}
View Full Code Here

        IEngineServiceView engine,
        IRequestCycle cycle,
        ResponseOutputStream output)
        throws ServletException, IOException
    {
        IAction action = null;
        String componentPageName;
        int count = 0;

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

        if (serviceContext != null)
            count = serviceContext.length;

        if (count != 4 && count != 5)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("ActionService.context-parameters"));

        boolean complex = count == 5;

        int i = 0;
        String stateful = serviceContext[i++];
        String pageName = serviceContext[i++];
        String targetActionId = serviceContext[i++];

        if (complex)
            componentPageName = serviceContext[i++];
        else
            componentPageName = pageName;

        String targetIdPath = serviceContext[i++];

        IPage page = cycle.getPage(pageName);

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

    cycle.activate(page);
   
        IPage componentPage = cycle.getPage(componentPageName);
        IComponent component = componentPage.getNestedComponent(targetIdPath);

        try
        {
            action = (IAction) component;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ActionService.component-wrong-type", component.getExtendedId()),
                component,
                null,
                ex);
        }

        // Only perform the stateful check if the application was stateful
        // when the URL was rendered.

        if (stateful.equals(STATEFUL_ON) && action.getRequiresSession())
        {
            HttpSession session = cycle.getRequestContext().getSession();

            if (session == null || session.isNew())
                throw new StaleSessionException();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IAction

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.