For the sake of performance I changed the filterExpression protocol of FilteredCollections to take two arguments, 'view' and 'uuid', instead of 'item'.

I changed most filter expressions occurring in FilterCollection instances in Chandler to filter the item without loading it, by using the findValue() or findValues() APIs I recently added on RepositoryView which make it possible to retrieve one or more item values from an item without loading it.

There are limitations to these view-based APIs, namely, they only return local values and don't evaluate references or load ref collections as such returning their UUID only instead.

If the filter expression needs value inheriting, say via defaultValue, redirectTo or inheritFrom, these APIs won't work either and the item needs to be loaded. I left around a few filter expressions to work with the full item, replacing the 'item' variable with 'view[uuid]'.

I also removed the regular expression processing of filter expressions as it was non-deterministic, brittle and redundant anyway since we all have been diligent in declaring the attribute names that could cause a change in a filter expression's return value. I made the FilteredCollection register thee names for 'set' and 'remove' monitors, making their behaviour more predictable. Beware that 'remove' monitors get called when a value is removed, which tends to happen during item stamping and deletion.

See the FilterCollection examples in parcels/osaf/pim/__init__.py for examples.

Andi..
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to