use of org.hisp.dhis.analytics.event.EventQueryParams in project dhis2-core by dhis2.
the class EventAnalyticsController method getCountJson.
// -------------------------------------------------------------------------
// Count / rectangle
// -------------------------------------------------------------------------
@RequestMapping(value = RESOURCE_PATH + "/count/{program}", method = RequestMethod.GET, produces = { "application/json", "application/javascript" })
// JSON, JSONP
@ResponseBody
public // JSON, JSONP
Rectangle getCountJson(@PathVariable String program, @RequestParam(required = false) String stage, @RequestParam(required = false) Date startDate, @RequestParam(required = false) Date endDate, @RequestParam Set<String> dimension, @RequestParam(required = false) Set<String> filter, @RequestParam(required = false) OrganisationUnitSelectionMode ouMode, @RequestParam(required = false) Set<String> asc, @RequestParam(required = false) Set<String> desc, @RequestParam(required = false) boolean skipMeta, @RequestParam(required = false) boolean skipData, @RequestParam(required = false) boolean completedOnly, @RequestParam(required = false) boolean hierarchyMeta, @RequestParam(required = false) boolean coordinatesOnly, @RequestParam(required = false) EventStatus eventStatus, @RequestParam(required = false) ProgramStatus programStatus, @RequestParam(required = false) Integer page, @RequestParam(required = false) Integer pageSize, @RequestParam(required = false) DisplayProperty displayProperty, @RequestParam(required = false) Date relativePeriodDate, @RequestParam(required = false) String userOrgUnit, @RequestParam(required = false) String coordinateField, DhisApiVersion apiVersion, Model model, HttpServletResponse response) throws Exception {
EventQueryParams params = eventDataQueryService.getFromUrl(program, stage, startDate, endDate, dimension, filter, ouMode, asc, desc, skipMeta, skipData, completedOnly, hierarchyMeta, coordinatesOnly, eventStatus, programStatus, displayProperty, relativePeriodDate, userOrgUnit, coordinateField, page, pageSize, apiVersion);
contextUtils.configureResponse(response, ContextUtils.CONTENT_TYPE_JSON, CacheStrategy.RESPECT_SYSTEM_SETTING);
return analyticsService.getRectangle(params);
}
use of org.hisp.dhis.analytics.event.EventQueryParams in project dhis2-core by dhis2.
the class EventAnalyticsController method getQueryHtmlCss.
@PreAuthorize("hasRole('ALL') or hasRole('F_VIEW_EVENT_ANALYTICS')")
@RequestMapping(value = RESOURCE_PATH + "/query/{program}.html+css", method = RequestMethod.GET)
public void getQueryHtmlCss(@PathVariable String program, @RequestParam(required = false) String stage, @RequestParam(required = false) Date startDate, @RequestParam(required = false) Date endDate, @RequestParam Set<String> dimension, @RequestParam(required = false) Set<String> filter, @RequestParam(required = false) OrganisationUnitSelectionMode ouMode, @RequestParam(required = false) Set<String> asc, @RequestParam(required = false) Set<String> desc, @RequestParam(required = false) boolean skipMeta, @RequestParam(required = false) boolean skipData, @RequestParam(required = false) boolean completedOnly, @RequestParam(required = false) boolean hierarchyMeta, @RequestParam(required = false) boolean coordinatesOnly, @RequestParam(required = false) EventStatus eventStatus, @RequestParam(required = false) ProgramStatus programStatus, @RequestParam(required = false) Integer page, @RequestParam(required = false) Integer pageSize, @RequestParam(required = false) DisplayProperty displayProperty, @RequestParam(required = false) Date relativePeriodDate, @RequestParam(required = false) String userOrgUnit, @RequestParam(required = false) String coordinateField, DhisApiVersion apiVersion, Model model, HttpServletResponse response) throws Exception {
EventQueryParams params = eventDataQueryService.getFromUrl(program, stage, startDate, endDate, dimension, filter, ouMode, asc, desc, skipMeta, skipData, completedOnly, hierarchyMeta, coordinatesOnly, eventStatus, programStatus, displayProperty, relativePeriodDate, userOrgUnit, coordinateField, page, pageSize, apiVersion);
contextUtils.configureResponse(response, ContextUtils.CONTENT_TYPE_HTML, CacheStrategy.RESPECT_SYSTEM_SETTING, "events.html", false);
Grid grid = analyticsService.getEvents(params);
GridUtils.toHtmlCss(substituteMetaData(grid), response.getWriter());
}
Aggregations