use of org.activityinfo.store.query.server.Updater in project activityinfo by bedatadriven.
the class ResourceLocatorSyncImpl method persist.
@Override
public void persist(FormInstance formInstance) {
Updater updater = new Updater(catalog.get(), authenticatedUser.get().getUserId(), blobAuthorizer, new HrdSerialNumberProvider());
updater.execute(formInstance);
}
use of org.activityinfo.store.query.server.Updater in project activityinfo by bedatadriven.
the class ActivityInfoClientAsyncStub method updateRecord.
@Override
public Promise<Void> updateRecord(String formId, String recordId, FormRecordUpdateBuilder query) {
try {
FormStorageProvider catalog = newCatalog();
Updater updater = new Updater(catalog, currentUserId(), blobAuthorizer, new SerialNumberProviderStub());
updater.execute(ResourceId.valueOf(formId), ResourceId.valueOf(recordId), query.toJsonObject());
return Promise.resolved(null);
} catch (Exception e) {
return Promise.rejected(e);
}
}
use of org.activityinfo.store.query.server.Updater in project activityinfo by bedatadriven.
the class TestingStorageProvider method updateRecords.
public void updateRecords(RecordTransaction transaction) {
Updater updater = new Updater(this, 1, new BlobAuthorizerStub(), serialNumberProvider);
updater.execute(transaction);
}
use of org.activityinfo.store.query.server.Updater in project activityinfo by bedatadriven.
the class MySqlUpdateTest method updateAdminEntity.
@Test
public void updateAdminEntity() throws JsonMappingException {
RecordUpdate changeObject = new RecordUpdate();
changeObject.setRecordId(entity(21).asString());
changeObject.setFormId(adminLevelFormClass(2).asString());
changeObject.setFieldValue("name", "Nouveau Irumu");
Updater updater = updater();
updater.setEnforcePermissions(false);
updater.executeChange(changeObject);
query(adminLevelFormClass(2), "_id", "name");
assertThat(column("_id"), hasValues("z0000000010", "z0000000011", "z0000000012", "z0000000013", "z0000000021"));
assertThat(column("name"), hasValues("Bukavu", "Walungu", "Shabunda", "Kalehe", "Nouveau Irumu"));
}
use of org.activityinfo.store.query.server.Updater in project activityinfo by bedatadriven.
the class MySqlUpdateTest method executeUpdate.
private void executeUpdate(FormInstance creation) {
Updater updater = updater();
updater.execute(creation);
}
Aggregations