Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338922 - [Webapp] Eclipse infocenter not using or saving a search scope
Summary: [Webapp] Eclipse infocenter not using or saving a search scope
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-04 07:40 EST by Tim Raff CLA
Modified: 2011-03-24 13:18 EDT (History)
1 user (show)

See Also:


Attachments
Patch version 1 (26.95 KB, patch)
2011-03-14 14:25 EDT, Chris Goldthorpe CLA
no flags Details | Diff
Patch version 2 (9.42 KB, patch)
2011-03-14 14:38 EDT, Chris Goldthorpe CLA
no flags Details | Diff
Patch version 3 (17.71 KB, patch)
2011-03-17 16:06 EDT, Chris Goldthorpe CLA
no flags Details | Diff
Patch to Jetty Help Server to enable testing of this fix (1.17 KB, patch)
2011-03-18 13:42 EDT, Chris Goldthorpe CLA
no flags Details | Diff
Test plug-in (8.31 KB, application/octet-stream)
2011-03-18 13:50 EDT, Chris Goldthorpe CLA
no flags Details
Patch to UA tests (948 bytes, patch)
2011-03-18 14:13 EDT, Chris Goldthorpe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Raff CLA 2011-03-04 07:40:29 EST
Build Identifier: 20100917-0705

You can use the search scope dialog to set a search scope in the infocenter. When you click OK to end the dialog the search bar shows the correct scope name. However the next search gives results from the whole information set, and when you click the scope link again, no scopes are shown in the pane.

This problem can be seen even on eclipse's own help.eclipse.org

I think this may have something to do with redirection, because if you set up an infocenter on a port, and access it with the full url with the port number i.e. http://example.com:8082/help/index.jsp the scope dialog works as expected. If you access a redirected url like http://help.eclipse.org/helios/index.jsp setting a scope fails as described.

Reproducible: Always

Steps to Reproduce:
1. In a browser, Navigate to http://help.eclipse.org
2. Click the "Scope" link in the search bar
3. click "New"
4. check  "Workbench User Guide" in the topics pane, and enter a list name of "testing"
5. click OK twice to close both dialogs
6. enter "customize" in the search box and click "go"
7. Examine the first search hit - it is from "Dali Java Persistence Tools User Guide", not from the "Workbench User Guide"
8. Click the scope link in the search bar - there are no search scopes listed, even though you've just created one.
Comment 1 Chris Goldthorpe CLA 2011-03-07 16:06:15 EST
I can reproduce the problem although I don't yet know why it is happening. Seems to work fine when the infocenter is on a local machine.
Comment 2 Chris Goldthorpe CLA 2011-03-08 19:43:01 EST
I think I know what is happening. The search scope is saved in a cookie which is written from the server. In Eclipse 3.6 ( Helios ) we started setting the path on the cookie so it could be read from the content servlet. It seems that the proxy is leaving the path on the cookie unchanged, so that a cookie is created with a path of /help but the context for help.eclipse.org is /helios, meaning that the client will not send the cookie back to the server. I'm guessing that the problem only occurs when the context paths on server and proxy are different.
Comment 3 Tim Raff CLA 2011-03-09 12:18:01 EST
I guessing, but looking at the cookies I have, those  that deal with the search scope are called:-
/help/wset_contents1 and /help/wset_criteria1
both of which in the failing case (with one scope called scope1) have the following contents:-
6<scope1

In the successful (local) case the contents are:-
wset_criteria1:- /help/13<scope1|scope1
wset-contents1:- /help/69<scope1|scope1&%2fcom.example.Enterprise%5f3%5f4%5f0.doc%2ftoc.xml
Comment 4 Tim Raff CLA 2011-03-11 04:24:48 EST
(In reply to comment #3)
> I guessing, but looking at the cookies I have, those  that deal with the search
> scope are called:-
> /help/wset_contents1 and /help/wset_criteria1
> both of which in the failing case (with one scope called scope1) have the
> following contents:-
> 6<scope1
> 
> In the successful (local) case the contents are:-
> wset_criteria1:- /help/13<scope1|scope1
> wset-contents1:-
> /help/69<scope1|scope1&%2fcom.example.Enterprise%5f3%5f4%5f0.doc%2ftoc.xml

Sorry, slightly messed up the contents in the successful case, should be :-

In the successful (local) case the contents are:-
/help/wset_criteria1:- 
 13<scope1|scope1
/help/wset-contents1:-
 69<scope1|scope1&%2fcom.example.Enterprise%5f3%5f4%5f0.doc%2ftoc.xml
Comment 5 Chris Goldthorpe CLA 2011-03-14 14:25:38 EDT
Created attachment 191155 [details]
Patch version 1

Are you in a position to test out a patch? If so can you try this, it avoids the need to set the cookie path in most cases. If this works I will fix up the patch so that it always sets cookies without using a path.
Comment 6 Chris Goldthorpe CLA 2011-03-14 14:38:14 EDT
Created attachment 191157 [details]
Patch version 2

I had attached an old version of the patch, this is the version that should fix the problem.
Comment 7 Tim Raff CLA 2011-03-17 12:56:51 EDT
I afraid we're not in a position to test out a potential fix. The only infocenter we run in the failing environment is the production server for our customer documentation, which I don't think we can apply source patches to.
Comment 8 Chris Goldthorpe CLA 2011-03-17 16:06:56 EDT
Created attachment 191465 [details]
Patch version 3
Comment 9 Chris Goldthorpe CLA 2011-03-17 19:30:06 EDT
I was able to test Patch version 3, I ended up using the class org.mortbay.servlet.ProxyServlet to create a servlet which acted as a proxy and separately started an infocenter using the context "/hlp" instead of "/help". Without the patch the scope is not saved because teh cookie path is incorrect, with the patch the scope is saved and everything works as expected.
Comment 10 Chris Goldthorpe CLA 2011-03-18 13:42:07 EDT
Created attachment 191530 [details]
Patch to Jetty Help Server to enable testing of this fix
Comment 11 Chris Goldthorpe CLA 2011-03-18 13:50:12 EDT
Created attachment 191531 [details]
Test plug-in

Test project which creates a proxy server to read help. 

Instructions for use:
1. Start an infocenter on port 8081
2. Launch A runtime workbench containing this plugin
3. Window/Show view/Help Proxy View

Help is opened through a proxy.
Comment 12 Chris Goldthorpe CLA 2011-03-18 13:51:14 EDT
Patch version 3 and Patch to Jetty Help Server to enable testing of this fix have been committed to HEAD. Fixed
Comment 13 Chris Goldthorpe CLA 2011-03-18 14:13:11 EDT
Created attachment 191537 [details]
Patch to UA tests

This patch to the UA tests has also been committed to HEAD
Comment 14 Tim Raff CLA 2011-03-24 10:18:53 EDT
Excellent work Chris, thanks for the prompt fix. Presumably now that it's in HEAD, the fix will be available in the next maintenance release of eclipse?
(In reply to comment #13)
> Created attachment 191537 [details]
> Patch to UA tests
> 
> This patch to the UA tests has also been committed to HEAD
Comment 15 Chris Goldthorpe CLA 2011-03-24 13:18:24 EDT
The fix will first show up in Eclipse 3.7. There are no more maintenance releases planned for Eclipse 3.6