Brian Moseley wrote:
when filtering fails for some reason (say icalendar parsing fails),
i'd like the PUT request to fail. in other words, the repository
should communicate to the dav layer that indexing failed. but because
indexing is implemented as an observation event, it doesn't appear
that there is a regular code path that does what i want.
IMO, this should be handled by the application and not the repository. A
repository might allow to set constraints on the a binary property, but
this would be independent of indexing that property.
tobi already mentioned that such a feature could be implemented with
something like a custom filter. but again that would be on a higher
level. and not deep down in the index.
one idea is to throw a specific runtime exception from the text filter
and catch it in the layer that calls node.save(). that layer would
have to explicitly remove the node upon catching the indexing
exception.
there are several questions that arise:
- will a transaction fail if this happens?
- observation is triggered after changes are made persistent, we would
need to roll them back in some way. the current persistent manager api
does not allow that.
regards
marcel