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

Issue 218057: Clean up/Refactor ContentRewriterFeature (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 11 months ago by johnfargo
Modified:
15 years, 11 months ago
Reviewers:
zhoresh, shindig.remailer
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

This CL removes ContentRewriterFeatureFactory and instead stuffs it into ContentRewriterFeature, whose data-containing class in turn is subdivided to ContentRewriterFeature.Config for differentiation. It (hopefully) cleans up the ContentRewriter configuration logic into a more direct inheritance model: * DefaultConfig provides "default" values as bound previously. * Config provides a constructor that uses a Spec's Feature values to override those found in DefaultConfig, as appropriate. * Includes/excludes also separated into a MatchBundle class to avoid repeated logic.

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+509 lines, -576 lines) Patch
java/common/conf/shindig.properties View 1 chunk +1 line, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/DefaultSanitizingProxyingLinkRewriterFactory.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/SanitizingGadgetRewriter.java View 3 chunks +3 lines, -4 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/SanitizingProxyingLinkRewriter.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/SanitizingProxyingLinkRewriterFactory.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/SanitizingRequestRewriter.java View 4 chunks +4 lines, -5 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ConcatLinkRewriter.java View 2 chunks +3 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ConcatLinkRewriterFactory.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeature.java View 2 chunks +307 lines, -285 lines 6 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeatureFactory.java View 1 chunk +0 lines, -120 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssRequestRewriter.java View 2 chunks +3 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/DefaultConcatLinkRewriterFactory.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/DefaultProxyingLinkRewriterFactory.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/HTMLContentRewriter.java View 8 chunks +9 lines, -9 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingLinkRewriter.java View 2 chunks +4 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingLinkRewriterFactory.java View 1 chunk +1 line, -1 line 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/render/SanitizingGadgetRewriterTest.java View 2 chunks +4 lines, -3 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/render/SanitizingRequestRewriterTest.java View 2 chunks +4 lines, -3 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/BaseRewriterTestCase.java View 4 chunks +14 lines, -12 lines 2 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeatureTestCase.java View 7 chunks +57 lines, -34 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeatureTestCaseOS9.java View 15 chunks +69 lines, -61 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/CssRequestRewriterTest.java View 1 chunk +4 lines, -4 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/HTMLContentRewriterTest.java View 2 chunks +4 lines, -4 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ProxyingLinkRewriterTest.java View 2 chunks +12 lines, -16 lines 0 comments Download

Messages

Total messages: 3
johnfargo
15 years, 11 months ago (2010-02-22 20:28:32 UTC) #1
zhoresh
LGTM, minor comments/questions below http://codereview.appspot.com/218057/diff/1/21 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeature.java (right): http://codereview.appspot.com/218057/diff/1/21#newcode174 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeature.java:174: this.includes = getMatchBundle(defaultInclude, The original ...
15 years, 11 months ago (2010-02-23 00:29:38 UTC) #2
johnfargo
15 years, 11 months ago (2010-02-23 19:48:59 UTC) #3
Already committed this - retrying send of responses and accommodations.

http://codereview.appspot.com/218057/diff/1/21
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeature.java
(right):

http://codereview.appspot.com/218057/diff/1/21#newcode174
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeature.java:174:
this.includes = getMatchBundle(defaultInclude,
Good observation. Added.

On 2010/02/23 00:29:38, zhoresh wrote:
> The original code "normalized" (trim spaces) the different paramaters, was
that
> removed intentionally?
>

http://codereview.appspot.com/218057/diff/1/21#newcode229
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeature.java:229:
// gadget spec if !onlyAllowExcludes.
Also good note. This no longer applies (comment was copied from previous impl).
I've removed the comment, since the gadget spec can override the excludes
whenever it wants. Makes me wonder if that's actually a bug -- the existing test
cases were sort of unclear on this. It seems intuitive and reasonable to me for
exclude overrides to be accepted when specified by the gadget spec in any case.

On 2010/02/23 00:29:38, zhoresh wrote:
> This comment should apply to include not exclude?

http://codereview.appspot.com/218057/diff/1/21#newcode370
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ContentRewriterFeature.java:370:
public boolean isSplitJsEnabled() {
Side-effect of this being a CL split from a gigantic one that includes a lot of
other changes.

I've added some basic test cases for this trivial value.

On 2010/02/23 00:29:38, zhoresh wrote:
> Why is it part of content rewriter now? 
> Also add simple test case for this

http://codereview.appspot.com/218057/diff/1/10
File
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/BaseRewriterTestCase.java
(right):

http://codereview.appspot.com/218057/diff/1/10#newcode62
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/BaseRewriterTestCase.java:62:
protected Set<String> tags;
Yes and no :)

No in this CL, yes in several others that will follow.

On 2010/02/23 00:29:38, zhoresh wrote:
> Is this tags still needed?
Sign in to reply to this message.

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