Search in sources :

Example 1 with ListFilterBuilder

use of io.vertigo.dynamo.collections.metamodel.ListFilterBuilder in project vertigo by KleeGroup.

the class SearchDynamicRegistry method createFacetedQueryDefinition.

private static FacetedQueryDefinition createFacetedQueryDefinition(final DefinitionSpace definitionSpace, final DslDefinition xdefinition) {
    final String definitionName = xdefinition.getName();
    final DtDefinition keyConceptDtDefinition = definitionSpace.resolve(xdefinition.getDefinitionLinkName("keyConcept"), DtDefinition.class);
    final List<String> dynamicFacetDefinitionNames = xdefinition.getDefinitionLinkNames("facets");
    final List<FacetDefinition> facetDefinitions = dynamicFacetDefinitionNames.stream().map(dynamicDefinitionName -> definitionSpace.resolve(dynamicDefinitionName, FacetDefinition.class)).collect(Collectors.toList());
    final String listFilterBuilderQuery = (String) xdefinition.getPropertyValue(SearchGrammar.LIST_FILTER_BUILDER_QUERY);
    final Class<? extends ListFilterBuilder> listFilterBuilderClass = getListFilterBuilderClass(xdefinition);
    final String criteriaDomainName = xdefinition.getDefinitionLinkName("domainCriteria");
    final Domain criteriaDomain = definitionSpace.resolve(criteriaDomainName, Domain.class);
    return new FacetedQueryDefinition(definitionName, keyConceptDtDefinition, facetDefinitions, criteriaDomain, listFilterBuilderClass, listFilterBuilderQuery);
}
Also used : Arrays(java.util.Arrays) ListFilter(io.vertigo.dynamo.collections.ListFilter) DtField(io.vertigo.dynamo.domain.metamodel.DtField) HashMap(java.util.HashMap) SearchIndexDefinition(io.vertigo.dynamo.search.metamodel.SearchIndexDefinition) ArrayList(java.util.ArrayList) FacetDefinition(io.vertigo.dynamo.collections.metamodel.FacetDefinition) Map(java.util.Map) Assertion(io.vertigo.lang.Assertion) KspProperty(io.vertigo.dynamo.plugins.environment.KspProperty) DslEntity(io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntity) DslGrammar(io.vertigo.dynamo.plugins.environment.dsl.entity.DslGrammar) DtDefinition(io.vertigo.dynamo.domain.metamodel.DtDefinition) Domain(io.vertigo.dynamo.domain.metamodel.Domain) DefinitionSpace(io.vertigo.core.definition.DefinitionSpace) FacetedQueryDefinition(io.vertigo.dynamo.collections.metamodel.FacetedQueryDefinition) ClassUtil(io.vertigo.util.ClassUtil) Collectors(java.util.stream.Collectors) Definition(io.vertigo.core.definition.Definition) MessageText(io.vertigo.core.locale.MessageText) List(java.util.List) ListFilterBuilder(io.vertigo.dynamo.collections.metamodel.ListFilterBuilder) DslDefinition(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition) DefinitionSupplier(io.vertigo.core.definition.DefinitionSupplier) FacetOrder(io.vertigo.dynamo.collections.metamodel.FacetDefinition.FacetOrder) FacetValue(io.vertigo.dynamo.collections.model.FacetValue) DynamicRegistry(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DynamicRegistry) DtDefinition(io.vertigo.dynamo.domain.metamodel.DtDefinition) FacetDefinition(io.vertigo.dynamo.collections.metamodel.FacetDefinition) Domain(io.vertigo.dynamo.domain.metamodel.Domain) FacetedQueryDefinition(io.vertigo.dynamo.collections.metamodel.FacetedQueryDefinition)

Aggregations

Definition (io.vertigo.core.definition.Definition)1 DefinitionSpace (io.vertigo.core.definition.DefinitionSpace)1 DefinitionSupplier (io.vertigo.core.definition.DefinitionSupplier)1 MessageText (io.vertigo.core.locale.MessageText)1 ListFilter (io.vertigo.dynamo.collections.ListFilter)1 FacetDefinition (io.vertigo.dynamo.collections.metamodel.FacetDefinition)1 FacetOrder (io.vertigo.dynamo.collections.metamodel.FacetDefinition.FacetOrder)1 FacetedQueryDefinition (io.vertigo.dynamo.collections.metamodel.FacetedQueryDefinition)1 ListFilterBuilder (io.vertigo.dynamo.collections.metamodel.ListFilterBuilder)1 FacetValue (io.vertigo.dynamo.collections.model.FacetValue)1 Domain (io.vertigo.dynamo.domain.metamodel.Domain)1 DtDefinition (io.vertigo.dynamo.domain.metamodel.DtDefinition)1 DtField (io.vertigo.dynamo.domain.metamodel.DtField)1 KspProperty (io.vertigo.dynamo.plugins.environment.KspProperty)1 DslDefinition (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition)1 DynamicRegistry (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DynamicRegistry)1 DslEntity (io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntity)1 DslGrammar (io.vertigo.dynamo.plugins.environment.dsl.entity.DslGrammar)1 SearchIndexDefinition (io.vertigo.dynamo.search.metamodel.SearchIndexDefinition)1 Assertion (io.vertigo.lang.Assertion)1