Package com.orchestranetworks.schema.types.dataspace

# Interface DataspaceSetFilter

public interface DataspaceSetFilter
This interface defines a filter to accept or reject dataspaces in the context of a field of type `SchemaTypeName.OSD_DATASPACE_KEY`. This filter is called:

- when a dataspace selector widget is added in a form, user service, or UIBean.
- when validating a field of type `SchemaTypeName.OSD_DATASPACE_KEY`.

### Definition in the data model

The filter must be declared under the element `xs:annotation/xs:appinfo/osd:dataspaceSet`:

>      <filter osd:class="com.foo.MyDataspaceFilter"/>

where `com.foo.MyDataspaceFilter` is the fully qualified name of the class implementing this interface. It is also possible to set additional JavaBean properties:

>      <filter osd:class="com.foo.MyDataspaceFilter" />
>              <param1>...</param1>
>              <param2>...</param2>
>      </filter>

where `param1` and `param2` are JavaBean properties of the specified class.

For more information, see the JavaBean specification.

### Life cycle

1. When the data model is loaded:
   1. the specified class is instantiated through its default constructor and the setters of the JavaBean properties are called (in the example above, `setParam1(...)` and `setParam2(...)`);
   2. the method `setup(DataspaceSetFilterSetupContext)` is called for the new instance.
2. During the operational phase: the method `accept(HomeKey, DataspaceSetFilterContext)` is called each time an associated field has to be displayed in the user interface.

Since:
  5.8.0
See Also:
  - Data type documentation

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `accept(HomeKey aHomeKey, DataspaceSetFilterContext aContext)`
  Returns whether the specified dataspace is included in the filter result.
  `void`
  `setup(DataspaceSetFilterSetupContext aContext)`
  Checks and prepares this instance if called while the data model is being loaded.
  `String`
  `toUserDocumentation(Locale userLocale, ValueContext aContext)`
  Returns the end-user documentation for this filter.

- ## Method Details

  - ### accept

    boolean accept(HomeKey aHomeKey, DataspaceSetFilterContext aContext)
    Returns whether the specified dataspace is included in the filter result.

  - ### setup

    void setup(DataspaceSetFilterSetupContext aContext)
    Checks and prepares this instance if called while the data model is being loaded.

  - ### toUserDocumentation

    String toUserDocumentation(Locale userLocale, ValueContext aContext) throws InvalidSchemaException
    Returns the end-user documentation for this filter.

    ##### Internationalization strategy

    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 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:

    1. User's preferred locale for the data model (see `Session.getLocaleForSchemaNode(SchemaNode)`);
    2. Session's current locale;
    3. Default locale declared in the file `module.xml`;

    ##### Multi-threading

    For a single instance of this interface, this method may be called concurrently by several threads.

    Throws:
      `InvalidSchemaException` - if a dynamic condition in the data model prevents the execution of this method.