use of org.hisp.dhis.dxf2.events.trackedentity.store.query.EventQuery.COLUMNS.DELETED in project dhis2-core by dhis2.
the class DataValueSetServiceIntegrationTest method testImportAndDeleteValuesXml.
/**
* Import 12 data values. Then import 12 values where 4 are marked as
* deleted, 6 are updates and 2 are new.
*/
@Test
void testImportAndDeleteValuesXml() {
assertDataValuesCount(0);
in = readFile("datavalueset/dataValueSetB.xml");
ImportSummary summary = dataValueSetService.importDataValueSetXml(in);
assertEquals(12, summary.getImportCount().getImported());
assertDataValuesCount(12);
// Delete 4 values, add 2 values
in = readFile("datavalueset/dataValueSetBNewDeleted.xml");
summary = dataValueSetService.importDataValueSetXml(in);
assertSuccessWithImportedUpdatedDeleted(2, 6, 4, summary);
assertDataValuesCount(10);
}
use of org.hisp.dhis.dxf2.events.trackedentity.store.query.EventQuery.COLUMNS.DELETED in project dhis2-core by dhis2.
the class AppController method deleteApp.
@DeleteMapping("/{app}")
@PreAuthorize("hasRole('ALL') or hasRole('M_dhis-web-app-management')")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteApp(@PathVariable("app") String app, @RequestParam(required = false) boolean deleteAppData) throws WebMessageException {
App appToDelete = appManager.getApp(app);
if (appToDelete == null) {
throw new WebMessageException(notFound("App does not exist: " + app));
}
if (appToDelete.getAppState() == AppStatus.DELETION_IN_PROGRESS) {
throw new WebMessageException(conflict("App is already being deleted: " + app));
}
appManager.markAppToDelete(appToDelete);
appManager.deleteApp(appToDelete, deleteAppData);
}
Aggregations