Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.IEngineService


        verify();
    }

    public void test_Create_Directory_Asset()
    {
        IEngineService assetService = newService();
        Location l = newLocation();
       
        replay();
       
        ClasspathAssetFactory factory = new ClasspathAssetFactory();
View Full Code Here


        verify();
    }
   
    public void test_Create_Relative_Directory_Asset()
    {
        IEngineService assetService = newService();
        Resource shell = new ClasspathResource(getClassResolver(),
            "/org/apache/tapestry/html/Shell.jwc");
        Location l = new LocationImpl(shell);
        IComponentSpecification spec = newSpec();
       
View Full Code Here

        verify();
    }
   
    public void test_Create_Relative_Directory_Missing_Asset()
    {
        IEngineService assetService = newService();
        Resource shell = new ClasspathResource(getClassResolver(),
            "/org/apache/tapestry/html/Shell.jwc");
        Location l = new LocationImpl(shell);
        IComponentSpecification spec = newSpec();
       
View Full Code Here

    /**
     * Tests relative sub-directory paths.
     */
    public void test_Relative_Directory_Path()
    {
        IEngineService assetService = newService();
        Location l = newLocation();
       
        replay();
       
        ClasspathAssetFactory factory = new ClasspathAssetFactory();
View Full Code Here

            return;

        // Here comes the tricky part ... have to assemble a complete URL
        // for the current page.

        IEngineService pageService = getPageService();
        String pageName = getPage().getPageName();

        ILink link = pageService.getLink(false, pageName);

        StringBuffer buffer = new StringBuffer();
        buffer.append(refresh);
        buffer.append("; URL=");
        buffer.append(StringUtils.replace(link.getAbsoluteURL(), "&", "&"));
View Full Code Here

       
        IScript script = newMock(IScript.class);
        IForm form = newForm();
        IBinding binding = newMock(IBinding.class);
       
        IEngineService engine = newEngineService();
        ILink link = newMock(ILink.class);
       
        Submit submit = newInstance(Submit.class,
                                    "submitType", "cancel",
                                    "submitScript", script, "form", form,
                                    "async", true, "updateComponents", updates,
                                    "directService", engine);
       
        submit.setBinding("onClick", binding);
       
        IRequestCycle cycle = newCycle();
        IMarkupWriter writer = newWriter();
       
        expect(engine.getLink(eq(true), isA(DirectServiceParameter.class))).andReturn(link);
        expect(link.getURL()).andReturn("/test/url");
       
        PageRenderSupport prs = newPageRenderSupport();
        trainGetPageRenderSupport(cycle, prs);
       
View Full Code Here

            return;

        // Here comes the tricky part ... have to assemble a complete URL
        // for the current page.

        IEngineService pageService = cycle.getEngine().getService(Tapestry.PAGE_SERVICE);
        String pageName = getPage().getPageName();

        ILink link = pageService.getLink(cycle, null, new String[] { pageName });

        StringBuffer buffer = new StringBuffer();
        buffer.append(refresh);
        buffer.append("; URL=");
        buffer.append(link.getAbsoluteURL());
View Full Code Here

    {
        if (cycle.isRewinding())
            return;

        IEngine engine = cycle.getEngine();
        IEngineService pageService = engine.getService(Tapestry.PAGE_SERVICE);
        ILink link = pageService.getLink(cycle, this, new String[] { getTargetPage() });

        writer.beginEmpty("frame");
        writer.attribute("src", link.getURL());

        renderInformalParameters(writer, cycle);
View Full Code Here

        // Otherwise, the service is responsible for dynamically retrieving the
        // resource.

        String[] parameters = new String[] { path };

        IEngineService service = cycle.getEngine().getService(Tapestry.ASSET_SERVICE);

        ILink link = service.getLink(cycle, null, parameters);

        return link.getURL();
    }
View Full Code Here

    /** @since 3.0 * */

    private void write(IMarkupWriter writer, boolean nextIsClose, OpenToken token)
    {
        IComponent component = getInspectedComponent();
        IEngineService service = getPage().getEngine().getService(Tapestry.DIRECT_SERVICE);

        // Each id references a component embedded in the inspected component.
        // Get that component.

        String id = token.getId();
        IComponent embedded = component.getComponent(id);
        Object[] serviceParameters = new Object[]
        { embedded.getIdPath() };

        // Build a URL to select that component, as if by the captive
        // component itself (it's a Direct).

        DirectServiceParameter dsp = new DirectServiceParameter(this, serviceParameters);
        ILink link = service.getLink(getPage().getRequestCycle(), false, dsp);

        writer.begin("span");
        writer.attribute("class", "jwc-tag");

        writer.print("<");
View Full Code Here

TOP

Related Classes of org.apache.tapestry.engine.IEngineService

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.