Interface ExcerptProvider

All Known Implementing Classes:

public interface ExcerptProvider

ExcerptProvider defines an interface to get an XML excerpt of a matching node.
E.g. if you search for 'jackrabbit' and 'query' you may get the following result for a node:

     <fragment><highlight>Jackrabbit</highlight> implements both the mandatory XPath and optional SQL <highlight>query</highlight> syntax.</fragment>
     <fragment>Before parsing the XPath <highlight>query</highlight> in <highlight>Jackrabbit</highlight>, the statement is surrounded</fragment>

Field Summary
static QName REP_EXCERPT
          QName of the rep:excerpt function.
Method Summary
 String getExcerpt(NodeId id, int maxFragments, int maxFragmentSize)
          Returns the XML excerpt for the node with id.
 void init( query, SearchIndex index)
          Initializes this excerpt provider.

Field Detail


static final QName REP_EXCERPT
QName of the rep:excerpt function.

Method Detail


void init( query,
          SearchIndex index)
          throws IOException
Initializes this excerpt provider.

query - excerpts will be based on this query.
index - provides access to the search index.
IOException - if an error occurs while initializing this excerpt provider.


String getExcerpt(NodeId id,
                  int maxFragments,
                  int maxFragmentSize)
                  throws IOException
Returns the XML excerpt for the node with id.

id - a node id.
maxFragments - the maximum number of fragments to create.
maxFragmentSize - the maximum number of characters in a fragment.
the XML excerpt or null if there is no node with id.
IOException - if an error occurs while creating the excerpt.

Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.