Class ContextQueriesWrapper
- java.lang.Object
-
- org.ametys.web.frontoffice.search.metamodel.context.ContextQueriesWrapper
-
public class ContextQueriesWrapper extends Object
A wrapper ofqueriesabout a search context.
UsegetQuery(java.util.Collection<org.ametys.web.frontoffice.search.metamodel.context.ContextQueriesWrapper>, java.util.Optional<java.util.function.Function<org.ametys.cms.search.query.Query, org.ametys.cms.search.query.Query>>, java.util.Optional<java.util.function.Function<org.ametys.cms.search.query.Query, org.ametys.cms.search.query.Query>>, java.util.Optional<org.ametys.web.frontoffice.search.instance.model.SearchContext.LangQueryProducer>, java.util.Optional<java.util.function.Function<org.ametys.cms.search.query.Query, org.ametys.cms.search.query.Query>>)byReturnables in order to choose the part for each Context theReturnablecares about (by passing anempty optionalor ajoiner/producer) and transform it to aQuery.
-
-
Field Summary
Fields Modifier and Type Field Description private SearchContext.ContextLangAndCurrentLang_contextLangAndCurrentLangprivate Query_sitemapQueryprivate Query_siteQueryprivate Query_tagQuery
-
Constructor Summary
Constructors Constructor Description ContextQueriesWrapper(Query siteQuery, Query sitemapQuery, SearchContext.ContextLangAndCurrentLang contextLangAndCurrentLang, Query tagQuery)Creates a wrapper of Context Queries (site, sitemap, lang, tag).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private Query_getQuery(Optional<Function<Query,Query>> siteQueryJoiner, Optional<Function<Query,Query>> sitemapQueryJoiner, Optional<SearchContext.LangQueryProducer> langQueryProducer, Optional<Function<Query,Query>> tagQueryJoiner)static QuerygetQuery(Collection<ContextQueriesWrapper> contextQueriesWrappers, Optional<Function<Query,Query>> siteQueryJoiner, Optional<Function<Query,Query>> sitemapQueryJoiner, Optional<SearchContext.LangQueryProducer> langQueryProducer, Optional<Function<Query,Query>> tagQueryJoiner)Gets the query corresponding to the given contexts (as a collection ofContextQueriesWrapper)
By passing anempty optionalor ajoiner/producer, you are able to choose the part of the contexts you want to ignore/take account in the generated query.
-
-
-
Field Detail
-
_siteQuery
private Query _siteQuery
-
_sitemapQuery
private Query _sitemapQuery
-
_contextLangAndCurrentLang
private SearchContext.ContextLangAndCurrentLang _contextLangAndCurrentLang
-
-
Constructor Detail
-
ContextQueriesWrapper
public ContextQueriesWrapper(Query siteQuery, Query sitemapQuery, SearchContext.ContextLangAndCurrentLang contextLangAndCurrentLang, Query tagQuery)
Creates a wrapper of Context Queries (site, sitemap, lang, tag).- Parameters:
siteQuery- The site querysitemapQuery- The sitemap querycontextLangAndCurrentLang- The wrapper ofContextLangand the current langtagQuery- The tag query
-
-
Method Detail
-
getQuery
public static Query getQuery(Collection<ContextQueriesWrapper> contextQueriesWrappers, Optional<Function<Query,Query>> siteQueryJoiner, Optional<Function<Query,Query>> sitemapQueryJoiner, Optional<SearchContext.LangQueryProducer> langQueryProducer, Optional<Function<Query,Query>> tagQueryJoiner)
Gets the query corresponding to the given contexts (as a collection ofContextQueriesWrapper)
By passing anempty optionalor ajoiner/producer, you are able to choose the part of the contexts you want to ignore/take account in the generated query.- Parameters:
contextQueriesWrappers- The wrappers ofcontext queriessiteQueryJoiner- The joiner for the site querysitemapQueryJoiner- The joiner for the sitemap querylangQueryProducer- The producer of the lang querytagQueryJoiner- The joiner for the tag query- Returns:
- the query corresponding to the given contexts
-
-