tag is what does it through the
cewolf servlet. Thus, since there is only one instance for each MetaDatasetProducer
configuration, if multiple requests come in for a page at the same time with different data (or
you try to draw two charts on the same page with the same MetaDatasetProducer), if you pre-set
the data, whatever was the last object set will be used to generate all the charts.
A workaround to this could be to store data in an internal map and pass the key to the data as
the parameter to produceDataset
so that it knows which set to work with. Once
rendered, the class would just remove the data from the map. This would be useful if the data was
not Serializable and so could not be passed as a parameter.
- Version:
- $Revision: 1.13 $
- Author:
- esword
- See Also:
- Serialized Form
Fields inherited from interface de.laures.cewolf.DatasetProducer |
PRODUCER_ATTRIBUTE_NAME |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final Log log
PARAM_DATA
public static final java.lang.String PARAM_DATA
- Common key value for the main data list that will be worked on when passed in the params
map to produceDataset.
- See Also:
- Constant Field Values
PARAM_EXISTING_DATASET
public static final java.lang.String PARAM_EXISTING_DATASET
- Common key value for any existing data set which should be added to rather than creating
an entirely new one
- See Also:
- Constant Field Values
producerId
protected java.lang.String producerId
dataObjectClass
protected java.lang.String dataObjectClass
seriesNameProperty
protected java.lang.String seriesNameProperty
addValues
protected boolean addValues
filteredSeries
protected java.util.List filteredSeries
defaultSeriesName
protected java.lang.String defaultSeriesName
storeOriginalData
protected boolean storeOriginalData
dataMetaClass
protected MetaClass dataMetaClass
dataClassIsMetaClass
protected boolean dataClassIsMetaClass
MetaDatasetProducer
public MetaDatasetProducer()
init
protected void init()
throws java.lang.Exception
- Validates input settings, sets up dynamic time unit classes, and creates data meta class.
- Throws:
java.lang.Exception
getMetaObject
public static MetaObject getMetaObject(java.lang.Object dataObject)
- Creates a MetaObject from the parameter. If the parameter is already a MetaObject, just
return it.
- Parameters:
dataObject
-
findOrCreateMetaClass
public static MetaClass findOrCreateMetaClass(java.lang.Object dataObject)
- Find or create a meta class for the given class of object.
- Parameters:
dataObject
-
createMetaObject
public MetaObject createMetaObject()
- Create a new metaObject using the default data
MetaClass
.
getPropertyValue
public java.lang.Object getPropertyValue(MetaObject obj,
java.lang.String propName)
- Retrieve a value for a meta-object's property. The property could potentially be "nested" -
it could be the property of a property of the object.
- Returns:
- the encoded value if successful or
null
if the value cannot be
retrieved or an error occurs.
produceDataset
public abstract java.lang.Object produceDataset(java.util.Map params)
throws de.laures.cewolf.DatasetProduceException
- Specified by:
produceDataset
in interface de.laures.cewolf.DatasetProducer
- Throws:
de.laures.cewolf.DatasetProduceException
- See Also:
DatasetProducer.produceDataset(java.util.Map)
produceDataset
public java.lang.Object produceDataset(java.util.List dataList)
throws de.laures.cewolf.DatasetProduceException
- Throws:
de.laures.cewolf.DatasetProduceException
produceDataset
public java.lang.Object produceDataset(java.util.List dataList,
org.jfree.data.general.Dataset existingData)
throws de.laures.cewolf.DatasetProduceException
- Throws:
de.laures.cewolf.DatasetProduceException
getOriginalData
public java.lang.Object getOriginalData(org.jfree.chart.entity.ChartEntity entity)
- Attempts to retrieve the object in the datalist that corresponds to the ChartEntity. This
routine will only work if
setStoreOriginalData(boolean)
is true
.
- Parameters:
entity
- Normally, an item indicating where a user clicked in the chart accorsing to
series, X/Y value or category value. A "non-data" entity (like a
LegendItemEntity
) could also be passed in, but in that case the
routine will return a null.
- Returns:
- The corresponding data object or null if a match can't be made.
hasExpired
public boolean hasExpired(java.util.Map params,
java.util.Date since)
- Specified by:
hasExpired
in interface de.laures.cewolf.DatasetProducer
- See Also:
DatasetProducer.hasExpired(java.util.Map, java.util.Date)
getProducerId
public java.lang.String getProducerId()
- Specified by:
getProducerId
in interface de.laures.cewolf.DatasetProducer
- See Also:
DatasetProducer.getProducerId()
setProducerId
public void setProducerId(java.lang.String id)
- Unique ID for this object
- Parameters:
id
- The id to set.- See Also:
DatasetProducer.getProducerId()
getDataObjectClass
public java.lang.String getDataObjectClass()
- Returns:
- Returns the dataType.
setDataObjectClass
public void setDataObjectClass(java.lang.String dataObjectClass)
- Parameters:
dataObjectClass
- The dataObjectClass to set.
getSeriesNameProperty
public java.lang.String getSeriesNameProperty()
- Returns:
- Returns the seriesNameProperty.
getFilteredSeries
public java.util.List getFilteredSeries()
- Returns:
- Returns the filteredSeries.
setSeriesNameProperty
public void setSeriesNameProperty(java.lang.String seriesNameProperty)
- Parameters:
seriesNameProperty
- The seriesNameProperty to set.
setFilteredSeries
public void setFilteredSeries(java.util.List filteredSeries)
- Parameters:
filteredSeries
- The filteredSeries to set.
isAddValues
public boolean isAddValues()
- If true, when adding a data item to a series, the producer will first check to see if
data already exists for the corresponding domain value (XYPlots) or category (CategoryPlots).
If data does exist, the producer will add the new value to the existing value rather than
replace it. This allows users to produce charts that summarize information in datasets, such
as how many datapoints there were in a certain period. Default is true.
- Returns:
- Returns the addValues.
setAddValues
public void setAddValues(boolean addValues)
- Parameters:
addValues
- The addValues to set.
getDefaultSeriesName
public java.lang.String getDefaultSeriesName()
- If no
seriesNameProperty
is set, all data items will be placed in a single
series with the name "Default Series." This name may be overriden by setting this property.
- Returns:
- Returns the defaultSeriesName.
setDefaultSeriesName
public void setDefaultSeriesName(java.lang.String defaultSeriesName)
- Parameters:
defaultSeriesName
- The defaultSeriesName to set.
getStoreOriginalData
public boolean getStoreOriginalData()
- Set to true if the object that was the source of values for a datapoint should be stored so
that it may be retrieved with
getOriginalData(ChartEntity)
. Default is true.
- Returns:
- Returns the storeOriginalData.
setStoreOriginalData
public void setStoreOriginalData(boolean storeOriginalData)
- Parameters:
storeOriginalData
- The storeOriginalData to set.
Copyright © 2002-2003 Paul Speed. All Rights Reserved.