cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@dff.st
Subject RE: [RT]: InputModules interfaces
Date Tue, 08 Oct 2002 09:17:00 GMT
Quoting Carsten Ziegeler <cziegeler@s-und-n.de>:

> Hmm, is it the responsibility of the InputModule to filter?
> Or is it rather the calling component which gets information
> from an InputModule that should filter?
> And how would you apply this filter, let's say in the sitemap?
> Or is it a configuration thing?

hm... you are right. instead of providing the filter itself we
could provide the filter name and have filter components.

Object getAttribute( String name, Map objectModel, String[] filters) throws 
  ProcessingException;

...just rethinking: we don't need filter chaining but applying
multiple filters. this way it's easy to do...

interface Filter extends Component {
  Object filter( Object input ) throws FilterException;
}

WildcardFilter implements Filter, ThreadSafe, Configurable {

  ...  

  Object filter( Object input ) throws FilterException {
    ...
  }

}

<filters>
   <component-instance class="...WildcardFilter" name="id">
      <pattern>I**</pattern>
   </component-instance>
   <component-instance class="...RegExprFilter" name="id2">
      <pattern>[0-9]+</pattern>
   </component-instance>
   ...
</filters>


 Object value = module.getAttribute( String name, Map objectModel, null)

 or with a filter

 Object value = module.getAttribute( String name, Map objectModel,
    new Filter[] { "id" }
  )

This should also be incorparated into the the request logicsheet, too

What do you guys think?
--
Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message