Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 234878 - [Help] Breadcrumbs are incorrect for topics used by two or more TOCs and linked TOCs.
Summary: [Help] Breadcrumbs are incorrect for topics used by two or more TOCs and link...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: platform-ua-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 249002 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-30 12:03 EDT by Paul Slauenwhite CLA
Modified: 2019-11-14 03:10 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2008-05-30 12:03:13 EDT
Breadcrumbs are incorrect for pages used by two or more TOCs.

When a topic is reused (used by two or more TOCs), the breadcrumbs at the top of the page are incorrect.  

Steps to reproduce:

1) Download TPTP 4.5 RC2 all-in-one package
(http://www.eclipse.org/tptp/home/downloads/?buildId=TPTP-4.5.0RC2-200805271330).

2) Open the Help and select Testing applications >> Testing with JUnit >>
Editing JUnit tests >> JUnit Test Suite Editor.

3) Note the breadcrumb is Testing applications > Testing plug-ins with JUnit > Editing JUnit Plug-in tests > JUnit Plug-in Test Suite Editor.  This is the breadcrumb for Testing applications >> Testing plug-ins with JUnit >>
Editing JUnit Plug-in tests >> JUnit Plug-in Test Suite Editor >> JUnit Test Suite Editor.
Comment 1 Paul Slauenwhite CLA 2008-05-30 12:04:53 EDT
Several other examples:

a. Editing Junit tests
         all pages under this belongs to 'Testing plug-ins with JUnit'(that
because they are sharing the same resource) we can see the link tree at the top
of each page
b. Running a test
         belongs to 'Testing plug-ins with JUnit'
c. Analyzing test results
         all pages including this page belongs to 'Testing plug-ins with JUnit'
or 'Testing manually'
d. Generating test reports
         belongs to 'Testing plug-ins with JUnit' or 'Testing manually'
Comment 2 Paul Slauenwhite CLA 2008-05-30 12:38:51 EDT
Several other examples:

a. Testing manually: Analyzing test results/Generating test reports
         share the place as a root with 'Testing plug-ins with JUnit' sometimes

b. Test performance: Analyzing test results/Generating test reports
         belongs to 'Testing plug-ins with JUnit' or 'Testing manually

c. Test performance: Running a test
         belongs to 'Testing plug-ins with JUnit'  
Comment 3 Chris Goldthorpe CLA 2008-10-23 16:14:15 EDT
*** Bug 249002 has been marked as a duplicate of this bug. ***
Comment 4 Paul Slauenwhite CLA 2009-04-02 08:05:38 EDT
Is there any status on this defect?  This defect is required for the TPTP product documentation, and our consumers.
Comment 5 Chris Goldthorpe CLA 2009-04-02 19:38:50 EDT
I haven't done anything on this so far - it's not so easy to implement, here are some thoughts on it.

The breadcrumbs are based on the href being passed in the request header, and if the same href occurs in multiple places they will end up with the same breadcrumbs, which are based on checking each book (which has a Hashmap of the hrefs it contains) to see if the page is in that book.

One way to get different breadcrumbs for different instances of the same page would be to add parameters to the hrefs to disambiguate them but that seems like quite a lot of extra data to be adding to each href in the table of contents. 

The other possibility I can see is to use a two step process where the server looks through all the TOCs for an href and if it is found in more than one TOC the response contains javascript which will cause it to make an AJAX call to the server, identifying the selected node to get the real breadcrumb.

I'm not convinced that including the same page in more than one TOC is the best way to present information, usually when a second book wants to refer to a page in a first book a hyperlink is used, even if it requires creating a page which contains little more than a title and that hyperlink.
Comment 6 Paul Slauenwhite CLA 2009-04-08 09:22:48 EDT
(In reply to comment #5)
> I haven't done anything on this so far - it's not so easy to implement, here
> are some thoughts on it.
> 
> The breadcrumbs are based on the href being passed in the request header, and
> if the same href occurs in multiple places they will end up with the same
> breadcrumbs, which are based on checking each book (which has a Hashmap of the
> hrefs it contains) to see if the page is in that book.
> 
> One way to get different breadcrumbs for different instances of the same page
> would be to add parameters to the hrefs to disambiguate them but that seems
> like quite a lot of extra data to be adding to each href in the table of
> contents. 
> 
> The other possibility I can see is to use a two step process where the server
> looks through all the TOCs for an href and if it is found in more than one TOC
> the response contains javascript which will cause it to make an AJAX call to
> the server, identifying the selected node to get the real breadcrumb.
> 
> I'm not convinced that including the same page in more than one TOC is the best
> way to present information, usually when a second book wants to refer to a page
> in a first book a hyperlink is used, even if it requires creating a page which
> contains little more than a title and that hyperlink.

Thanks Chris for this update and explanation.

In our case, we have two or more TOCs that have common content that we do not want to duplicate or link to since it breaks the flow of the documetation.  Our common content is both referenced and linked (e.g. <link toc="toc/test_results_toc.xml"/>).

I would consider moving the referenced content to a separate/linked TOC except links TOCs have the wrong breadcrumbs as well. 
Comment 7 Missing name CLA 2009-04-08 15:44:09 EDT
> I'm not convinced that including the same page in more than one TOC is the best
> way to present information, usually when a second book wants to refer to a page
> in a first book a hyperlink is used, even if it requires creating a page which
> contains little more than a title and that hyperlink.

We are also very interested in getting this problem fixed.  We have exactly the same issues as Paul, where plugins are shared among different primary TOC's, so that the user doesn't have to know that the plugin belongs to multiple products (what we call the primary TOC's).

Chris's suggestion of using a hyperlink on a static html page will not work for us.  If we use an html page, the shared content will be excluded in the search scope unless the user knows which specific plugins to include in the search scope. Also, these html pages would have to be maintained manually when the content changes, e.g. plugins added/removed/renamed.

Can you please let me know what the plans are for this bug?
Comment 8 Chris Goldthorpe CLA 2009-04-10 14:12:17 EDT
It occurred to me that there is another possible way to fix or work around this bug, which is to leverage the fix for Bug 184787. In Eclipse 3.5 if an href has an anchor I am adding an additional parameter containing the lookup path of the element. Can you see if adding anchors (even if they don't exist in the document) to your hrefs makes the problem go away?
Comment 9 Missing name CLA 2009-04-10 14:43:23 EDT
Can you give an example of how to use anchors in this case?  I assumed that we can't use anchors because the nested plugin can only hook into one parent.

From http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ua_help_content_nested.htm:

Other plug-ins can then contribute to the anchor from their plug-in.  This is done using the link_to attribute when defining a toc.

<toc link_to="../com.example.helpexample/toc.xml#postConcepts" label="Late breaking info about concepts">
	<topic>
		...
	</topic>
</toc>
Comment 10 Chris Goldthorpe CLA 2009-04-10 15:01:05 EDT
By anchor I meant an html anchor, such as 

<topic label="Main Topic"  href="html/maintopic.html#A"> 

Comment 11 Lee Anne Kowalski CLA 2009-04-10 15:14:05 EDT
So is the test that when there is one topic file (say, example.html) that we want to use in two different places in the ToC, that we have:

a. Two HTML anchor spots coded within that HTML topic file at the top of its body, like:
<a name="A">
<a name="B">

b. In tocA.xml, its <topic> href has both the file and an anchor:
<topic href="example.html#A" label="First occurrence" />

while in tocB.xml, its <topic> href uses the same file, but with the other anchor:
<topic href="example.html#B" label="Second occurrence" />

Is that the idea?
Comment 12 Lee Anne Kowalski CLA 2009-04-10 15:17:40 EDT
Oh, sorry, I missed this part of comment8: that the anchors don't have to exist in the topic file.

If I code a #anchor in the href for the <topic> element, but the <a> doesn't exist in the topic file, does clicking on that <topic> in the ToC still load the topic in the right hand side properly?

Comment 13 Lars Vogel CLA 2019-11-14 03:10:01 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.