Package com.orchestranetworks.schema
Interface TableRefFilterContext
- All Superinterfaces:
DependenciesDefinitionContext
,SchemaNodeContext
Provides methods for setting up a
TableRefFilter
in the context of its data model.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFilterErrorMessage
(String anErrorMessage) Adds a static non-localized error message to this filter.void
addFilterErrorMessage
(String anErrorMessage, Locale aLocale) Adds a static localized error message to this filter.void
setFilterForSearch
(String anXPathPredicate) Specifies an XPath filter that will be applied in the user interface to perform a search on the associated foreign key field.void
setFilterValidationMessage
(UserMessageLocalized aUserMessage) Sets a static validation message on this filter.void
setPrefilter
(String anXPathPredicate) Specifies an XPath filter that will be applied before evaluatingTableRefFilter.accept(Adaptation, ValueContext)
.Methods inherited from interface com.orchestranetworks.schema.DependenciesDefinitionContext
addDependencyToInsertAndDelete, addDependencyToInsertAndDelete, addDependencyToInsertAndDeleteInOtherInstance, addDependencyToInsertAndDeleteInOtherInstance, addDependencyToInsertDeleteAndModify, addDependencyToInsertDeleteAndModify, addDependencyToInsertDeleteAndModifyInOtherInstance, addDependencyToInsertDeleteAndModifyInOtherInstance, addDependencyToInsertDeleteAndModifyInOtherInstance, addDependencyToInsertDeleteAndModifyInOtherInstance, addDependencyToModify, addDependencyToModify
Methods inherited from interface com.orchestranetworks.schema.SchemaNodeContext
addError, addError, addInfo, addMessage, addWarning, getSchemaNode
-
Method Details
-
addFilterErrorMessage
Adds a static localized error message to this filter. This localized error message will be displayed to the end user at validation time if a record is not accepted by this filter.- Throws:
IllegalStateException
- if a validation message has already been set using the methodsetFilterValidationMessage(UserMessageLocalized)
.- See Also:
-
addFilterErrorMessage
Adds a static non-localized error message to this filter. This error message will be used by default and will be displayed to the end user at validation time if no error messages are defined for a given locale.- Throws:
IllegalStateException
- if a validation message has already been set using the methodsetFilterValidationMessage(UserMessageLocalized)
.- See Also:
-
setFilterValidationMessage
Sets a static validation message on this filter. This message will be displayed to the end user at validation time if a record is not accepted by this filter.This method also allows specifying the severity of the message added at validation time if a record is not accepted by this filter.
- Throws:
IllegalStateException
- if a default or localized error message has already been set using the methodaddFilterErrorMessage(String)
oraddFilterErrorMessage(String, Locale)
.- See Also:
-
setFilterForSearch
Specifies an XPath filter that will be applied in the user interface to perform a search on the associated foreign key field. The result displayed in the combo-box used to perform a search in the user interface will only include the records which satisfy the specified filter.- Throws:
IllegalArgumentException
-- if the specified predicate is
null
; - if the specified predicate contains contextual criterion (such as
${../aField}
); - if the specified predicate is invalid.
- if the specified predicate is
- Since:
- 5.8.1
-
setPrefilter
Specifies an XPath filter that will be applied before evaluatingTableRefFilter.accept(Adaptation, ValueContext)
. The prefilter- must be consistent with
TableRefFilter.accept(Adaptation, ValueContext)
, i.e., it must evaluate to true for all records where theaccept
method returnstrue
. - may not use parameters.
- should be selective, i.e., it should evaluate to true only for a relatively small part of the records of the table where the filter is applied on.
- should be "index-friendly" for best performance, i.e.,
it should be evaluated using indexes only. This can be checked by activating the debug level of the
request log and executing the request created by
SchemaFacetTableRef.getTableRefRequest(Adaptation)
. The logged physical plan should have a Lucene scan operation with a filter corresponding to the specified prefilter.
The prefilter is applied in all contexts except for the advanced search, where
setFilterForSearch(String)
has to be used. The prefilter predicate may use contextual values, as defined in the supported XPath syntax.- Throws:
IllegalArgumentException
-- if the specified predicate is
null
; - if the specified predicate contains a contextual criterion (such as
${../aField}
); - if the specified predicate is invalid.
- if the specified predicate is
- Since:
- 6.2
- See Also:
- must be consistent with
-