Class SearchContext
java.lang.Object
org.ametys.web.frontoffice.search.instance.model.SearchContext
A search context
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Class wrapping aContextLang
and the current lang.static final class
Class wrapping an implementation ofQuery
in order toSearchContext.LangQueryProducer.produce(org.ametys.web.frontoffice.search.instance.model.SearchContext.ContextLangAndCurrentLang)
the final query executed for limiting the context language for a givenReturnable
. -
Constructor Summary
ConstructorDescriptionSearchContext
(SiteContext sites, SitemapContext sitemap, ContextLang langs, List<String> tags, boolean tagAutoposting) Creates a SearchContext -
Method Summary
Modifier and TypeMethodDescriptionboolean
getContextLang
(String currentLang) Gets theContextLang
and the current langgetSitemapQuery
(Page currentPage) Gets the query corresponding to the sitemap part of the contextgetSiteQuery
(Site currentSite) Gets the query corresponding to the site part of the contextGets the query corresponding to the tag part of the contextint
hashCode()
Gets the lang contextGets the site contextGets the sitemap contextGets the tag context
-
Constructor Details
-
SearchContext
public SearchContext(SiteContext sites, SitemapContext sitemap, ContextLang langs, List<String> tags, boolean tagAutoposting) Creates a SearchContext- Parameters:
sites
- The site contextsitemap
- The sitemap contextlangs
- The lang of the contexttags
- The tags of the contexttagAutoposting
-true
if search on tags should be with autoposting
-
-
Method Details
-
siteContext
Gets the site context- Returns:
- the site context
-
sitemapContext
Gets the sitemap context- Returns:
- the sitemap context
-
langContext
Gets the lang context- Returns:
- the lang context
-
tagContext
Gets the tag context- Returns:
- the tag context
-
getSiteQuery
Gets the query corresponding to the site part of the context- Parameters:
currentSite
- the current site- Returns:
- the query corresponding to the site part of the context
-
getSitemapQuery
Gets the query corresponding to the sitemap part of the context- Parameters:
currentPage
- the current page- Returns:
- the query corresponding to the sitemap part of the context
-
getContextLang
Gets theContextLang
and the current lang- Parameters:
currentLang
- The current lang- Returns:
- the wrapper of the
ContextLang
and the current lang
-
getTagQuery
Gets the query corresponding to the tag part of the context- Returns:
- the query corresponding to the tag part of the context
-
hashCode
-
equals
-