Package org.apache.tapestry.parse

Examples of org.apache.tapestry.parse.ComponentTemplate


        trainParser(delegate);
        Locale locale = null;
        IRequestCycle cycle = createMock(IRequestCycle.class);

        replay(component, compSpec);
        ComponentTemplate bad = delegate.findTemplate(cycle, component, locale);
        assertEqualsExcludingWhitespace(new String(bad.getTemplateData()),
                "<div>[Flow " + type + " has no activites]</div>");
    }
View Full Code Here


        programFlowBorder(csr, cycle);

        replay(component, csr, compSpec);
        Locale locale = null;
        ComponentTemplate good = delegate.findTemplate(cycle, component, locale);
        assertEqualsExcludingWhitespace(new String(good.getTemplateData()),
                TEMPLATE_PREFIX +
                "<div jwcid=\"fc0@Block\"><div jwcid=\"fic0@comp#0\" " +
                //ATTACH_OGNL+" " +
                "categorySelection=\"fprop:categorySelection\" " +
                "fooMessage=\"fprop:fooMessage=fic0@message:foo-message\"literalFling=\"fprop:literalFling=fic0@literal:fling\"" +
View Full Code Here

        programFlowBorder(csr, cycle);

        replay(component, csr, compSpec, cycle);
        Locale locale = null;
        ComponentTemplate good = delegate.findTemplate(cycle, component, locale);
        assertEqualsExcludingWhitespace(new String(good.getTemplateData()),
                TEMPLATE_PREFIX +
                "<div jwcid=\"fc0@Block\"><div jwcid=\"fic0@comp#0\"  "+
                //"componentGlobaldef1=\"fprop:globaldef1\"  " +
                //"componentOverlapParameter=\"fprop:overlap\" " +
                //ATTACH_OGNL + " " +
View Full Code Here

        try {
            tokens = parser.parse(templateData, delegate, resource);
        } catch (TemplateParseException ex) {
            throw new ApplicationRuntimeException("unableToParseTemplate " + resource, ex);
        }
        return new ComponentTemplate(templateData, tokens);
    }
View Full Code Here

        Locale locale = component.getPage().getLocale();

        Object key = new MultiKey(new Object[] { specificationLocation, locale }, false);

        ComponentTemplate result = searchCache(key);
        if (result != null)
            return result;

        result = findTemplate(cycle, specificationLocation, component, locale);
View Full Code Here

        String name = location.getName();
        int dotx = name.lastIndexOf('.');
        String templateBaseName = name.substring(0, dotx + 1) + getTemplateExtension(component);

        ComponentTemplate result =
            findStandardTemplate(cycle, location, component, templateBaseName, locale);

        if (result == null
            && component.getSpecification().isPageSpecification()
            && component.getNamespace().isApplicationNamespace())
View Full Code Here

        IRequestCycle cycle,
        IResourceLocation location,
        IComponent component)
    {

        ComponentTemplate result = (ComponentTemplate) _templates.get(location);
        if (result != null)
            return result;

        // Ok, see if it exists.
View Full Code Here

        if (LOG.isDebugEnabled())
            LOG.debug("Parsed " + tokens.length + " tokens from template");

        _tokenCount += tokens.length;

        return new ComponentTemplate(templateData, tokens);
    }
View Full Code Here

                    first = false;
                }

                Map.Entry e = (Map.Entry) i.next();
                Object key = e.getKey();
                ComponentTemplate template = (ComponentTemplate) e.getValue();

                writer.begin("li");
                writer.print(key.toString());
                writer.print(" (");
                writer.print(template.getTokenCount());
                writer.print(" tokens)");
                writer.println();
                writer.end();
            }
View Full Code Here

        Locale locale = component.getPage().getLocale();

        Object key = new MultiKey(new Object[] { specificationLocation, locale }, false);

        ComponentTemplate result = searchCache(key);
        if (result != null)
            return result;

        result = findTemplate(cycle, specificationLocation, component, locale);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.parse.ComponentTemplate

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.