Architecture

The dynamic facets framework consist of 5 main parts type, component, facet generator, facet component directive and the filter serviceworking with the configuration provided by an external resource (normally the tab configuration) and the data provided by the search response.



Facet Type

The facet types are configuration-based classes, every type extends from the base facet class, which holds the general behavior of the facets such as value loading, transformations and translations. Each new type can implement their own properties and overwrite default behavior, like the value loading.

Every facet type is implemented by the facet factory when it receives a configuration. Using this configuration, the facet factory will create a facet object (an instance of the type), which holds the value and behavior of the facet type. This facet object is fed with an object holding the values (for example the aggregations of a search response), the facet object will look for its corresponding field inside this response and load the value of it.

Facet Component Types

The facet components holds the behavior logic as well as the html use for each facet. Each component must extend from the abstract facet component which holds the general behaiviar logic of every facet, such as how to load the facet, and how to generate the filter for the service. The components will be implemented by the facet generator upon receiving a facet object.

Facet Generator Directive

The facet generator is in charge of the correct implementation of each dynamic facet in the user interface. It will received a facet object and  implement its respective component. 

The facet generator, if the only point interaction between the dynamic facets and the html of the user interface, any use of the dynamic facets requires to add the directive in the desired place in the html.

Facet Component

No more than a container for all the facets implemented by the facet generator.

Filter Service

This service is in charge of managing the interaction between facets, and communication with other component  such as the facet used component which displays the current filter being applied to the search and the browse breadcrumb component which used the values selected from a browse type facet to display the current path selected; both can be consider as auxiliary components, since they only interact with the service and no other part of the framework.

Configuration Sample

Dynamic Facets are only used in the Search tab, but they only required the facet configuration, which means they are not constrained to this single schema, both configuration structure and html display can be implemented in a different way, but for now, here is a sample of the current facet configuration in the Search tab.


  • No labels