Search in sources :

Example 1 with ResultSet

use of net.sourceforge.processdash.data.util.ResultSet in project processdash by dtuma.

the class TextReport method getResultSet.

private ResultSet getResultSet() throws IOException {
    // get the data
    retrieveParamsFromServlet("dqf");
    if (parameters.get("h0") == null)
        parameters.put("h0", "Project/Task");
    ResultSet tableData = ResultSet.get(getDataRepository(), parameters, getPrefix(), getPSPProperties());
    if (parameters.get("transpose") != null)
        tableData = tableData.transpose();
    return tableData;
}
Also used : ResultSet(net.sourceforge.processdash.data.util.ResultSet)

Example 2 with ResultSet

use of net.sourceforge.processdash.data.util.ResultSet in project processdash by dtuma.

the class TextReport method writeContents.

@Override
protected void writeContents() throws IOException {
    ResultSet resultSet = getResultSet();
    String format = getParameter(FORMAT_PARAM);
    if (FORMAT_XML.equals(format))
        writeXml(resultSet);
    else
        // default
        writeHtml(resultSet);
}
Also used : ResultSet(net.sourceforge.processdash.data.util.ResultSet)

Example 3 with ResultSet

use of net.sourceforge.processdash.data.util.ResultSet in project processdash by dtuma.

the class StudataExporter method writeContents.

protected void writeContents() throws IOException {
    StudataExporterPrefs prefs = new StudataExporterPrefs();
    if (parameters.containsKey("exportPrefs") || !prefs.isValid()) {
        prefs.writeForm(out, parameters);
        return;
    }
    List projectPaths = getProjectPaths();
    ResultSet data = ResultSet.get(getDataRepository(), parameters, "/To Date/PSP/All", getPSPProperties());
    adjustDataAndPaths(projectPaths, data);
    String studentName = getOwner();
    String forStudent = "";
    if (studentName != null)
        forStudent = " for " + HTMLUtils.escapeEntities(studentName);
    if (projectPaths.isEmpty()) {
        out.print("<html><head>");
        out.print("<title>No Student Data Found" + forStudent + "</title>");
        out.print("</head><body>\n");
        out.print("<h1>No Student Data Found" + forStudent + "</h1>\n");
        out.print("No student data was found to export" + forStudent + ". Possible reasons:<ul>\n");
        out.print("<li>The student has not logged time to any of their " + "PSP assignments.</li>\n");
        out.print("<li>The student has edited their hierarchy, and their " + "PSP program assignments are not located underneath " + HTMLUtils.escapeEntities(getPrefix()) + "</li>\n");
        out.print("</ul></body></html>\n");
    } else if (performExport(prefs, projectPaths, data)) {
        out.print("<html><head>");
        out.print("<title>Exported Student Data" + forStudent + "</title>");
        out.print("</head><body>\n");
        out.print("<h1>Exported Student Data" + forStudent + "</h1>\n");
        out.print(prefs.getHeaderMessage());
        out.print("<ul>\n");
        for (Iterator i = projectPaths.iterator(); i.hasNext(); ) {
            String path = (String) i.next();
            out.print("<li>" + HTMLUtils.escapeEntities(path) + "</li>\n");
        }
        out.print("</ul>\n");
        out.print(prefs.getFooterMessage());
        out.print("<hr><p><a href='studata?exportPrefs'>Export " + "options...</a></p>");
        out.print("</body></html>\n");
    }
}
Also used : ResultSet(net.sourceforge.processdash.data.util.ResultSet) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List)

Example 4 with ResultSet

use of net.sourceforge.processdash.data.util.ResultSet in project processdash by dtuma.

the class PlanAnalysisPage method getActualSize.

@//
Chart(//
id = "size", //
type = "line", //
params = "units", titleKey = "Plan.Size_Title_FMT")
public ResultSet getActualSize(ChartData chartData) {
    String units = chartData.chartArgs[0];
    ResultSet data = chartData.getEnactmentResultSet(1);
    data.setColName(1, units);
    for (int row = data.numRows(); row > 0; row--) {
        Enactment e = (Enactment) data.getRowObj(row);
        data.setData(row, 1, num(e.actualSize(units)));
    }
    return data;
}
Also used : Enactment(net.sourceforge.processdash.tool.db.WorkflowHistDataHelper.Enactment) ResultSet(net.sourceforge.processdash.data.util.ResultSet)

Example 5 with ResultSet

use of net.sourceforge.processdash.data.util.ResultSet in project processdash by dtuma.

the class PlanAnalysisPage method getEstErrorScatterChart.

@//
Chart(//
id = "estErrScatter", //
type = "estErrorScatter", //
params = "units", titleKey = "EstErrorScatterChart.Title", format = "skipUnitsCol=t")
public ResultSet getEstErrorScatterChart(ChartData chartData) {
    ResultSet data = chartData.getEnactmentResultSet(//
    "Plan.Size_Scatter_Plan_FMT", //
    "Plan.Size_Scatter_Actual_FMT", //
    "EstErrorScatterChart.Size_Est_Error", //
    "Plan.Time_Scatter_Plan", //
    "Plan.Time_Scatter_Actual", "EstErrorScatterChart.Time_Est_Error");
    data.setFormat(3, "100%");
    data.setFormat(6, "100%");
    String units = chartData.chartArgs[0];
    for (int row = data.numRows(); row > 0; row--) {
        Enactment e = (Enactment) data.getRowObj(row);
        double planSize = chartData.histData.getSize(e, units, false);
        double actualSize = e.actualSize(units);
        double sizeErr = (actualSize - planSize) / planSize;
        data.setData(row, 1, num(planSize));
        data.setData(row, 2, num(actualSize));
        data.setData(row, 3, num(sizeErr));
        double planTime = chartData.histData.getTime(e, null, false);
        double actualTime = e.actualTime();
        double timeErr = (actualTime - planTime) / planTime;
        data.setData(row, 4, num(planTime / 60));
        data.setData(row, 5, num(actualTime / 60));
        data.setData(row, 6, num(timeErr));
    }
    return data;
}
Also used : Enactment(net.sourceforge.processdash.tool.db.WorkflowHistDataHelper.Enactment) ResultSet(net.sourceforge.processdash.data.util.ResultSet)

Aggregations

ResultSet (net.sourceforge.processdash.data.util.ResultSet)57 Enactment (net.sourceforge.processdash.tool.db.WorkflowHistDataHelper.Enactment)11 DoubleData (net.sourceforge.processdash.data.DoubleData)5 ArrayList (java.util.ArrayList)4 ListData (net.sourceforge.processdash.data.ListData)3 DataPair (net.sourceforge.processdash.util.DataPair)3 Iterator (java.util.Iterator)2 List (java.util.List)2 Map (java.util.Map)2 PDashQuery (net.sourceforge.processdash.api.PDashQuery)2 PhaseType (net.sourceforge.processdash.tool.db.WorkflowHistDataHelper.PhaseType)2 IOException (java.io.IOException)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 ServletException (javax.servlet.ServletException)1 DataContext (net.sourceforge.processdash.data.DataContext)1 StringData (net.sourceforge.processdash.data.StringData)1