This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 330310 - [webapp] Regression: Capability filtering and "Show All" are missing in Eclipse 3.6
Summary: [webapp] Regression: Capability filtering and "Show All" are missing in Eclip...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6.2   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 02:41 EST by Hinaba Mising name CLA
Modified: 2011-01-05 15:24 EST (History)
5 users (show)

See Also:


Attachments
Patch against 3.6 maintenance stream (4.29 KB, patch)
2010-11-24 19:24 EST, 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 Hinaba Mising name CLA 2010-11-16 02:41:51 EST
Build Identifier: I20100608-0911

Problem Description:

The following PDE related Help in Eclipse Platform should not be displayed in the Help index, if "plug-in development" is set to be invalid in Activity capability settings page (to be set by
[Window] > [Preferences] > [General] > [Capabilities] > [Advanced] > [Development] > [Plug-in Development]).

1) Platform Plug-in Developer Guide
2) JDT Plug-in Developer Guide
3) Plug-in Development Environment Guide

i.e. When the PDE capability is unchecked, the activity with pattern "org.eclipse.jdt.doc.isv/toc.xml" should get disabled (once the activity pattern binding for this extension sake is added).

This was working fine with Eclipse 3.6 M3 but is NOT working with Eclipse 3.6 M6. i.e. in Eclipse 3.6 M6,  if the capability "Plug-in Development" is set to be invalid (unchecked) in the Activity capability settings page, then the above PDE related Help in Eclipse Platform is stilll displayed without getting hidden.


Some Observations:

1. For org.eclipse.help.internal.webapp.data.TocData.isEnabled(int), we can find the caller in 3.4 code but not possible to find in 3.6. The method implementation is also changed. Below "#" parts were missing in 3.6 code in TocFragmentServlet$Serializer.serializeTocs()
  
            boolean shouldLoad = requestKind == REQUEST_SHOW_TOCS || toc == selectedToc;
    #                                   if(!tocData.isEnabled(toc)){
    #                                                     shouldLoad = false;
    #                                   } 

    The validation process with HelpActivitySupport.isRoleEnabled is coming after this, so probably the cause of this issue would be above code change.

2. Also, in TocData.isEnabled(int toc) method, when we do the following modification:
 public boolean isEnabled(int toc) {
      // Original code in Eclipse 3.6
      //return ScopeUtils.showInTree(tocs[toc], scope); // original in 3.6
      
      // Code present in Eclipse 3.4
      return EnabledTopicUtils.isEnabled(tocs[toc]); // added by me (used in 3.4)    
 }

    With the above modification, this issue would be resolved but this is not the right solution as we cannot replace ScopeUtils with EnabledTopicUtils.

Conclusion:
So, how to resolve this issue by using ScopeUtils only and not using EnabledTopicUtils? Please suggest solution for this. Thanks in advance.

Reproducible: Always

Steps to Reproduce:
1. Open Eclipse 3.6 M6

2. Add the following code snippet to plug-in.xml of any project in the workspace preferrably to "org.eclipse.sdk/plugin.xml" by  
     importing this 'org.eclipse.sdk' project source.

 <extension point="org.eclipse.ui.activities">
      <!-- For Platform Plugin Development Guide-->
   <activityPatternBinding
      activityId="org.eclipse.plugInDevelopment"
      pattern="org\.eclipse\.platform\.doc\.isv/.*">
   </activityPatternBinding>
      <!-- For Platform Plugin Development Guide-->
 </extension>

3. Now run the plug-in as an Eclipse application and the runtime eclispe should be opened.

4.  In the runtime eclipse, got to Capabilities preferences settings page ([Window] > [Preferences] > [General] > [Capabilities] > 
      [Advanced] > [Development] >  [Plug-in Development]) and uncheck the check box "Plug-in Development" and click on Apply and OK 
      buttons.


5. Open the Help contents ([Help] > [Help Contents]) in runtime eclipse, the following PDE related Help in Eclipse Platform should not  
     be displayed in the Help index
    a.  Platform Plug-in Developer Guide

    But it is being displayed in Eclipse 3.6 M6. This is the Issue.
Comment 1 Curtis Windatt CLA 2010-11-16 10:31:32 EST
Moving to Platform User Assistance for comment.  I don't think there is anything PDE is doing to break this.  As far as I know we haven't changed our capability regex.
Comment 2 Chris Goldthorpe CLA 2010-11-16 12:44:19 EST
Eclipse 3.6 does not hide information in the table of contents for disabled capabilities. This is intentional - we had several complaints about confusion with the "Show All" button.
Comment 3 Hinaba Mising name CLA 2010-11-17 04:51:25 EST
This is to confirm 2 points as below. 

1. Our understanding for above comment is that a function to hide information in TOC for disabled capabilities was supported up to eclipse 3.5, but not supported in 3.6 by intention. Is this correct? 

2. Instead of this eliminated function, is there any new function introduced? 
(e.g. Provide a possibility for end users to customize Help contents, or so)

thanks.
Comment 4 Chris Goldthorpe CLA 2010-11-17 18:53:17 EST
(In reply to comment #3)
> This is to confirm 2 points as below. 
> 
> 1. Our understanding for above comment is that a function to hide information
> in TOC for disabled capabilities was supported up to eclipse 3.5, but not
> supported in 3.6 by intention. Is this correct? 

That is correct

> 
> 2. Instead of this eliminated function, is there any new function introduced? 
> (e.g. Provide a possibility for end users to customize Help contents, or so)
> 
> thanks.

If you want a topic or Toc to only show when certain conditions are satisfied, for example when a specific capability is enabled you can add filters in the table of contents file. If a topic or toc does not satisfy a filter then that element and it's descendants are not displayed.

This example filters out a topic unless the Java Development activity is enabled.

<topic filter="activity=org.eclipse.javaDevelopment" label="The activity org.eclipse.javaDevelopment is enabled" href="data/help/toc/filteredToc/simple_page.html">

</topic>

This example filters out a topic unless the Development Category is Enabled.

<topic filter="category=org.eclipse.categories.developmentCategory" label="The category org.eclipse.categories.developmentCategory is enabled" href="data/help/toc/filteredToc/simple_page.html">

</topic>

This example only shows when the plug-in org.eclipse.help is installed.

<topic filter="plugin=org.eclipse.help" label="The plugin org.eclipse.help is installed" href="data/help/toc/filteredToc/simple_page.html">

</topic>
Comment 5 Martin Oberhuber CLA 2010-11-22 10:29:41 EST
(In reply to comment #2)
> capabilities. This is intentional - we had several complaints about confusion
> with the "Show All" button.

Can you give a bit more details what these complaints were? Ideally, point us to bugzilla's such that we can follow related discussion?

My understanding is that with Eclipse 3.6 the "Show All" button and respective filtering based on activities can be enabled in plugin_customization.ini :

org.eclipse.help.base/showDisabledActivityTopics=off

We consider using the filtering of help based on enabled capabilities in our product. I'm happy with the functionality of the "Show All" button except that it could be more prominent, similar to what bug 305895 implemented for the webapp.

So far the only problem I see is that only the Help View supports capability filtering, but the Webapp does not. This is completely inconsistent, and the scrennshot on attachment 159356 [details] / bug 303105 shows that it's technically possible to do.

What is the current state / plans regarding filtering based on Activities?
Comment 6 Martin Oberhuber CLA 2010-11-22 12:27:20 EST
Verified that a "Show All" button existed in the webapp up until Eclipse 3.5 but in Eclipse 3.6 it's been removed. I consider this a bug and regression, since the removal has not been announced in the 3.6 porting guide [1]

[1] http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/porting/eclipse_3_6_porting_guide.html
Comment 7 Chris Goldthorpe CLA 2010-11-22 14:42:09 EST
We definitely need to restore this for Eclipse 3.7. I'm not sure what to do for Eclipse 3.6.
Comment 8 Chris Goldthorpe CLA 2010-11-24 19:24:51 EST
Created attachment 183815 [details]
Patch against 3.6 maintenance stream

This patch will restore the disabled topics functionality from Eclipse 3.5. To enable this functionality make sure that the preference org.eclipse.help.base/showDisabledActivityTopics  is set to "on", "off" or "never".

I have done some testing and the functionality seems to be working the same as in Eclipse 3.5. I will do more testing next week after the Thanksgiving holidays.

Martin, are you able to try out this patch?
Comment 9 Martin Oberhuber CLA 2010-11-29 05:39:52 EST
We tested the patch, and it works perfectly fine for us. 
Please apply to 3.6.2, thanks!
Comment 10 Chris Goldthorpe CLA 2010-11-29 15:43:23 EST
I'll do some more testing then apply to the maintenance stream.
Comment 11 Chris Goldthorpe CLA 2010-11-30 18:32:37 EST
Patch applied to 3.6 maintenance stream, Fixed.
Comment 12 Martin Oberhuber CLA 2010-12-13 05:35:05 EST
Verified in M20101210-0800 on Windows.
Comment 13 Hinaba Mising name CLA 2010-12-15 03:39:48 EST
(In reply to comment #12)
> Verified in M20101210-0800 on Windows.

Thanks for providing patch file. After applying it we confirmed that the behavior got same as previous release.
Comment 14 Chris Goldthorpe CLA 2011-01-05 15:24:40 EST
I have applied the same patch to HEAD which restores the functionality there also.