Package org.apache.tapestry

Examples of org.apache.tapestry.Asset


        replay();

        ClasspathAssetFactory factory = new ClasspathAssetFactory(cache, aliasManager);

        Asset asset = factory.createAsset(r);

        assertEquals(asset.toClientURL(), expectedClientURL);

        // Now, to check the cache:

        assertEquals(asset.toClientURL(), expectedClientURL);

        verify();

        // Now, to test cache clearing:
        train_requiresDigest(cache, r, false);

        train_toClientURL(aliasManager, "foo/Bar.txt", expectedClientURL);

        replay();

        factory.objectWasInvalidated();

        assertEquals(asset.toClientURL(), expectedClientURL);

        verify();
    }
View Full Code Here


        replay();

        AssetFactory factory = new ClasspathAssetFactory(cache, aliasManager);

        Asset asset = factory.createAsset(r);

        assertSame(asset.getResource(), r);
        assertEquals(asset.toClientURL(), expectedClientURL);
        assertEquals(asset.toString(), asset.toClientURL());

        verify();
    }
View Full Code Here

        replay();

        AssetFactory factory = new ClasspathAssetFactory(cache, aliasManager);

        Asset asset = factory.createAsset(r);

        assertSame(asset.getResource(), r);
        assertEquals(asset.toClientURL(), expectedClientURL);
        assertEquals(asset.toString(), asset.toClientURL());

        verify();
    }
View Full Code Here

    {
        // TODO: Assets will eventually have a kind of symbolic link used
        // to shorten the path. Some assets may need to have a checksum embedded
        // in the path as well.

        return new Asset()
        {
            public Resource getResource()
            {
                return resource;
            }
View Full Code Here

        if (path == null) return null;

        String expanded = _symbolSource.expandSymbols(path.value());

        Asset asset = _source.findAsset(null, expanded, null);

        return _typeCoercer.coerce(asset, objectType);
    }
View Full Code Here

    public Binding newBinding(String description, ComponentResources container,
            ComponentResources component, String expression, Location location)
    {
        Resource baseResource = container.getBaseResource();

        Asset asset = _source.findAsset(baseResource, expression, container.getLocale());

        return new LiteralBinding(description, asset, location);

    }
View Full Code Here

    private void addScriptLinkFromClasspath(String path)
    {
        String expanded = _symbolSource.expandSymbols(path);

        Asset asset = _assetSource.findAsset(null, expanded, null);

        _builder.addScriptLink(asset.toClientURL());
    }
View Full Code Here

        return getAssetForResource(localized);
    }

    private Asset getAssetForResource(Resource resource)
    {
        Asset result = _cache.get(resource);

        if (result == null)
        {
            result = createAssetFromResource(resource);
            _cache.put(resource, result);
View Full Code Here

    public Asset createAsset(final Resource resource)
    {
        final String contextPath = _request.getContextPath() + "/" + resource.getPath();

        return new Asset()
        {
            public Resource getResource()
            {
                return resource;
            }
View Full Code Here

        {
            String expanded = _symbolSource.expandSymbols(path);

            Resource resource = _assetFactory.getRootResource().forFile(expanded);

            Asset asset = _assetFactory.createAsset(resource);

            _builder.addScriptLink(asset.toClientURL());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.Asset

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.