Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330868 - [Webapp] Wrong doc path when a page is referenced twice
Summary: [Webapp] Wrong doc path when a page is referenced twice
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.8 M2   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-22 17:56 EST by Samuel Wu CLA
Modified: 2011-09-06 12:35 EDT (History)
1 user (show)

See Also:


Attachments
Screen capture of the problem (38.01 KB, image/jpeg)
2010-11-22 17:57 EST, Samuel Wu CLA
no flags Details
Patch version 1 (15.97 KB, patch)
2011-08-30 18:27 EDT, Chris Goldthorpe CLA
no flags Details | Diff
Patch for tests (3.69 KB, patch)
2011-08-31 14:43 EDT, Chris Goldthorpe CLA
no flags Details | Diff
Patch as committed (23.02 KB, patch)
2011-09-06 12:34 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 Samuel Wu CLA 2010-11-22 17:56:13 EST
Build Identifier: Eclipse 3.6.1

The doc path on top of the page is wrong when a page is referenced in two toc files.

Reproducible: Always

Steps to Reproduce:
1. Pick up Eclipse SDK 3.6.1
2. Create a non-java plugin project using the template Plug-in with sample help
content
3. Click next button to open the Sample Help Table of Contents page
4. Check the check box Primary
5. Click finish to create the project
6. Open the toc file tocconcepts.xml and add the following lines to it
	<topic label="Main Topic 3">
		<topic label="Sub Topic 3" href="html/tasks/subtopic2.html" /> 
	</topic> 
7. Launch a runtime and open the help page
8. Open the book Sample Table of Contents and expand the toc Concepts > Main Topic 3
9. Select page item Sub Topic 3
10. The Doc path on top of the page shows Sample Table of Contents > Tasks > Main Topic 2
which is wrong. It should be under Concepts.
Comment 1 Samuel Wu CLA 2010-11-22 17:57:30 EST
Created attachment 183622 [details]
Screen capture of the problem
Comment 2 Samuel Wu CLA 2011-01-10 16:40:00 EST
Any update on this one?
Comment 3 Chris Goldthorpe CLA 2011-01-11 13:11:48 EST
This is not so easy to fix - it would require putting more information in the TOC which would have a small performance impact for all users. What is the circumstance which causes a document to be in more than one TOC - can you work around the problem by making one of the references be a link from a page rather than a link in the TOC file?
Comment 4 Samuel Wu CLA 2011-01-12 11:08:30 EST
There are a couple of editors and language parsers in our product. The help contains a category for editors and another one for parsers. A help page on customizing a parser for a specific editor is shared under both categories. We can create a page which lists all the customization choices, but we do prefer that these topics are listed as the toc items since it's consistent to the rest part of the help.
Comment 5 Chris Goldthorpe CLA 2011-08-30 18:27:49 EDT
Created attachment 202463 [details]
Patch version 1

Here is the initial version of the patch. Note that this causes 3 Junit tests in TocFragmentServiceTest to fail because they are checking the result of calling the TocFragmentServlet and that result has now changed.
Comment 6 Chris Goldthorpe CLA 2011-08-31 14:43:37 EDT
Created attachment 202557 [details]
Patch for tests

The tests were failing because the test was checking for the values of hrefs in topics. Those hrefs now have an addition parameter representing the position of the element in the toc tree.
Comment 7 Chris Goldthorpe CLA 2011-09-01 14:17:39 EDT
Targeting 3.8M2
Comment 8 Chris Goldthorpe CLA 2011-09-06 12:34:44 EDT
Created attachment 202826 [details]
Patch as committed

This patch has been committed to master.
Comment 9 Chris Goldthorpe CLA 2011-09-06 12:35:52 EDT
This is now fixed.