Package org.apache.tapestry

Examples of org.apache.tapestry.IResourceLocation


        return link.getURL();
    }

    public InputStream getResourceAsStream(IRequestCycle cycle)
    {
        IResourceLocation location = getResourceLocation();

        try
        {
            URL url = location.getResourceURL();

            return url.openStream();
        }
        catch (Exception ex)
        {
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

    public void startDocument(String namespace, String name, Attributes attributes)
        throws Exception
    {
        SpecificationDigester digester = getDigester();
        IResourceLocation location = digester.getResourceLocation();

        String publicId = digester.getPublicId();

    // publicId will never be null because we use a validating parser.
View Full Code Here

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

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

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

        return link.getURL();
    }

    public InputStream getResourceAsStream(IRequestCycle cycle)
    {
        IResourceLocation location = getResourceLocation();

        try
        {
            URL url = location.getResourceURL();

            return url.openStream();
        }
        catch (Exception ex)
        {
View Full Code Here

        if (path == null)
            throw new ApplicationRuntimeException(
                Tapestry.format("Namespace.no-such-page", name, getNamespaceId()));

        IResourceLocation location = getSpecificationLocation().getRelativeLocation(path);

        return _specificationSource.getPageSpecification(location);
    }
View Full Code Here

        if (path == null)
            throw new ApplicationRuntimeException(
                Tapestry.format("Namespace.no-such-alias", type, getNamespaceId()));

        IResourceLocation location = getSpecificationLocation().getRelativeLocation(path);

        return _specificationSource.getComponentSpecification(location);
    }
View Full Code Here

        if (path == null)
            throw new ApplicationRuntimeException(
                Tapestry.format("Namespace.library-id-not-found", id, getNamespaceId()));

        IResourceLocation location = getSpecificationLocation().getRelativeLocation(path);

        // Ok, an absolute path to a library for an application whose specification
        // is in the context root is problematic, cause getRelativeLocation()
        // will still be looking in the context.  Handle this case with the
        // following little kludge:

        if (location.getResourceURL() == null && path.startsWith("/"))
            location = new ClasspathResourceLocation(_specification.getResourceResolver(), path);

        ILibrarySpecification ls = _specificationSource.getLibrarySpecification(location);

        return new Namespace(id, this, ls, _specificationSource);
View Full Code Here

        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

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.