Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 259545 - [Webapp] API to allow user defined filters to process the files sent from the server
Summary: [Webapp] API to allow user defined filters to process the files sent from the...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-23 03:03 EST by sheila CLA
Modified: 2009-01-05 12:40 EST (History)
4 users (show)

See Also:


Attachments
Patch for adding extra filters (13.38 KB, patch)
2008-12-23 03:03 EST, sheila CLA
cgold: iplog+
Details | Diff
Patch including modifications I made myself (32.93 KB, patch)
2009-01-05 12:33 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 sheila CLA 2008-12-23 03:03:03 EST
Created attachment 121110 [details]
Patch for adding extra filters

The purpose of Extra Filters is to provide an easy way for user to define some filters to process the documentation plug-ins sent from the server.

To make your filters works, you should follow some steps:

1. Define a filter class used to do the filter by extending a class named AbstractPrioritizedFilter and implementing an interface named IFilter.

2. Extend the extension point "org.eclipse.help.webapp.contentFilter", which is newly defined in Plugin "org.eclipse.help.webapp". You should specify each filter's name in plugin.xml. Besides, you can also specify the filter's priority which will be used as a basis when filtering the files.
Comment 1 sheila CLA 2008-12-23 03:12:32 EST
The purpose of Extra Filters is to provide an easy way for user to define some
filters to process the documentation plug-ins sent from the server.

To make your filters works, you should follow some steps:

1. Define a filter class used to do the filter by extending a class named
AbstractPrioritizedFilter and implementing an interface named IFilter.

2. Extend the extension point "org.eclipse.help.webapp.contentFilter", which is
newly defined in Plugin "org.eclipse.help.webapp". You should specify each
filter's name in plugin.xml. Besides, you can also specify the filter's
priority which will be used as a basis when filtering the files.
Comment 2 Chris Goldthorpe CLA 2008-12-23 11:48:51 EST
Reopening - the bug does not get marked as fixed until the change is commited.
Comment 3 Chris Goldthorpe CLA 2009-01-05 12:33:14 EST
Created attachment 121546 [details]
Patch including modifications I made myself

I have updated the patch to make the following changes:

1.	The extension point was added to plugin.xml in org.eclipse.help.webapp
2.	Used IFilter as the class defined in the extension and moved to the package org.eclipse.help.webapp. This means that the API does not rely on any internal classes.
3.	Made the default priority 1
4.	Documented the extension
5.	Restored code which the patch had deleted allowing product specific page not found page and allowing for no error page.
6.	Changed code to only read extensions once so that error messages for classes which cannot be loaded are not written to the log every time a page is read
7.	Reversed the sort order of extensions so lower numbers are processed first
8.      Added JUnit tests
Comment 4 Chris Goldthorpe CLA 2009-01-05 12:40:25 EST
The authors of the original patch were Zhuang Chen and Mei Yang. The submission has recieved IP approval (CQ 2920).

The most recently attached patch has been committed to HEAD. FIXED.