@RequestMapping(value = "/{timeseriesId}/{chartQualifier}",
produces = {
Constants.IMAGE_PNG
},
method = RequestMethod.GET)
public void getChartByInterval(HttpServletResponse response,
@PathVariable String timeseriesId,
@PathVariable String chartQualifier,
@RequestHeader(value = Parameters.HttpHeader.ACCEPT_LANGUAGE,
required = false) String locale,
@RequestParam(required = false) MultiValueMap<String, String> request)
throws Exception {
if (preRenderingTask == null ) {
throw new ResourceNotFoundException("Diagram prerendering is not enabled.");
}
String datasetId = ValueType.createId(ValueType.DEFAULT_VALUE_TYPE, timeseriesId);
if (!preRenderingTask.hasPrerenderedImage(datasetId, chartQualifier)) {
throw new ResourceNotFoundException("No pre-rendered chart found for timeseries '"
+ timeseriesId
+ "'.");
}
preRenderingTask.writePrerenderedGraphToOutputStream(datasetId, chartQualifier, response.getOutputStream());
}