Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Plug-in Developer Guide
Previous Page Home Next Page

Lucene Search Participants

Identifier:
org.eclipse.help.base.luceneSearchParticipants

Since:
3.2

Description:
This extension point should be used to add document content to the Lucene search index. There are two cases were you would want to add a search participant:
  1. To index documents registered with the help system's TOC that are not of the HTML format (e.g. XML). In this case, the participant must declare file extensions it can handle. It will be called to index each matching document. In this case, the participant has the plug-in scope.
  2. To index documents outside of the help system's TOC. In this case, the participant will be given a chance to index all the documents it knows about at once. In addition, the participant will be delegated the task of opening the search result because the help system will not know how to open the documents outside the TOC. In this case, the participant has global scope.

Search participants are associated with the plug-in the extension appears in. In order to reuse the participant in other plug-ins, binding should be used to reference them. This strategy prevents a plug-in from imposing its participant on the entire product for the file extensions it was registered with. By adding an explicit reference, the plug-in declares that it allows the referenced search participant to handle indexing of documents with those extensions. For documents that are not part of the TOC, there is no such danger. For this reason, they are global and binding should not be used.

Configuration Markup:

<!ELEMENT extension ( searchParticipant | binding)+>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED

>


<!ELEMENT searchParticipant ( participant?)>

<!ATTLIST searchParticipant

id          CDATA #REQUIRED

name        CDATA #IMPLIED

icon        CDATA #IMPLIED

participant CDATA #IMPLIED

extensions  CDATA #IMPLIED

headless    (true | false) "false"

>

  • id - a unique identifier of this search participant
  • name - an optional translatable name that will be used to represent the participant as a category of documents that can be included in the search. The name is not required when the participant is used for documents in the TOC (i.e. when extensions attribute is set).
  • icon - an optional icon to be used to render search hits from the documents indexed by this participant. The icon will be used for the documents outside of the help's TOC to indicate that opening the search hit may result in an action different from showing the regular help document. Consequently, icon is not required when the participant is used for documents in the TOC (i.e. when extensions attribute is set).
  • participant - (new in 3.2) the implementation class for the help search participant. This class must implement the org.eclipse.help.search.ILuceneSearchParticipant interface. This attribute may be omitted, and the nested participant element may be provided instead.
  • extensions - an optional field containing the list of file types handled by the search participant. This is a string containing comma separate file extensions (e.g. "abc, xyz"). This attribute should be used when files are made explicitly known to the help system in the org.eclipse.help.toc extension point. The absence of this attribute is an indication that the participant will index all the documents it is responsible for by itself.

    Note also that participants that are registered for known documents have plug-in scope. If you want a participant to apply to documents in another plug-in, you must use the binding element to extend the scope. In contrast, participants that do not specify this attribute have global scope.

  • headless - specifies whether or not this search participant should be used when running the help system outside an eclipse workbench, i.e. it is running in either standalone or infocenter mode. The default value is false.

<!ELEMENT participant ( parameter*)>

<!ATTLIST participant

class CDATA #IMPLIED

>

  • class - the implementation class for the help search participant. This class must implement the org.eclipse.help.search.ILuceneSearchParticipant interface.

<!ELEMENT parameter EMPTY>

<!ATTLIST parameter

name  CDATA #REQUIRED

value CDATA #REQUIRED

>

  • name - name of a parameter passed to the implementation class
  • value - value of a parameter passed to the implementation class

<!ELEMENT binding EMPTY>

<!ATTLIST binding

participantId IDREF #IMPLIED

>

  • participantId - a reference to the search participant declared elsewhere using searchParticipant element. Binding can be used to reuse search participants in plug-ins without violating the top-down policy. Binding is only needed for indexing documents that are part of the TOC. Otherwise, participant has global scope.

Examples:
The following is a sample usage of the extension point:


  <extension point=
"org.eclipse.help.base.luceneSearchParticipant"
>
   <searchParticipant id=
"org.eclipse.myGlobalParticipant"

     name=
"Global Participant"

     icon=
"icons/mydoc.gif"

     participant=
"org.eclipse.myPlugin.myPackage.MyGlobalParticipant"

     headless=
"true"
/>
   <searchParticipant id=
"org.eclipse.myXYZParticipant"

     extensions=
"xyz"

     participant=
"org.eclipse.myPlugin.myPackage.MyXYZParticipant"
/>
  </extension>

Supplied Implementation:
Help system provides search participant for XHTML files (xhtml extension). Plug-ins that have dynamic XHTML documents as part of TOC must bind to this participant using binding element and org.eclipse.help.base.xhtml as the target participant id.


Copyright (c) 2005, 2006 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v10.html


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire