public class ContextQueriesWrapper extends Object
queries
about a search context.
getQuery(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>>)
by Returnable
s in order to choose
the part for each Context the Returnable
cares about (by passing an empty optional
or a joiner
/producer
)
and transform it to a Query
.Modifier and Type | Field and Description |
---|---|
private SearchContext.ContextLangAndCurrentLang |
_contextLangAndCurrentLang |
private Query |
_sitemapQuery |
private Query |
_siteQuery |
private Query |
_tagQuery |
Constructor and Description |
---|
ContextQueriesWrapper(Query siteQuery,
Query sitemapQuery,
SearchContext.ContextLangAndCurrentLang contextLangAndCurrentLang,
Query tagQuery)
Creates a wrapper of Context Queries (site, sitemap, lang, tag).
|
Modifier and Type | Method and Description |
---|---|
private Query |
_getQuery(Optional<Function<Query,Query>> siteQueryJoiner,
Optional<Function<Query,Query>> sitemapQueryJoiner,
Optional<SearchContext.LangQueryProducer> langQueryProducer,
Optional<Function<Query,Query>> tagQueryJoiner) |
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 of
ContextQueriesWrapper )
By passing an empty optional or a joiner /producer , you are able to choose the part
of the contexts you want to ignore/take account in the generated query. |
private Query _siteQuery
private Query _sitemapQuery
private SearchContext.ContextLangAndCurrentLang _contextLangAndCurrentLang
public ContextQueriesWrapper(Query siteQuery, Query sitemapQuery, SearchContext.ContextLangAndCurrentLang contextLangAndCurrentLang, Query tagQuery)
siteQuery
- The site querysitemapQuery
- The sitemap querycontextLangAndCurrentLang
- The wrapper of ContextLang
and the current langtagQuery
- The tag querypublic 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)
ContextQueriesWrapper
)
empty optional
or a joiner
/producer
, you are able to choose the part
of the contexts you want to ignore/take account in the generated query.contextQueriesWrappers
- The wrappers of context queries
siteQueryJoiner
- The joiner for the site querysitemapQueryJoiner
- The joiner for the sitemap querylangQueryProducer
- The producer of the lang querytagQueryJoiner
- The joiner for the tag query