info.magnolia.cms.taglibs.util
Class SearchResultSnippetTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
info.magnolia.cms.taglibs.util.SearchResultSnippetTag
- All Implemented Interfaces:
- java.io.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
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 |
Method Summary |
int |
doStartTag()
|
java.util.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(java.lang.String query)
Search query. |
protected java.lang.String |
stripHtmlTags(java.lang.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 |
SearchResultSnippetTag
public SearchResultSnippetTag()
setQuery
public void setQuery(java.lang.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 java.util.Collection getSnippets()
- Extract a collection of snippets from any paragraph in the given page.
- Returns:
- a collection of Strings.
stripHtmlTags
protected java.lang.String stripHtmlTags(java.lang.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-2011 Magnolia International Ltd.. All Rights Reserved.