Package org.apache.tapestry.engine

Examples of org.apache.tapestry.engine.IEngineService


    /** @since 3.0 **/

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

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

        String id = token.getId();
        IComponent embedded = component.getComponent(id);
        context[0] = embedded.getIdPath();

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

        ILink link = service.getLink(getPage().getRequestCycle(), this, context);

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

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


        IScript script = source.getScript(scriptLocation);

        Map symbols = new HashMap();

        IEngineService service = engine.getService(Tapestry.DIRECT_SERVICE);
        ILink link = service.getLink(cycle, this, null);

        symbols.put("URL", link.getURL());

        Body body = Body.get(cycle);
View Full Code Here

*/
public class TestEngineServiceOuterProxy extends HiveMindTestCase
{
    public void testToString()
    {
        IEngineService s = new EngineServiceOuterProxy("fred");

        assertEquals("<OuterProxy for engine service 'fred'>", s.toString());
    }
View Full Code Here

    {
        IRequestCycle cycle = newCycle();
        ILink link = (ILink) newMock(ILink.class);

        MockControl control = newControl(IEngineService.class);
        IEngineService delegate = (IEngineService) control.getMock();

        Object parameter = new Object();

        delegate.getLink(cycle, false, parameter);
        control.setReturnValue(link);

        replayControls();

        EngineServiceOuterProxy proxy = new EngineServiceOuterProxy("xxx");
View Full Code Here

    }

    public void testService() throws Exception
    {
        IRequestCycle cycle = newCycle();
        IEngineService delegate = (IEngineService) newMock(IEngineService.class);

        delegate.service(cycle);

        replayControls();

        EngineServiceOuterProxy proxy = new EngineServiceOuterProxy("xxx");
        proxy.installDelegate(delegate);
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(cycle, false, 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, false, getTargetPage());

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

        renderInformalParameters(writer, cycle);
View Full Code Here

        return result;
    }

    public synchronized IEngineService getService(String name)
    {
        IEngineService result = (IEngineService) _proxies.get(name);

        if (result == null)
        {
            result = buildProxy(name);
            _proxies.put(name, result);
View Full Code Here

        EngineServiceContribution contribution = (EngineServiceContribution) _services.get(name);

        if (contribution == null)
            throw new ApplicationRuntimeException(ImplMessages.noSuchService(name));

        IEngineService service = contribution.getService();
        String serviceName = service.getName();

        if (!serviceName.equals(name))
            throw new ApplicationRuntimeException(ImplMessages.serviceNameMismatch(
                    service,
                    name,
View Full Code Here

     * @deprecated To be removed in 4.1; links may now have the necessary engine service injected.
     */

    protected ILink getLink(IRequestCycle cycle, String serviceName, Object parameter)
    {
        IEngineService service = cycle.getEngine().getService(serviceName);

        return service.getLink(cycle, false, parameter);
    }
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.