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

Issue 4430047: Enable shindig to run on non-ROOT context path

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years ago by Li Xu
Modified:
12 years, 11 months ago
Reviewers:
Paul Lindner, henry.saputra, mhermanto, mgmarum, woodstae, dev-remailer, Han Nguyen
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk
Visibility:
Public.

Description

Please see details in the jira: https://issues.apache.org/jira/browse/SHINDIG-1525

Patch Set 1 #

Patch Set 2 : update the patch with correct svn base and comments from Henry #

Total comments: 10

Patch Set 3 : set window__CONTEXT_ROOT default to ROOT #

Total comments: 1

Patch Set 4 : move "shindig.signing.global-callback-url" back to shindig.properties #

Patch Set 5 : change approach a little to create binding in PropertiesModule so test cases won't break #

Total comments: 1

Patch Set 6 : change jsp to html, also added support to samplecontainer.html #

Total comments: 10

Patch Set 7 : updated with comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -53 lines) Patch
config/container.js View 1 2 3 4 5 6 6 chunks +24 lines, -17 lines 0 comments Download
content/samplecontainer/examples/commoncontainer/assembler.js View 1 2 3 4 5 6 1 chunk +5 lines, -1 line 0 comments Download
content/samplecontainer/examples/commoncontainer/index.html View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
content/samplecontainer/examples/commoncontainer/viewController.js View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
content/samplecontainer/samplecontainer.html View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
content/samplecontainer/samplecontainer.js View 1 2 3 4 5 6 3 chunks +6 lines, -7 lines 0 comments Download
features/src/main/javascript/features/container/gadget_holder.js View 1 2 3 4 5 6 4 chunks +21 lines, -2 lines 0 comments Download
features/src/main/javascript/features/shindig.container/feature.xml View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
features/src/main/javascript/features/shindig.container/shindig-container.js View 1 2 3 4 5 6 4 chunks +23 lines, -6 lines 0 comments Download
features/src/main/javascript/features/shindig.uri/uri.js View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
java/common/conf/shindig.properties View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/common/PropertiesModule.java View 1 2 3 4 5 6 3 chunks +21 lines, -0 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/common/servlet/GuiceServletContextListener.java View 1 2 3 4 5 6 3 chunks +13 lines, -1 line 0 comments Download
java/common/src/main/java/org/apache/shindig/config/JsonContainerConfig.java View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
java/common/src/main/java/org/apache/shindig/config/JsonContainerConfigLoader.java View 1 2 3 4 5 6 5 chunks +10 lines, -5 lines 0 comments Download
java/common/src/test/java/org/apache/shindig/config/JsonContainerConfigLoaderTest.java View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
java/social-api/src/test/java/org/apache/shindig/social/SocialApiTestsGuiceModule.java View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 24
Li Xu
13 years ago (2011-04-15 19:49:20 UTC) #1
Li Xu
update the patch with correct svn base and comments from Henry
12 years, 11 months ago (2011-05-02 21:12:23 UTC) #2
Han Nguyen
Hi guys, If there's no other objections nor concerns, I'll commit this patch by the ...
12 years, 11 months ago (2011-05-05 14:48:34 UTC) #3
henry.saputra
http://codereview.appspot.com/4430047/diff/3001/config/container.js File config/container.js (right): http://codereview.appspot.com/4430047/diff/3001/config/container.js#newcode92 config/container.js:92: "shindig.signing.global-callback-url" : "http://${SERVER_HOST}:${SERVER_PORT}/${CONTEXT_ROOT}gadgets/oauthcallback", Not sure why you need to ...
12 years, 11 months ago (2011-05-05 15:32:30 UTC) #4
Li Xu
As it's part of servletContext, there's no need to manually set up system.properties?
12 years, 11 months ago (2011-05-05 17:47:25 UTC) #5
Li Xu
thanks for the review. please check the comments below. http://codereview.appspot.com/4430047/diff/3001/config/container.js File config/container.js (right): http://codereview.appspot.com/4430047/diff/3001/config/container.js#newcode92 config/container.js:92: ...
12 years, 11 months ago (2011-05-05 18:24:36 UTC) #6
henry.saputra
http://codereview.appspot.com/4430047/diff/3001/config/container.js File config/container.js (right): http://codereview.appspot.com/4430047/diff/3001/config/container.js#newcode92 config/container.js:92: "shindig.signing.global-callback-url" : "http://${SERVER_HOST}:${SERVER_PORT}/${CONTEXT_ROOT}gadgets/oauthcallback", I am not too familiar with ...
12 years, 11 months ago (2011-05-06 06:13:08 UTC) #7
Li Xu
http://codereview.appspot.com/4430047/diff/3001/config/container.js File config/container.js (right): http://codereview.appspot.com/4430047/diff/3001/config/container.js#newcode92 config/container.js:92: "shindig.signing.global-callback-url" : "http://${SERVER_HOST}:${SERVER_PORT}/${CONTEXT_ROOT}gadgets/oauthcallback", I did a search and only ...
12 years, 11 months ago (2011-05-06 17:56:43 UTC) #8
Li Xu
http://codereview.appspot.com/4430047/diff/3001/content/samplecontainer/examples/commoncontainer/index.jsp File content/samplecontainer/examples/commoncontainer/index.jsp (right): http://codereview.appspot.com/4430047/diff/3001/content/samplecontainer/examples/commoncontainer/index.jsp#newcode23 content/samplecontainer/examples/commoncontainer/index.jsp:23: window.__CONTEXT_ROOT = '<%=request.getContextPath()%>'; Sorry, I need to revise the ...
12 years, 11 months ago (2011-05-09 15:10:26 UTC) #9
Li Xu
set window__CONTEXT_ROOT default to ROOT
12 years, 11 months ago (2011-05-09 18:03:15 UTC) #10
henry.saputra
LGTM with proposed change to keep shindig.signing.global-callback-url in shindig.properties file. - Henry http://codereview.appspot.com/4430047/diff/22001/config/container.js File config/container.js ...
12 years, 11 months ago (2011-05-10 06:56:39 UTC) #11
Li Xu
move "shindig.signing.global-callback-url" back to shindig.properties
12 years, 11 months ago (2011-05-11 02:49:56 UTC) #12
Li Xu
change approach a little to create binding in PropertiesModule so test cases won't break
12 years, 11 months ago (2011-05-11 16:02:29 UTC) #13
Li Xu
Henry, would you please review the latest change? thanks.
12 years, 11 months ago (2011-05-12 13:42:21 UTC) #14
henry.saputra
Some comments about keeping with html than jsp. - Henry http://codereview.appspot.com/4430047/diff/32001/content/samplecontainer/examples/commoncontainer/index.jsp File content/samplecontainer/examples/commoncontainer/index.jsp (right): http://codereview.appspot.com/4430047/diff/32001/content/samplecontainer/examples/commoncontainer/index.jsp#newcode23 ...
12 years, 11 months ago (2011-05-12 23:25:27 UTC) #15
Li Xu
I agree container and gadget apis could have different context. However jsp would be the ...
12 years, 11 months ago (2011-05-13 14:49:05 UTC) #16
henry.saputra
One suggestion is to keep sample index.html and modify the conf/container.js core.io section to: // ...
12 years, 11 months ago (2011-05-13 23:46:26 UTC) #17
henry.saputra
Forgot to copy the ${CONTEXT_ROOT}: "gadgets.features" : { "core.io" : { ... "proxyUrl" : "//%host%${CONTEXT_ROOT}/gadgets/proxycontainer=%container%%rewriteMime%&refresh=%refresh%&url=%url%%rewriteMime%&gadget=%gadget%%rawurl%", ...
12 years, 11 months ago (2011-05-14 19:33:16 UTC) #18
Li Xu
Thanks. I investigated a little here today. You're right, gadget.config.init() in init.js is not necessary. ...
12 years, 11 months ago (2011-05-16 21:35:23 UTC) #19
henry.saputra
I think example files should not be in jsp just because it shows that you ...
12 years, 11 months ago (2011-05-16 23:32:09 UTC) #20
Li Xu
change jsp to html, also added support to samplecontainer.html
12 years, 11 months ago (2011-05-17 20:16:31 UTC) #21
henry.saputra
Several more comments but LGTM in general. To make sure, we may want to remove ...
12 years, 11 months ago (2011-05-18 00:53:16 UTC) #22
Li Xu
updated with comments
12 years, 11 months ago (2011-05-19 14:56:17 UTC) #23
Li Xu
12 years, 11 months ago (2011-05-19 15:02:25 UTC) #24
Comments is addressed. 
Regarding the change in init.js and value for "proxyUrl", I prefer to do a
followup since all the current sample pages works.  Will post to the mailing
list for discussion first.

If there's no other objection, could anyone please help committing? Han is not
available now. thanks.

http://codereview.appspot.com/4430047/diff/36002/config/container.js
File config/container.js (right):

http://codereview.appspot.com/4430047/diff/36002/config/container.js#newcode147
config/container.js:147: "proxyUrl" :
"//%host%${CONTEXT_ROOT}/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%",
doesn't work, "proxyUrl" in current patch works. 
Might be a bug in common container. suggest to look at this seperately.

http://codereview.appspot.com/4430047/diff/36002/content/samplecontainer/exam...
File content/samplecontainer/examples/commoncontainer/index.html (right):

http://codereview.appspot.com/4430047/diff/36002/content/samplecontainer/exam...
content/samplecontainer/examples/commoncontainer/index.html:25: <script
src="../../../gadgets/js/container:rpc:pubsub-2.js?c=1&debug=1&container=default"></script>
had to change it so it could work out of box for any context root path.

http://codereview.appspot.com/4430047/diff/36002/features/src/main/javascript...
File features/src/main/javascript/features/shindig.uri/uri.js (right):

http://codereview.appspot.com/4430047/diff/36002/features/src/main/javascript...
features/src/main/javascript/features/shindig.uri/uri.js:230: setPath:
function(path) { if (path && path != null ) { path_ = (path[0] === '/' ? '' :
'/') + path; } return bundle; },
On 2011/05/18 00:53:16, henry.saputra wrote:
> I assume you want to check for undefined, may want to do it like:
> 
> if (typeof path !== 'undefined' && path != null)

Done.

http://codereview.appspot.com/4430047/diff/36002/java/common/src/main/java/or...
File java/common/src/main/java/org/apache/shindig/common/PropertiesModule.java
(right):

http://codereview.appspot.com/4430047/diff/36002/java/common/src/main/java/or...
java/common/src/main/java/org/apache/shindig/common/PropertiesModule.java:111:
String contextRoot = System.getProperty("shindig.contextroot", "");
On 2011/05/18 00:53:16, henry.saputra wrote:
> Can it just call getContextRoot() method?

Done.

http://codereview.appspot.com/4430047/diff/36002/java/common/src/main/java/or...
File
java/common/src/main/java/org/apache/shindig/common/servlet/GuiceServletContextListener.java
(right):

http://codereview.appspot.com/4430047/diff/36002/java/common/src/main/java/or...
java/common/src/main/java/org/apache/shindig/common/servlet/GuiceServletContextListener.java:57:
contextRoot = context.getContextPath();
Done, moved to setSystemProperties. But web.xml change is not required since it
can be detected.
Sign in to reply to this message.

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