#420 closed enhancement (fixed)
Sample count report should have two columns for summed data
Reported by: | olle | Owned by: | olle |
---|---|---|---|
Priority: | major | Milestone: | Reggie v2.9 |
Component: | net.sf.basedb.reggie | Keywords: | |
Cc: |
Description (last modified by )
The sample count report currently have a rightmost column named "Grand total" for the summed sample counts per site for the selected time period. This column should change name to "Sum".
In addition, a new column named "Total" should be added to the right of the "Sum" column, for the total number of samples per site, including samples created at a time outside the selected time period. This number should also include samples without known creation date.
Change History (11)
comment:1 by , 12 years ago
Type: | Request → enhancement |
---|
comment:3 by , 12 years ago
Description: | modified (diff) |
---|
Ticket description updated regarding clarification that the 'Total' column should show number of samples per site, regardless of when the samples were created (or if the creation date is unknown).
comment:4 by , 12 years ago
Traceability note:
- The report generator was introduced in Ticket #339 (Report generator).
comment:5 by , 12 years ago
Design discussion:
Data for the report is collected by servlet SampleReportServlet
in reggie/src/net/sf/basedb/reggie/servlet/
, while the table presentation is created by JSP script samplereportgenerator
in reggie/resources/
. Currently, however, the data for the summed values for each site and all sites together are calculated by the JSP script. The servlet uses restrictions for the database query to only get items for the selected time period.
Design of new feature for extra table column with data regardless of creation date:
- It was decided to perform most of the calculations in the servlet. Servlet
SampleReportServlet
will therefore be updated to calculate the summed values for each site and all sites together and insert the values in JSON objectsjsonSite
andjsonStatistics
with keys "sumSiteKey
" and "sumKey
", respectively. - Servlet
SampleReportServlet
will be modified to not set any date restrictions on the database query, but to perform this comparison in the java code for the main table data. In addition, data for all sites regardless of creation date is collected and inserted in JSON objectsjsonSite
andjsonStatistics
with keys "totalSiteKey
" and "totalKey
", respectively. - JSP script
samplereportgenerator
will be updated to get the values for summed data from the JSON objects obtained from the servlet. Column "Grand total
" is renamed "Sum
", and a new column named "Total
" is added to the right of the latter for data regardless of creation date.
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:7 by , 12 years ago
Design update:
The displayed combined values for all sites for each time period are still calculated by the JSP script. These values should also be calculated by the servlet and transferred to the JSP script for display.
Update of servlet SampleReportServlet
:
- The servlet should be updated to calculate the combined values for all sites and insert them in JSON object
jsonSitesCombined
with key "sitesCombinedKey
". The initial values should be 0 for periods ending after the earliest date one of the sites joined the project, andnull
for earlier periods. The latter entries should be displayed as a blank in the table. - In order to achieve the new functionality, a number of new convenience methods will be added,
Date fetchEarliestSiteStartDate()
,List<Date> createSortedPeriodEndDateList(...)
,List<Date> createSortedPeriodStartDateList(...)
, andJSONObject initializeJSONPeriodData(...)
. - In order to prepare for further functionality of the sample report servlet, the sample count code should be refactored into a number of new methods,
JSONObject sampleCountReport(...)
,JSONObject createJSONStatistics(...)
, andJSONObject updateJSONObjectCounter(...)
.
Update of JSP script samplereportgenerator
:
- The script should be updated to obtain the combined values for all sites from the servlet via JSON object
jsonSitesCombined
with key "sitesCombinedKey
". - In order to ensure correct display of the combined values, new functions
getJsonData(jsonObject, key)
andcreateSortedPeriodArray(report, numberOfColumns)
will be added.
Type changed from Request to enhancement.