Interface SearchTemplate
-
public interface SearchTemplateThe main interface to implement for a search template.Introduction
A search template is a configuration tool that supports:
- Predefining the scope of a search.
- Assigning field-level search strategies.
Declaration
A search template must be registered and declared in the context of a ModuleSearchRegistrationContext.registerSearchTemplate(Supplier). After being registered, an instance of a search template can be accessed through its key using the
manager.Configuration
After it is registered, a
SearchTemplatemust be configured in theSearchextension of the DMA.Scope
In this extension, the data modeler associates registered search templates to table fields; these fields constitute the scope of a search template. When an end user searches according to a template, the search is restricted to the template's scope. Note that a registered but non-configured
SearchTemplatehas no scope: a search using such a template returns no result.Search strategy
The 'search' extension supports configuring instances of a search strategy and linking them to a field, in the scope of a template. When searching according to a template, each scoped field uses its corresponding strategy. If a field has no strategy defined, it uses the default strategy for its
Type. A field can belong to multiple search templates. This way, a column can be associated with many search strategies.Usage
The identifier of a search template is used as a parameter in a
Requestusingosd:searchXPath function. SeeRequest.setXPathFilter(String)- Since:
- 6.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static SearchTemplateKeydefaultKey()Returns a search template key that identifies the default template.SearchTemplateKeygetTemplateKey()Returns the identifier of the search template.UserMessagegetUserDescription()Returns the description of this template.UserMessagegetUserLabel()Returns the label of this template.
-
-
-
Method Detail
-
defaultKey
static SearchTemplateKey defaultKey()
Returns a search template key that identifies the default template.
-
getTemplateKey
SearchTemplateKey getTemplateKey()
Returns the identifier of the search template.The returned
SearchTemplateKeymust contain the current module name.Define a public Java constant holding the template key.
-
getUserLabel
UserMessage getUserLabel()
Returns the label of this template.This localized label is used mainly in the Data Model Assistant to display a user-friendly label for this extension.
-
getUserDescription
UserMessage getUserDescription()
Returns the description of this template.This localized description is used mainly in the Data Model Assistant to display a user-friendly label for this extension.
-
-