Bug 13464 - option for TOC auto-synchronization
Summary: option for TOC auto-synchronization
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Dorian Birsan CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-10 17:30 EDT by Erik Hennum CLA
Modified: 2002-11-04 02:11 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Hennum CLA 2002-04-10 17:30:26 EDT
Variant - "infocenter" Eclipse help system

Some organizations might prefer to let the user click the TOC synchronization 
button.  Others (like ours) might want to auto-synchronize so the user has the 
TOC context at all times.  Since both approaches have rationales, maybe the best 
approach for Eclipse would be to offer the option.

In particular, Eclipse might offer a JavaScript function that an HTML content 
page could call to notify the runtime Eclipse viewer that it's displaying.  
Upon notification, the runtime Eclipse viewer could auto-synchronize the TOC.

The Eclipse displayTocFor() function is almost adequate to support TOC 
auto-synchronization.  Content pages can call

    parent.displayTocFor( window.location.href );

and, if the book is open, the TOC synchronizes.  

If the book isn't open, however, Internet Explorer 5.5 reports an error at 
org.eclipse.help.webapp/help.js on the line

    var selected = NavFrame.toc.selectTopic(topic);

That problem could be filed as a bug if Eclipse help sanctioned TOC 
auto-synchronization as an optional feature.
Comment 1 Dorian Birsan CLA 2002-04-10 18:28:20 EDT
There is always a trade-off between making things very customizable and also 
keeping them simple. One of the reasons we use JSP's was to allow others to 
take the code and adapt it for particular usages. This is our first pass at a 
web based help for eclipse and the current implementation is not the most 
clean, reusable or componentized. 
We should be gathering this kind of requirements from users like you, who both 
understand the technology and the end-user requirements and come up with a more 
flexible help implementation.

For this particualar issue, you are making the assumption that you have control 
over the help content, so you can ask pages to call some functions. We chose 
the opposite approach, saying that the help system does not care what the 
content is or does.
Comment 2 Dorian Birsan CLA 2002-05-13 16:14:45 EDT
After 2.0
Comment 3 Dorian Birsan CLA 2002-07-08 14:34:53 EDT
Re-opening the bug...
Comment 4 Konrad Kolosowski CLA 2002-08-07 14:48:46 EDT
Targeted for 2.1.
Comment 5 Dorian Birsan CLA 2002-08-12 19:26:02 EDT
I released some code changes to support autosynchronization. The code isn't 
final, and I'd like to get some input on it.
First, your proposal to expose some Javascript is interesting and, instead on 
relying on internal details (parent.displayTocFor(topic) ) I chose to add a 
method showTopicInContents() in one of our public Javascript files, 
org.eclipse.help/livehelp.js.

Then, all the content files that need to autosynchronize would need to have 
something like 

	<script src="../org.eclipse.help/livehelp.js"></script>
	<script>
	   showTopicInContents(window.location.href);
	</script>

inserted in the <head> section. Note the "../" may need to be replaced by 
more ../ paths, depending on the nested level of the document inside the plugin 
directory.

We used the livehelp.js, as this was the javascript to be included for calling 
actions classes in the workbench. However, we could change its name to 
helpAPI.js (or something of that nature), which basically would be a set of 
Javascript API's into help.

The original proposal to use parent.methodCall() is fairly reasonable, but I 
think it implicitly makes assumptions about the help webapp implementation. We 
can discuss this or alternate approaches, if including livehelp.js is too much 
trouble.