collect
collect copied to clipboard
Local entity create
- [x] Entities created in local registration form are available in local follow up form without submitting
- [x] If an entity exists both locally and on the server (an entity with matching UUID exists both locally and in the form's secondary instance entity list), the local one should be used (displayed in follow up/update forms and the entity browser)
- [x] All entity properties should be available to follow up forms
- [x] Local entity creation should be disable-able from Experimental
- [x] Local entities should still exist after killing the app and restarting
- [x] Account for form caching
Notes
One way to implement this would be to rework the FilterStrategy
API so that the children being filtered (a List
of TreeReference
) can be passed down between strategies. This would mean that Collect could add a strategy that either "expands" the secondary instance with items in the EntitiesRepository
, or just wholesale converts the EntitiesRepository
items to TreeReference
items (with some earlier preprocessing to add the secondary instance items in). This approach would not do anything to help the memory footprint of select queries (like that detailed at #5623) directly, but it would add infrastructure for Collect to "intercept" how secondary instance children are loaded which could probably be expanded on later. It might be that passing the children "lazily" (as a Supplier<List<TreeReference>>
for example) would be enough for the optimisation work in #5623 to be carried out without modifying JavaRosa - Collect could add a filter strategy that queries against a DB instead of actually using the passed (lazy) children.
If this does end up using FilterStrategy
, it'll be important to check that the chain is always used (even when there are no predicates for instance).