Package org.apache.tapestry

Examples of org.apache.tapestry.IEngine


    }

    public void testLoggedOut()
    {
        IRequestCycle cycle = newCycle();
        IEngine engine = newEngine();
        IErrorProperty page = newPage();

        trainGetEngine(cycle, engine);

        trainGetVisit(engine, null);
View Full Code Here


    public void testLoggedIn()
    {

        IRequestCycle cycle = newCycle();
        IEngine engine = newEngine();
        IErrorProperty page = newPage();
        Visit visit = (Visit) newMock(Visit.class);

        trainGetEngine(cycle, engine);
View Full Code Here

*/
public class ErrorPresenterImpl implements ErrorPresenter
{
    public void presentError(String message, IRequestCycle cycle)
    {
        IEngine engine = cycle.getEngine();

        String pageName = "Home";
        // Get, but don't create, the visit.
        Visit visit = (Visit) engine.getVisit();

        if (visit != null && visit.isUserLoggedIn())
            pageName = "MyLibrary";

        IErrorProperty page = (IErrorProperty) cycle.getPage(pageName);
View Full Code Here

        IComponent component,
        Locale locale)
    {
        if (_delegate == null)
        {
            IEngine engine = cycle.getEngine();
            IApplicationSpecification spec = engine.getSpecification();

            if (spec.checkExtension(Tapestry.TEMPLATE_SOURCE_DELEGATE_EXTENSION_NAME))
                _delegate =
                    (ITemplateSourceDelegate) spec.getExtension(
                        Tapestry.TEMPLATE_SOURCE_DELEGATE_EXTENSION_NAME,
View Full Code Here

        if (isDirect())
            serviceName = Tapestry.DIRECT_SERVICE;
        else
            serviceName = Tapestry.ACTION_SERVICE;

        IEngine engine = cycle.getEngine();
        IEngineService service = engine.getService(serviceName);

        // A single service parameter is used to store the actionId.

        return service.getLink(cycle, this, new String[] { actionId });
    }
View Full Code Here

        String scriptPath,
        IRequestCycle cycle,
        IFormComponent field,
        Map symbols)
    {
        IEngine engine = field.getPage().getEngine();
        IScriptSource source = engine.getScriptSource();
        IForm form = field.getForm();

        Map finalSymbols = (symbols == null) ? new HashMap() : symbols;

        finalSymbols.put(FIELD_SYMBOL, field);
        finalSymbols.put(FORM_SYMBOL, form);
        finalSymbols.put(VALIDATOR_SYMBOL, this);

        IResourceLocation location =
            new ClasspathResourceLocation(engine.getResourceResolver(), scriptPath);

        IScript script = source.getScript(location);

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

    {
        Inspector inspector = (Inspector) getPage();

        _inspectedPage = inspector.getInspectedPage();

        IEngine engine = getPage().getEngine();
        IPageRecorder recorder =
            engine.getPageRecorder(_inspectedPage.getPageName(), inspector.getRequestCycle());

        // No page recorder?  No properties.

        if (recorder == null)
        {
View Full Code Here

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        if (_disabled || cycle.isRewinding())
            return;

        IEngine engine = getPage().getEngine();
        IScriptSource source = engine.getScriptSource();

        IResourceLocation scriptLocation =
            getSpecification().getSpecificationLocation().getRelativeLocation(
                "InspectorButton.script");

        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

    private Set _beanNames;

    public BeanProvider(IComponent component)
    {
        this._component = component;
        IEngine engine = component.getPage().getEngine();
        _resolver = engine.getResourceResolver();

        if (LOG.isDebugEnabled())
            LOG.debug("Created BeanProvider for " + component);

    }
View Full Code Here

            return externalURL;

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

        IEngine engine = cycle.getEngine();
       
        URL resourceURL = engine.getResourceResolver().getResource(path);
        String checksum = engine.getResourceChecksumSource().getChecksum(resourceURL);
       
        String[] parameters = new String[] { path, checksum };

        AssetService service = (AssetService) engine.getService(Tapestry.ASSET_SERVICE);
        ILink link = service.getLink(cycle, null, parameters);

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

TOP

Related Classes of org.apache.tapestry.IEngine

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.