use of org.hisp.dhis.analytics.table.AnalyticsTableType in project dhis2-core by dhis2.
the class ResourceTableController method analytics.
@RequestMapping(value = "/analytics", method = { RequestMethod.PUT, RequestMethod.POST })
@PreAuthorize("hasRole('ALL') or hasRole('F_DATA_MART_ADMIN')")
public void analytics(@RequestParam(required = false) boolean skipResourceTables, @RequestParam(required = false) boolean skipAggregate, @RequestParam(required = false) boolean skipEvents, @RequestParam(required = false) boolean skipEnrollment, @RequestParam(required = false) Integer lastYears, HttpServletResponse response, HttpServletRequest request) {
TaskId taskId = new TaskId(TaskCategory.ANALYTICSTABLE_UPDATE, currentUserService.getCurrentUser());
Set<AnalyticsTableType> skipTableTypes = new HashSet<>();
if (skipAggregate) {
skipTableTypes.add(AnalyticsTableType.DATA_VALUE);
skipTableTypes.add(AnalyticsTableType.COMPLETENESS);
skipTableTypes.add(AnalyticsTableType.COMPLETENESS_TARGET);
}
if (skipEvents) {
skipTableTypes.add(AnalyticsTableType.EVENT);
}
if (skipEnrollment) {
skipTableTypes.add(AnalyticsTableType.ENROLLMENT);
}
scheduler.executeTask(() -> analyticsTableGenerator.generateTables(lastYears, taskId, skipTableTypes, skipResourceTables));
webMessageService.send(WebMessageUtils.ok("Initiated analytics table update"), response, request);
}
Aggregations