tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Köberl (JIRA) <j...@apache.org>
Subject [jira] Updated: (TAP5-713) Change template parser to not use STAX, as it is not (yet) compatible with Google App Engine
Date Thu, 06 Aug 2009 11:38:15 GMT

     [ https://issues.apache.org/jira/browse/TAP5-713?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Christian Köberl updated TAP5-713:
----------------------------------

    Attachment: SaxTemplateParserImpl.java

Here is my final version - everthing seems to work (except see below).

To use it in your 5.1 version you'll have to:

1. Remove Woodstox Depdency:
			<dependency>
				<groupId>org.apache.tapestry</groupId>
				<artifactId>tapestry-core</artifactId>
				<version>${tapestry-version}</version>
				<exclusions>
					<exclusion>
					  <groupId>org.codehaus.woodstox</groupId>
					  <artifactId>woodstox-core-asl</artifactId>
			        </exclusion>
				</exclusions>
			</dependency>

2. Add this to your AppModule:

	public static void bind(ServiceBinder binder)
	{
		binder.bind(TemplateParser.class, SaxTemplateParserImpl.class).withId("TemplateParserOverride");
	}

    public static void contributeTemplateParserOverride(MappedConfiguration<String, URL>
config)
    {
        // Any class inside the internal module would do. Or we could move all these
        // files to o.a.t.services.

        Class<UpdateListenerHubImpl> c = UpdateListenerHubImpl.class;

        config.add("-//W3C//DTD XHTML 1.0 Strict//EN", c.getResource("xhtml1-strict.dtd"));
        config.add("-//W3C//DTD XHTML 1.0 Transitional//EN", c
                .getResource("xhtml1-transitional.dtd"));
        config.add("-//W3C//DTD XHTML 1.0 Frameset//EN", c.getResource("xhtml1-frameset.dtd"));
        config.add("-//W3C//DTD HTML 4.01//EN", c.getResource("xhtml1-strict.dtd"));
        config.add("-//W3C//DTD HTML 4.01 Transitional//EN", c
                .getResource("xhtml1-transitional.dtd"));
        config.add("-//W3C//DTD HTML 4.01 Frameset//EN", c.getResource("xhtml1-frameset.dtd"));
        config.add("-//W3C//ENTITIES Latin 1 for XHTML//EN", c.getResource("xhtml-lat1.ent"));
        config.add("-//W3C//ENTITIES Symbols for XHTML//EN", c.getResource("xhtml-symbol.ent"));
        config.add("-//W3C//ENTITIES Special for XHTML//EN", c.getResource("xhtml-special.ent"));
    }

	public static void contributeServiceOverride(MappedConfiguration<Class, Object> configuration,
		@Local TemplateParser override)
	{
		configuration.add(TemplateParser.class, override);
	}

Voila - you have a non-Stax Tapestry.

I still get the 2 errors in the TemplateParserImplTest when running the whole suite from command
line. When I run just single test from Eclipse (for debugging) it works fine:
- parse_failure(org.apache.tapestry5.internal.services.TemplateParserImplTest) Time elapsed:
0 sec <<< FAILURE!
java.lang.AssertionError: expected:<2> but was:<4>
- just_HTML(org.apache.tapestry5.internal.services.TemplateParserImplTest) Time elapsed: 0
sec <<< FAILURE!
java.lang.AssertionError: expected:<6> but was:<8>
These problems are just line numbers that don't match - so I will not investigate any further.

> Change template parser to not use STAX, as it is not (yet) compatible with Google App
Engine
> --------------------------------------------------------------------------------------------
>
>                 Key: TAP5-713
>                 URL: https://issues.apache.org/jira/browse/TAP5-713
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Howard M. Lewis Ship
>         Attachments: SaxTemplateParserImpl.java, SaxTemplateParserImpl.java, SaxTemplateParserImpl.java,
SaxTemplateParserImpl.java
>
>
> The StAX APIs are not on the GAE "white list".
> Should be reasonable ot change the code, by using a SAX parser that parses the template
into a list of tokens, and then iterate down the token list as we do today using StAX.  End
result will be fewer dependencies to boot.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message