Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(34)

Issue 14117: Custom Tag support in Server-side templates

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 12 months ago by levik
Modified:
11 years, 2 months ago
Reviewers:
shindig-dev, awiner
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

Added HtmlCustomTag (from Templates spec) and NameCustomTag (from OSML spec) Test for CustomTagHandler mechanism and for HtmlCustomTag. Fragment parsing and caching in GadgetHtmlParser/NekoHtmlParser (Simplified Neko parser doesn't yet support fragment parsing)

Patch Set 1 #

Total comments: 21

Patch Set 2 : Refactored patch based on Adam's feedback #

Total comments: 7

Patch Set 3 : Refactored TemplateProcessor to be an interface. Other minor changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+989 lines, -386 lines) Patch
M java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultGuiceModule.java View 1 2 3 chunks +9 lines, -1 line 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/GadgetHtmlParser.java View 1 2 4 chunks +51 lines, -5 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/ParseModule.java View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/nekohtml/NekoHtmlParser.java View 1 2 4 chunks +19 lines, -6 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/nekohtml/NekoSimplifiedHtmlParser.java View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/AbstractTagHandler.java View 1 2 1 chunk +52 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/DefaultTemplateProcessor.java View 1 chunk +400 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/HtmlTagHandler.java View 1 2 1 chunk +67 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/NameTagHandler.java View 1 2 1 chunk +60 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/TagHandler.java View 2 1 chunk +44 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/TagRegistry.java View 2 1 chunk +83 lines, -0 lines 0 comments Download
A java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/TemplateModule.java View 2 1 chunk +55 lines, -0 lines 0 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/TemplateProcessor.java View 1 2 2 chunks +12 lines, -360 lines 0 comments Download
M java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/TemplateRewriterTest.java View 1 2 2 chunks +9 lines, -1 line 0 comments Download
A java/gadgets/src/test/java/org/apache/shindig/gadgets/templates/HtmlTagHandlerTest.java View 1 2 1 chunk +69 lines, -0 lines 0 comments Download
M java/gadgets/src/test/java/org/apache/shindig/gadgets/templates/TemplateProcessorTest.java View 1 2 5 chunks +49 lines, -12 lines 0 comments Download

Messages

Total messages: 2
awiner
http://codereview.appspot.com/14117/diff/1/9 File java/gadgets/src/main/java/org/apache/shindig/gadgets/DefaultGuiceModule.java (right): http://codereview.appspot.com/14117/diff/1/9#newcode139 Line 139: public static class TagRegistryProvider implements Provider<CustomTagRegistry> { if ...
16 years, 11 months ago (2009-02-24 00:38:43 UTC) #1
awiner
16 years, 11 months ago (2009-02-25 01:30:17 UTC) #2
http://codereview.appspot.com/14117/diff/4001/3016
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/AbstractTagHandler.java
(right):

http://codereview.appspot.com/14117/diff/4001/3016#newcode35
Line 35: public AbstractTagHandler(String namespaceUri, String tagName) {
don't think these need to be properties - just make
getTagName()/getNamespaceUri() abstract.  (Doesn't make much of a difference as
long as these are reused instances, but I find it a bit cleaner)

http://codereview.appspot.com/14117/diff/4001/3016#newcode48
Line 48: protected <T extends Object> T getValueFromTag(Element tag, String
name,
Just <T>: <T extends Object> is redundant.

http://codereview.appspot.com/14117/diff/4001/3011
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/Evaluator.java
(right):

http://codereview.appspot.com/14117/diff/4001/3011#newcode24
Line 24: public interface Evaluator {
for implementing tags that have contents, this interface will need to handle
more than just expression evaluation, so it'll soon need to have a different
name and some more methods (for re-entering the processor)

http://codereview.appspot.com/14117/diff/4001/3017
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/HtmlTagHandler.java
(right):

http://codereview.appspot.com/14117/diff/4001/3017#newcode55
Line 55: } catch (Exception e) {
should catch the exact exception types, not Exception (otherwise,
RuntimeExceptions get caught inappropriately)

http://codereview.appspot.com/14117/diff/4001/3017#newcode57
Line 57: "Error: " + e.getMessage()));
need to be very careful here - someone could include content
"<script>alert('foo')</script>" - and if that shows up in the exception message,
then that script will get executed.

http://codereview.appspot.com/14117/diff/4001/3012
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/TagRegistry.java
(right):

http://codereview.appspot.com/14117/diff/4001/3012#newcode78
Line 78: hash = (namespaceUri.hashCode() * 37) ^ localName.hashCode();
compute aggressively in the constructor (and store as an int, not an Integer)

http://codereview.appspot.com/14117/diff/4001/3010
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/templates/TemplateModule.java
(right):

http://codereview.appspot.com/14117/diff/4001/3010#newcode49
Line 49: handlers.add(nameHandler);
handlers = ImmutableSet.of(htmlHandler, nameHandler);
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b