use of org.n52.io.response.dataset.DatasetOutput in project series-rest-api by 52North.
the class PDFReportGenerator method generateTimeseriesMetadata.
private void generateTimeseriesMetadata() {
for (DatasetOutput metadata : getSeriesMetadatas()) {
TimeSeries timeseries = addTimeseries(metadata);
// addDataTable(timeseries, metadata, data);
addMetadata(timeseries, metadata);
}
}
use of org.n52.io.response.dataset.DatasetOutput in project series-rest-api by 52North.
the class PDFReportGenerator method addTimeseries.
private TimeSeries addTimeseries(DatasetOutput metadata) {
DocumentStructureType report = document.getDocumentStructure();
TimeSeries timeseries = report.addNewTimeSeries();
SeriesParameters parameters = metadata.getSeriesParameters();
timeseries.setFeatureOfInterestID(parameters.getFeature().getLabel());
timeseries.setPhenomenID(parameters.getPhenomenon().getLabel());
timeseries.setProcedureID(parameters.getProcedure().getLabel());
return timeseries;
}
use of org.n52.io.response.dataset.DatasetOutput in project series-rest-api by 52North.
the class RenderingHintsExtension method getExtras.
@Override
public Map<String, Object> getExtras(DatasetOutput output, IoParameters parameters) {
if (!hasExtrasToReturn(output, parameters)) {
return Collections.emptyMap();
}
if (hasSeriesConfiguration(output)) {
final StyleProperties style = createStyle(getSeriesStyle(output));
checkForBackwardCompatiblity(output, style);
return wrapSingleIntoMap(style);
} else if (hasPhenomenonConfiguration(output)) {
final StyleProperties style = createStyle(getPhenomenonStyle(output));
checkForBackwardCompatiblity(output, style);
return wrapSingleIntoMap(style);
}
LOGGER.error("No rendering style found for {} (id={})", output, output.getId());
return Collections.emptyMap();
}
use of org.n52.io.response.dataset.DatasetOutput in project series-rest-api by 52North.
the class IoStyleContext method createContextForSingleSeries.
public static IoStyleContext createContextForSingleSeries(DatasetOutput metadata, IoParameters ioConfig) {
RequestStyledParameterSet parameters = ioConfig.toStyledParameterSet();
parameters.addSeriesWithStyleOptions(metadata.getId(), ioConfig.getStyle());
return createContextWith(parameters, Collections.singletonList(metadata));
}
use of org.n52.io.response.dataset.DatasetOutput in project series-rest-api by 52North.
the class ChartIoHandler method formatTitle.
protected String formatTitle(DatasetOutput metadata, String title) {
SeriesParameters parameters = metadata.getSeriesParameters();
Object[] varargs = { // index important to reference in config!
parameters.getPlatform().getLabel(), parameters.getPhenomenon().getLabel(), parameters.getProcedure().getLabel(), parameters.getCategory().getLabel(), parameters.getOffering().getLabel(), parameters.getFeature().getLabel(), parameters.getService().getLabel(), metadata.getUom() };
try {
return String.format(title, varargs);
} catch (Exception e) {
String datasetId = metadata.getId();
LOGGER.info("Couldn't format title while prerendering dataset '{}'", datasetId, e);
// return template as fallback
return title;
}
}
Aggregations