Class SearchContext
- java.lang.Object
-
- org.ametys.web.frontoffice.search.instance.model.SearchContext
-
public class SearchContext extends Object
A search context
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchContext.ContextLangAndCurrentLang
Class wrapping aContextLang
and the current lang.static class
SearchContext.LangQueryProducer
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
Constructors Constructor Description SearchContext(SiteContext sites, SitemapContext sitemap, ContextLang langs, List<String> tags, boolean tagAutoposting)
Creates a SearchContext
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
SearchContext.ContextLangAndCurrentLang
getContextLang(String currentLang)
Gets theContextLang
and the current langQuery
getSitemapQuery(Page currentPage)
Gets the query corresponding to the sitemap part of the contextQuery
getSiteQuery(Site currentSite)
Gets the query corresponding to the site part of the contextQuery
getTagQuery()
Gets the query corresponding to the tag part of the contextint
hashCode()
ContextLang
langContext()
Gets the lang contextSiteContext
siteContext()
Gets the site contextSitemapContext
sitemapContext()
Gets the sitemap contextPair<List<String>,Boolean>
tagContext()
Gets the tag context
-
-
-
Constructor Detail
-
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 Detail
-
siteContext
public SiteContext siteContext()
Gets the site context- Returns:
- the site context
-
sitemapContext
public SitemapContext sitemapContext()
Gets the sitemap context- Returns:
- the sitemap context
-
langContext
public ContextLang langContext()
Gets the lang context- Returns:
- the lang context
-
tagContext
public Pair<List<String>,Boolean> tagContext()
Gets the tag context- Returns:
- the tag context
-
getSiteQuery
public Query getSiteQuery(Site currentSite)
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
public Query getSitemapQuery(Page currentPage)
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
public SearchContext.ContextLangAndCurrentLang getContextLang(String currentLang)
Gets theContextLang
and the current lang- Parameters:
currentLang
- The current lang- Returns:
- the wrapper of the
ContextLang
and the current lang
-
getTagQuery
public Query getTagQuery()
Gets the query corresponding to the tag part of the context- Returns:
- the query corresponding to the tag part of the context
-
-