Jump to: navigation, search

SMILA/Project Concepts/Record Filter Concept

< SMILA‎ | Project Concepts
Revision as of 09:02, 12 August 2008 by Juergen.schumacher.empolis.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Record Filter Specification

Description

Record filtering can be useful in different parts of the system

Therefore it should be provided as a generic functionality of the data model. Then we can

  • provide a set of named record filter definition in a central place.
  • refer to the names of record filters to be used in router and workflow engine configurations.
  • both use the common code to actually do the filtering

Discussion

Technical Proposal

An initial record filter definition could consist of the following parts:

  • Name: Unique name of the filter for reference in using components (Router or workflow engine configuration)
  • List of attribute names: attributes to be kept in the filtered object. Additionaly a flag could determine if annotations are to be copied, too. In an initial implementtation it would be sufficient to have only top-level attributes here which means that the whole attribute tree with this name would be copied to the filtered object. It could be extended later to support attribute paths to specify filtering of sub-objects only.
  • List of annotation names: names of top level annotations of the record to be kept in filtered objects.

Example:

<RecordFilters>
  <Filter name="example">
    <Attribute name="Mimetype"/>
    <Attribute name="Filesize"/>
    <Attribute name="Keywords" keepAnnotations="true"/> <!-- default is false -->
    <Annotation name="action"/>
  </Filter>
  <!-- more filters -->
</RecordFilters>

Using "*" as a wildcard for "all names" could ease definition of a filter that copies all attributes or annotations:

<RecordFilters>
  <Filter name="all-attributes-no-anntations">
    <Attribute name="*"/>
  </Filter>
  <Filter name="top-level-annotations-only">
    <Annotation name="*"/>
  </Filter>
</RecordFilters>


The Record Filter function is

Record filter(Record completeRecord)

We could also provide the RecordFilter as a service (to discuss).

Record filter(String filterName, Record completeRecord)

In each case the function would create a copy of the record containing only those attributes and annotations described by the filter definition.