public interface TableRefFilter
where<xs:annotation> <xs:appinfo> <osd:otherFacets> <osd:tableRef> <tablePath>../catalog</tablePath> <labelPaths>/productLabel /productWeight</labelPaths> <displayKey>true</displayKey> <filter osd:class="com.foo.CatalogFilter"> <param1>...</param1> <param2>...</param2> </filter> </osd:tableRef> </osd:otherFacets> </xs:appinfo> </xs:annotation>
com.foo.CatalogFilter
is
the fully qualified name of the class that implement this interface.
The declaration may use parameters, param1
and param2
in the example,
which are are JavaBean properties of the com.foo.CatalogFilter
class.
For more information, see the JavaBean specification.
setParam1(...)
and
setParam2(...)
);setup(TableRefFilterContext)
is called on the new instance.accept(Adaptation, ValueContext)
is called each time an associated element or field is to be checked.
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Adaptation aRecord,
ValueContext currentContext)
Returns whether the specified record is included in the filter result.
|
default UserMessage |
getValidationMessage(Adaptation aRecord,
ValueContext currentContext)
Returns a validation message according to the specified context.
|
void |
setup(TableRefFilterContext context) |
String |
toUserDocumentation(Locale userLocale,
ValueContext aContext)
Returns the end-user documentation for this filter.
|
boolean accept(Adaptation aRecord, ValueContext currentContext)
When the filter is used on large collections, it is important to implement a low-computation method.
default UserMessage getValidationMessage(Adaptation aRecord, ValueContext currentContext)
This method is not called if this filter also defines a static validation message during its setup.
If this method returns null
then a default
validation message will be added at validation time if a record
is not accepted by this filter.
aRecord
- record in the target table of the foreign key constraint
that is not accepted by this filter.currentContext
- dataset or record that contains the foreign key constraint
associated to this filter.TableRefFilterContext.setFilterValidationMessage(UserMessageLocalized)
void setup(TableRefFilterContext context)
String toUserDocumentation(Locale userLocale, ValueContext aContext) throws InvalidSchemaException
This method returns null
if the specified locale is not handled by
the current implementation. The container tries several locales
when handling a partial internationalization of this method's implementation and/or
a mismatch between the locales declared by the associated module and the locales supported
by EBX®. In such cases, locales are tried in the following order:
Session.getLocaleForSchemaNode(SchemaNode)
);module.xml
;For a single instance of this interface, this method may be called concurrently by several threads.
InvalidSchemaException
- if a dynamic condition in the data model prevents the execution of this method.