Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322952

Summary: Adopters should be able to hide folders from displaying as resource mappings
Product: [WebTools] WTP Common Tools Reporter: Aidyl Kareh <amkareh>
Component: wst.commonAssignee: Aidyl Kareh <amkareh>
Status: RESOLVED FIXED QA Contact: Carl Anderson <ccc>
Severity: normal    
Priority: P3 CC: amkareh, ccc, jsholl
Version: unspecifiedFlags: ccc: review+
jsholl: review+
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Patch
none
Updated Patch
none
Latest Updated Patch
ccc: iplog+
Patch - Changes that were not checked in none

Description Aidyl Kareh CLA 2010-08-17 16:33:35 EDT
Build Identifier: WTP 3.2.2

Adopters currently have no way of hiding configuration folders from being displayed as Resource Mappings in the 'Deployment Assembly' property page's table. An extension point should be made available so that specified folders are filtered out from the 'Add Folder Mappings' wizard and the 'Deployment Assembly' table.

Reproducible: Always
Comment 1 Aidyl Kareh CLA 2010-08-17 16:35:28 EDT
Created attachment 176844 [details]
Proposed Patch

The attached patch adds an extension point so that adopters can specify folders that they want to be filtered out from the 'Add Folder Mappings' wizard and the 'Deployment Assembly' table. The extension point should be used as follows:
    <extension
        point="org.eclipse.wst.common.modulecore.ui.resourceMappingFilter">
        <resourceMapping
              source-path="/.settings">
        </resourceMapping>
    </extension>

This patch also uses the extension point to add a filter so that the '/.settings' folder is not shown as a resource mapping option.
Comment 2 Aidyl Kareh CLA 2010-08-24 11:39:45 EDT
Created attachment 177335 [details]
Updated Patch

This patch updates the original patch by adding the ResourceMappingFilterExtensionRegistry class to handle the loading and some functionality of resourceMappingFilter extensions. This patch also changes that the source-path attribute now expects a project relative source path represented as regular expression. The following example would filter out the '.settings' folder and its contents:
<extension 
 point="org.eclipse.wst.common.modulecore.ui.resourceMappingFilter">
  <resourceMapping
   source-path="\.settings">
  </resourceMapping>
</extension>
Comment 3 Jason Sholl CLA 2010-08-24 16:55:33 EDT
Reviewed and looks good.  Please include the following changes.

1.  There are a few places where exceptions are caught and eaten.  Please review all of these places and log the exceptions if they should be logged (they probably should be).  Also, there was one place where Exception was caught, does the catch need to be that general, or can you catch a more specific exception?

2.  Please test some badly configured extension contributions that would not be caught by the schema validator. (not sure if there is one, but perhaps a badly configured regex string?)  Make sure the registry reader fails gracefully (i.e. the properly configured extensions are still read) and logs an error message for the developer to help them fix it (if possible).
Comment 4 Aidyl Kareh CLA 2010-08-25 15:01:06 EDT
Created attachment 177459 [details]
Latest Updated Patch

Thanks for the comments Jason. This patch takes into account all of your recommended changes.
Comment 5 Carl Anderson CLA 2010-08-26 00:10:44 EDT
I approve
Comment 6 Carl Anderson CLA 2010-08-26 00:22:45 EDT
Committed to HEAD for WTP 3.2.2 and WTP 3.3
Comment 7 Aidyl Kareh CLA 2010-08-26 10:36:23 EDT
Created attachment 177529 [details]
Patch - Changes that were not checked in

There seems to have been a problem while checking in my bug fix patch. The attached patch contains all the changes that were missing from the checked in code.