Hongbing and I hacked out a solution to the requirements presented below. I've changed the requirements a little. Instead of "ChartFileName", I'm using "ReportFileName"; I'd thought that this would be a little more general. I created a Selector for this attribute called ReportFileNameSelector in the org.hackystat.stdext.report.selector package. In addition, to actually use the ReportFileName attribute, I've added the following code the Cedric's org.hackystat.app.telemetry.analysis.TelemetryChartAnalysis class:
if (ReportTypeSelector.isType(ReportTypeSelector.CHART, request)) {
String chartFileName = ReportFileNameSelector.getFileName(request);
if (chartFileName != null && chartFileName.length() != 0) {
chartView.setJspChartAttribute(request, "Chart0", chartFileName);
}
else {
chartView.setJspChartAttribute(request, "Chart0");
}
}
else { //only SVG is possible here
chartView.setJspChartAttributeForSvg(request, "Chart0");
}
Now, someone can execute this URL < http://localhost:8080/hackystat/controller?Key=kagawaa&Project=hacky2004-all&Command=TelemetryChartAnalysis&IntervalType=Day&DayInterval.EndDay=07&DayInterval.EndMonth=04&DayInterval.EndYear=2005&DayInterval.StartDay=07&DayInterval.StartMonth=04&DayInterval.StartYear=2005&reportType=Chart&Telemetry.Selector.Selected.Chart=Churn-Chart%23%23%23Global&Telemetry.Selector.TemplateParameter=**.java,%20true&ReportFileName=something > and generated a chart (the code currenlty only supports a FileName for a Chart) with the specified file name. Note, that the TelemetryChartAnalysis does not use a Selector for the ReportFileName. Much like the recent SVG addition, you must generate an URL with the ReportFileName attribute.
I've manually tested the functionality and all appears to be ok. I've wrote a test case to TestTelemetryChartAnalysis. But, I had to take it out, because the HackystatTestConversation cannot set a parameter which isn't in the WebForm.
Cedric: by the way, you had a ProjectManager.deleteTestProject(test, projectName); Commented out, which left as test project in the testdataset user. I assume that was a mistake and I un-commented it out for you.
Cedric: In the next couple days I plan to move Hackystat-Standard to the ikayzo machine. We should be all set for our next meeting.
Any comments about this improvement?
thanks, aaron
(a) hackyReport currently generates png files with a randomly generated file name. This is good as a default behavior, but complicates things for this particular task. I propose that when sending an URL to Hackystat for chart generation purposes, there can be an optional argument called something like ChartFileName, which can allow the caller to explicitly indicate what the name of the png file is. For example, if the caller sends an URL with ChartFileName=ActiveTime.Foo.png then that name gets passed to HackyReport as the name of the file to generate. (In the event of a command that generates multiple charts, then the command can decide to insert an index into the name string prior to passing it to hackyReport, resulting in ActiveTime.Foo.1.png, ActiveTime.Foo.2.png, etc.) [I am cc'ing Hongbing to get his opinion on the hackyReport implications of this.]
