Class SearchContext
java.lang.Object
org.ametys.web.frontoffice.search.instance.model.SearchContext
A search context
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classClass wrapping aContextLangand the current lang.static final classClass wrapping an implementation ofQueryin 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
ConstructorsConstructorDescriptionSearchContext(SiteContext sites, SitemapContext sitemap, ContextLang langs, List<String> tags, boolean tagAutoposting) Creates a SearchContext -
Method Summary
Modifier and TypeMethodDescriptionbooleangetContextLang(String currentLang) Gets theContextLangand the current langgetSitemapQuery(SitemapElement 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 contextinthashCode()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-trueif 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 theContextLangand the current lang- Parameters:
currentLang- The current lang- Returns:
- the wrapper of the
ContextLangand 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
-