Package org.apache.tapestry

Examples of org.apache.tapestry.IResourceLocation


            throw new ApplicationRuntimeException(
                Tapestry.format("DefaultTemplateSource.unable-to-read-template", asset),
                ex);
        }

        IResourceLocation resourceLocation = asset.getResourceLocation();

        return constructTemplateInstance(cycle, templateData, resourceLocation, component);
    }
View Full Code Here


                "Searching for localized version of template for "
                    + location
                    + " in locale "
                    + locale.getDisplayName());

        IResourceLocation baseTemplateLocation = location.getRelativeLocation(templateBaseName);

        IResourceLocation localizedTemplateLocation = baseTemplateLocation.getLocalization(locale);

        if (localizedTemplateLocation == null)
            return null;

        return getOrParseTemplate(cycle, localizedTemplateLocation, component);
View Full Code Here

    {
        if (component == null)
            throw new IllegalArgumentException(
                Tapestry.format("invalid-null-parameter", "component"));

        IResourceLocation specificationLocation =
            component.getSpecification().getSpecificationLocation();
        Locale locale = component.getPage().getLocale();

        // Check to see if already in the cache
View Full Code Here

            buffer.append(locale.toString());
        }

        buffer.append(SUFFIX);

        IResourceLocation localized = baseLocation.getRelativeLocation(buffer.toString());

        URL propertiesURL = localized.getResourceURL();

        if (propertiesURL == null)
            return parent;

        Properties result = null;
View Full Code Here

        if (_script == null)
        {
            IEngine engine = getPage().getEngine();
            IScriptSource source = engine.getScriptSource();

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

            _script = source.getScript(scriptLocation);
        }
View Full Code Here

        _resourcePath = resourcePath;
    }

    public void write(StringBuffer buffer, ScriptSession session)
    {
        IResourceLocation includeLocation = null;

        if (_resourcePath.startsWith("/"))
        {
            includeLocation =
                new ClasspathResourceLocation(
                    session.getRequestCycle().getEngine().getResourceResolver(),
                    _resourcePath);
        }
        else
        {
            IResourceLocation baseLocation = session.getScriptPath();
            includeLocation = baseLocation.getRelativeLocation(_resourcePath);
        }

        // TODO: Allow for scripts relative to context resources!

        session.getProcessor().addExternalScript(includeLocation);
View Full Code Here

    {
        if (component == null)
            throw new IllegalArgumentException(
                Tapestry.format("invalid-null-parameter", "component"));

        IResourceLocation specificationLocation =
            component.getSpecification().getSpecificationLocation();
        Locale locale = component.getPage().getLocale();

        // Check to see if already in the cache
View Full Code Here

            buffer.append(locale.toString());
        }

        buffer.append(SUFFIX);

        IResourceLocation localized = baseLocation.getRelativeLocation(buffer.toString());

        URL propertiesURL = localized.getResourceURL();

        if (propertiesURL == null)
            return parent;

        Properties result = null;
View Full Code Here

        {
            RequestContext requestContext = cycle.getRequestContext();
            ApplicationServlet servlet = requestContext.getServlet();
            ServletContext context = servlet.getServletContext();
            IPropertySource propertySource = cycle.getEngine().getPropertySource();
            IResourceLocation webInfLocation = new ContextResourceLocation(context, "/WEB-INF/");
            IResourceLocation webInfAppLocation = webInfLocation.getRelativeLocation(servlet.getServletName() + "/");
            readQuestions(easyQuestions, webInfAppLocation, propertySource.getPropertyValue("easyquestionsfile"));
            readQuestions(mediumQuestions, webInfAppLocation, propertySource.getPropertyValue("mediumquestiosfile"));
            readQuestions(hardQuestions, webInfAppLocation, propertySource.getPropertyValue("hardquestionsfile"));
            points = new int[10];
            names = new String[10];
View Full Code Here

        }
    }

    private void readQuestions(List questions, IResourceLocation location, String filename)
    {
        IResourceLocation result = location.getRelativeLocation(filename);
        URL url = result.getResourceURL();
        try
        {
            readQuestions(questions, url.getFile());
        }
        catch (IOException e)
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IResourceLocation

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.