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 classSearchContext.ContextLangAndCurrentLangClass wrapping aContextLangand the current lang.static classSearchContext.LangQueryProducerClass 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.
-
Field Summary
Fields Modifier and Type Field Description private ContextLang_langsprivate SitemapContext_sitemapprivate SiteContext_sitesprivate boolean_tagAutopostingprivate List<String>_tagIds
-
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 booleanequals(Object obj)SearchContext.ContextLangAndCurrentLanggetContextLang(String currentLang)Gets theContextLangand the current langQuerygetSitemapQuery(Page currentPage)Gets the query corresponding to the sitemap part of the contextQuerygetSiteQuery(Site currentSite)Gets the query corresponding to the site part of the contextQuerygetTagQuery()Gets the query corresponding to the tag part of the contextinthashCode()ContextLanglangContext()Gets the lang contextSiteContextsiteContext()Gets the site contextSitemapContextsitemapContext()Gets the sitemap contextPair<List<String>,Boolean>tagContext()Gets the tag context
-
-
-
Field Detail
-
_sites
private SiteContext _sites
-
_sitemap
private SitemapContext _sitemap
-
_langs
private ContextLang _langs
-
_tagAutoposting
private boolean _tagAutoposting
-
-
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-trueif 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 theContextLangand the current lang- Parameters:
currentLang- The current lang- Returns:
- the wrapper of the
ContextLangand 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
-
-