use of org.activityinfo.ui.client.store.http.FormChangeWatcher in project activityinfo by bedatadriven.
the class OfflineStore method getCachedMetadata.
/**
* Try to load a cached FormSchema from the offline store.
*/
public Observable<FormMetadata> getCachedMetadata(ResourceId formId) {
Observable<FormClass> schema = new ObservableTask<>(new SchemaQuery(database, formId), new FormChangeWatcher(eventBus, change -> change.isFormChanged(formId)));
Observable<FormMetadataObject> metadata = new ObservableTask<>(new MetadataQuery(database, formId), new FormChangeWatcher(eventBus, change -> change.isFormChanged(formId)));
return Observable.transform(schema, metadata, (s, m) -> FormMetadata.of(m.getVersion(), s, m.getPermissions()));
}
Aggregations