franta-hg@1: package de.laures.cewolf.dp; franta-hg@1: franta-hg@1: import java.io.Serializable; franta-hg@1: import java.util.Date; franta-hg@1: import java.util.Map; franta-hg@1: franta-hg@1: import de.laures.cewolf.DatasetProduceException; franta-hg@1: import de.laures.cewolf.DatasetProducer; franta-hg@1: franta-hg@1: /** franta-hg@1: * @author glaures franta-hg@1: * franta-hg@1: * To change this generated comment edit the template variable "typecomment": franta-hg@1: * Window>Preferences>Java>Templates. franta-hg@1: * To enable and disable the creation of type comments go to franta-hg@1: * Window>Preferences>Java>Code Generation. franta-hg@1: */ franta-hg@1: public class DataSourceXYDatasetProducer implements DatasetProducer, Serializable { franta-hg@1: franta-hg@1: public static final String PARAM_SERIES_LIST = "series"; franta-hg@1: franta-hg@1: /** franta-hg@1: * @see de.laures.cewolf.DatasetProducer#produceDataset(Map) franta-hg@1: */ franta-hg@1: public Object produceDataset(Map params) throws DatasetProduceException { franta-hg@1: /* franta-hg@1: DataSourceXYSeries series = new DataSourceXYSeries("select * from xy;"); franta-hg@1: XYSeriesCollection dataset = new XYSeriesCollection(); franta-hg@1: try { franta-hg@1: DataSource ds = getDataSource((String)params.get(PARAM_DATASOURCE)); franta-hg@1: dataset.addSeries(series.produceXYSeries(ds)); franta-hg@1: } catch (NamingException nEx) { franta-hg@1: nEx.printStackTrace(); franta-hg@1: throw new DatasetProduceException(nEx.getMessage()); franta-hg@1: } franta-hg@1: */ franta-hg@1: return null; franta-hg@1: } franta-hg@1: franta-hg@1: /** franta-hg@1: * @see de.laures.cewolf.DatasetProducer#hasExpired(Map, Date) franta-hg@1: */ franta-hg@1: public boolean hasExpired(Map params, Date since) { franta-hg@1: return true; franta-hg@1: } franta-hg@1: franta-hg@1: /** franta-hg@1: * @see de.laures.cewolf.DatasetProducer#getProducerId() franta-hg@1: */ franta-hg@1: public String getProducerId() { franta-hg@1: return toString(); franta-hg@1: } franta-hg@1: franta-hg@1: }