Package org.apache.tapestry

Examples of org.apache.tapestry.IRequestCycle


    public void testGetURLStatefulWithAnchor()
    {
        PortletURL url = newPortletURL();

        MockControl cyclec = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) cyclec.getMock();

        cycle.encodeURL(url.toString());
        cyclec.setReturnValue("/encoded-url");

        QueryParameterMap parameters = newParameters();

        replayControls();
View Full Code Here


    }

    private IRequestCycle newCycle(IPage page)
    {
        MockControl control = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) control.getMock();

        cycle.getPage();
        control.setReturnValue(page);

        return cycle;
    }
View Full Code Here

    }

    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 abstract class AdminPage extends Protected implements IMessageProperty
{

    public void pageValidate(PageEvent event)
    {
        IRequestCycle cycle = event.getRequestCycle();
        Visit visit = (Visit) getEngine().getVisit();

        if (visit == null || !visit.isUserLoggedIn())
        {
            Login login = (Login) cycle.getPage("Login");

            login.setCallback(new PageCallback(this));

            throw new PageRedirectException(login);
        }

        if (!visit.getUser(cycle).isAdmin())
        {
            VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();

            vengine.presentError("That function is restricted to adminstrators.", cycle);

            throw new PageRedirectException(cycle.getPage());
        }
    }
View Full Code Here

*/
public abstract class AbstractTableViewComponent extends BaseComponent
{
    public ITableModelSource getTableModelSource()
    {
        IRequestCycle objCycle = getPage().getRequestCycle();

        ITableModelSource objSource =
            (ITableModelSource) objCycle.getAttribute(
                ITableModelSource.TABLE_MODEL_SOURCE_ATTRIBUTE);

        if (objSource == null)
            throw new ApplicationRuntimeException(
                "The component "
View Full Code Here

*/
public abstract class AbstractTableRowComponent extends AbstractTableViewComponent
{
    public ITableRowSource getTableRowSource()
    {
        IRequestCycle objCycle = getPage().getRequestCycle();

        Object objSourceObj = objCycle.getAttribute(ITableRowSource.TABLE_ROW_SOURCE_ATTRIBUTE);
        ITableRowSource objSource = (ITableRowSource) objSourceObj;

        if (objSource == null)
            throw new ApplicationRuntimeException(
                "The component "
View Full Code Here

       
        decodeParameters(request.getActivationPath(), request.getPathInfo(), parameters);
       
        String serviceName = findService(parameters);
       
        IRequestCycle cycle = new RequestCycle(engine, parameters, serviceName, _environment);
       
        _requestGlobals.store(cycle);
       
        try {
            cycle.setResponseBuilder(_responseDelegateFactory.getResponseBuilder(cycle));
        } catch (IOException e) {
            throw new ApplicationRuntimeException("Error creating response builder.", e);
        }
       
        return cycle;
View Full Code Here

public class TestListenerMapSource extends HiveMindTestCase
{
    private IRequestCycle newCycle(Object[] listenerParameters)
    {
        MockControl control = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) control.getMock();

        cycle.getListenerParameters();
        control.setReturnValue(listenerParameters);

        return cycle;
    }
View Full Code Here

    }

    private IRequestCycle newCycle(IForm form)
    {
        MockControl control = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) control.getMock();

        cycle.isRewinding();
        control.setReturnValue(false);

        cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE);
        control.setReturnValue(form);

        return cycle;
    }
View Full Code Here

        return cycle;
    }

    public void testFoundWithParameters()
    {
        IRequestCycle cycle = newCycle(new Object[]
        { "Hello", new Integer(7) });
        ListenerMethodHolder holder = newHolder();

        holder.fred("Hello", 7);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IRequestCycle

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.