info.magnolia.module.templatingkit.search
Class SearchResultModel

java.lang.Object
  extended by info.magnolia.rendering.model.RenderingModelImpl<RD>
      extended by info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel<info.magnolia.rendering.template.TemplateDefinition>
          extended by info.magnolia.module.templatingkit.search.SearchResultModel
All Implemented Interfaces:
STKRenderingModel<info.magnolia.rendering.template.TemplateDefinition>, info.magnolia.rendering.model.RenderingModel<info.magnolia.rendering.template.TemplateDefinition>

public class SearchResultModel
extends AbstractSTKTemplateModel<info.magnolia.rendering.template.TemplateDefinition>

STK Rendable Model definition dedicated to Display and execute Search Result Model.

Version:
$Id$
Author:
tmiyar

Field Summary
protected  int count
           
protected  int currentPage
           
protected  int maxResultsPerPage
           
protected  int numPages
           
protected  String repository
           
protected  List<info.magnolia.cms.core.Content> result
           
 
Fields inherited from class info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel
DEFAULT_SITEROOT_TEMPLATE_CATEGORY, stkFunctions, templatingFunctions
 
Fields inherited from class info.magnolia.rendering.model.RenderingModelImpl
content, contentMap, definition, parentModel
 
Fields inherited from interface info.magnolia.rendering.model.RenderingModel
SKIP_RENDERING
 
Constructor Summary
SearchResultModel(javax.jcr.Node content, info.magnolia.rendering.template.TemplateDefinition definition, info.magnolia.rendering.model.RenderingModel<?> parent, STKTemplatingFunctions stkFunctions, info.magnolia.templating.functions.TemplatingFunctions templatingFunctions)
           
 
Method Summary
 String execute()
           
protected  String generateSimpleQuery(String input)
           
 int getBeginIndex()
           
 int getCount()
           
 int getCurrentPage()
           
 int getEndIndex()
           
protected  int getMaxResultsPerPage()
           
 int getNumPages()
           
protected  int getOffset()
           
 String getPageLink(int i)
          Deprecated. Not used anymore.
 String getPath()
           
 String getPosition()
           
 List<javax.jcr.Node> getQueryResult()
          FIXME usage of deprecated classes: Content.
 String getQueryStr()
           
 Collection<SearchResultItem> getResult()
           
protected  int pagedQuery(Collection<info.magnolia.cms.core.Content> queryResult, int offset, int limit)
           
 
Methods inherited from class info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel
getSite, getSiteRoot
 
Methods inherited from class info.magnolia.rendering.model.RenderingModelImpl
getContent, getDef, getDefinition, getNode, getParent, getRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.rendering.model.RenderingModel
getContent, getDefinition, getNode, getParent, getRoot
 

Field Detail

repository

protected String repository

result

protected List<info.magnolia.cms.core.Content> result

count

protected int count

maxResultsPerPage

protected int maxResultsPerPage

currentPage

protected int currentPage

numPages

protected int numPages
Constructor Detail

SearchResultModel

@Inject
public SearchResultModel(javax.jcr.Node content,
                                info.magnolia.rendering.template.TemplateDefinition definition,
                                info.magnolia.rendering.model.RenderingModel<?> parent,
                                STKTemplatingFunctions stkFunctions,
                                info.magnolia.templating.functions.TemplatingFunctions templatingFunctions)
Method Detail

getMaxResultsPerPage

protected int getMaxResultsPerPage()

execute

public String execute()
Specified by:
execute in interface info.magnolia.rendering.model.RenderingModel<info.magnolia.rendering.template.TemplateDefinition>
Overrides:
execute in class info.magnolia.rendering.model.RenderingModelImpl<info.magnolia.rendering.template.TemplateDefinition>

getOffset

protected int getOffset()

pagedQuery

protected int pagedQuery(Collection<info.magnolia.cms.core.Content> queryResult,
                         int offset,
                         int limit)
                  throws Exception
Throws:
Exception

generateSimpleQuery

protected String generateSimpleQuery(String input)

getPath

public String getPath()

getQueryResult

public List<javax.jcr.Node> getQueryResult()
FIXME usage of deprecated classes: Content. To remove when SearchResultItem will be fully migrated.


getResult

public Collection<SearchResultItem> getResult()

getQueryStr

public String getQueryStr()

getCount

public int getCount()

getCurrentPage

public int getCurrentPage()

getNumPages

public int getNumPages()

getPageLink

public String getPageLink(int i)
Deprecated. Not used anymore.

Not used.

Parameters:
i -
Returns:

getBeginIndex

public int getBeginIndex()

getEndIndex

public int getEndIndex()

getPosition

public String getPosition()


Copyright © 2008-2013 Magnolia International Ltd.. All Rights Reserved.