File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes cewolf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "cewolf" Watch "cewolf" New topic
Author

cewolf

Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18
A DatasetProducer is supposed to generate the same data when passed in the same paramters. So Cewolf returns a cached instance of a chart if there is no change in parameters.

my question is "where the cewolf checks the previous chart image?"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
What do you mean by "where" - where in the cewolf source code? Check out the classes in the de.laures.cewolf.storage package.


Ping & DNS - my free Android networking tools app
Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18
"where" means where the cewolf stores the chart id ?like "session or cache or file"


when we refresh the page the cewolf loads the chart... from where it loads the chart?



could anyone tell the working of cewolf in loading the charts?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
ewolf has several options, amongst them server sessions and files. You can select the one to be used as a servlet init parameter in the web.xml file. The source code of the classes I pointed you to are probably the best documentation available on this.

Not sure what you mean by "where it loads the chart" - it loads it from wherever it stored it, assuming that it got stored in the first place.
Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18

what is the use of "hasExpired" and "getProducerId" methods in datasetProducer interface?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
Those method have javadoc comments - what didn't you understand about those?
Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18
i wrote a struts application to display the charts using cewolf...
the datas needed for the chart is fetch from the database and the charts are displayed....

and when we refresh the page the name of the chart does not change(means the previously displayed chart is again loaded)

Example:first time the chart is loaded and name is "cewolf;jsessionid=85BFCF136F756353724AF93C6A22FC3F?img=-666842058&width=200&height=125&iehack=.png"
and when i refresh the page the same is loaded namely "cewolf;jsessionid=85BFCF136F756353724AF93C6A22FC3F?img=-666842058&width=200&height=125&iehack=.png"

how it possible?
my guess is
when we refresh the page cewolf produce another chart image, isn't it?

my guessing is correct or wrong?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
Probably. Did you implemented hasExpired and getProducerId properly so they return the correct values? Is hasExpired being called?
Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18
yes "hasExpired" is called........

but how it returns the same image?



when we refresh the page,
if there is a change in database it produces a new chart image(EXAMPLE: the chart id is different"......?img=123345323&width=200&height=125&iehack=.png")
otherwise it loads the same image("cewolf;jsessionid=85BFCF136F756353724AF93C6A22FC3F?img=-666842058&width=200&height=125&iehack=.png")

how it works?

i need the working principle of cewolf...............
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
I'm not sure what you're asking. Yes, if the data changes and the methods hasExpired and getProducerId are properly implemented, then a new chart is generated; otherwise not. If you're asking how that works on the code level (which is irrelevant to a user of the taglib), I suggest to dig into the source code.
Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18
" if the data changes and the methods hasExpired and getProducerId are properly implemented, then a new chart is generated; otherwise not."
if we reload the page, what will happen new chart or not(old chart from session)?


how the chart image is stored in session(as object or image)? and when we request for the chart how it renders?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
Before I forget, you need to fix your display name to comply with the naming policy. Please do that prior to your next post.

if we reload the page, what will happen new chart or not(old chart from session)?

The DatasetProducer will be queried whether or not a new chart should be created.

how the chart image is stored in session(as object or image)?

The chart as a org.jfree.chart.JFreeChart object, the image as a de.laures.cewolf.ChartImage object.

and when we request for the chart how it renders?

The rendering is done via the JFreeChart library.
Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18
"The DatasetProducer will be queried whether or not a new chart should be created."

To create a new chart or display the old chart the DatasetProducer must know about the previously created chart, isn't it?

how the DatasetProducer knows about the previously created chart?

from where it queried about the chart info?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41532
    
  53
how the DatasetProducer knows about the previously created chart? from where it queried about the chart info?

It's up to the DatasetProducer -i.e., your code- to determine this. That's why it gets passed the parameters and the date of the last chart generation.
Manju R Sankar
Greenhorn

Joined: Mar 14, 2012
Posts: 18
Thank you for your reply.......
 
Don't get me started about those stupid light bulbs.
 
subject: cewolf