info.magnolia.cms.taglibs.util
Class SearchResultSnippetTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by info.magnolia.cms.taglibs.util.SearchResultSnippetTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class SearchResultSnippetTag
extends javax.servlet.jsp.tagext.TagSupport

Output a set of snippets taken from any paragraph in the given page mathing any of the search term.

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Fabrizio Giustina
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
SearchResultSnippetTag()
           
 
Method Summary
 int doStartTag()
           
 Collection getSnippets()
          Extract a collection of snippets from any paragraph in the given page.
 void release()
           
 void setChars(int chars)
          Number of characters to include in search snippets.
 void setMaxSnippets(int maxSnippets)
          Maximum number of snippets to print out.
 void setPage(Content page)
          A Content node of type mgnl:content (a magnolia page), typically returned by the simpleSearch tag.
 void setQuery(String query)
          Search query.
protected  String stripHtmlTags(String input)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchResultSnippetTag

public SearchResultSnippetTag()
Method Detail

setQuery

public void setQuery(String query)
Search query.


setChars

public void setChars(int chars)
Number of characters to include in search snippets. Default is 100.


setMaxSnippets

public void setMaxSnippets(int maxSnippets)
Maximum number of snippets to print out.


setPage

public void setPage(Content page)
A Content node of type mgnl:content (a magnolia page), typically returned by the simpleSearch tag.


doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException
See Also:
TagSupport.doStartTag()

getSnippets

public Collection getSnippets()
Extract a collection of snippets from any paragraph in the given page.

Returns:
a collection of Strings.

stripHtmlTags

protected String stripHtmlTags(String input)
Parameters:
resultString -
Returns:

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport
See Also:
TagSupport.release()


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.