Search in sources :

Example 36 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class MessageDispatcher method setKnownServerMessagesIDs.

public void setKnownServerMessagesIDs(Set<String> currentServerIDs) {
    ListData oldList = ListData.asListData(data.getValue(SERVER_MESSAGES));
    if (oldList != null) {
        ListData newList = new ListData();
        for (int i = 0; i < oldList.size(); i++) {
            Object oneID = oldList.get(i);
            if (currentServerIDs.contains(oneID))
                newList.add(oneID);
        }
        if (newList.size() == 0)
            newList = null;
        data.putValue(SERVER_MESSAGES, newList);
    }
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 37 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class WorkflowTaskPlanSummary method doGet.

@Override
protected void doGet() throws IOException {
    // retrieve information about the workflow this task is a part of.
    DataContext data = getDataContext();
    WorkflowEnactmentHelper workflow = new WorkflowEnactmentHelper(data, getPrefix());
    Map<String, String> tasks = workflow.getEnactmentTasks(TaskMapType.PhaseID);
    if (tasks == null || tasks.isEmpty()) {
        out.write("Location: probeSummaryNA.shtm\r\n\r\n");
        return;
    }
    String rootPath = workflow.getRootItemPath();
    tasks.remove(rootPath);
    String workflowName = workflow.getWorkflowProcessName();
    String workflowID = workflow.getWorkflowProcessID();
    // Gather up information about the tasks in this workflow enactment.
    StringBuffer uri = new StringBuffer().append(env.get("SCRIPT_PATH")).append(".shtm");
    ListData fullPaths = new ListData();
    ListData orphanedTimePaths = new ListData();
    Map<String, ListData> coqLists = new HashMap();
    for (String coqType : COQ_TYPES) coqLists.put(coqType, new ListData());
    int phaseNum = 0;
    for (Entry<String, String> e : tasks.entrySet()) {
        String taskPath = e.getKey();
        TaskNodeType nodeType = workflow.getNodeType(taskPath);
        if (nodeType == TaskNodeType.Leaf || nodeType == TaskNodeType.PSP)
            fullPaths.add(taskPath);
        if (nodeType != TaskNodeType.Parent || hasOrphanedTime(data, taskPath)) {
            String shortName = taskPath.substring(rootPath.length() + 1);
            HTMLUtils.appendQuery(uri, "phases", Integer.toString(phaseNum));
            HTMLUtils.appendQuery(uri, phaseNum + "_Rel_Path", shortName);
            HTMLUtils.appendQuery(uri, phaseNum + "_Abs_Path", taskPath);
            if (nodeType == TaskNodeType.Parent) {
                orphanedTimePaths.add(taskPath);
                HTMLUtils.appendQuery(uri, phaseNum + "_Orphan", "t");
            }
            phaseNum++;
        }
        String phaseID = e.getValue();
        String phaseType = workflow.getWorkflowPhaseTypes().get(phaseID);
        if (phaseType != null && !"PSP".equals(phaseType)) {
            ListData coqList = coqLists.get(phaseType);
            if (coqList == null)
                coqList = coqLists.get("Failure");
            coqList.add(taskPath);
        }
    }
    // Write data into the repository for use by the plan summary form
    data.putValue("Workflow_Root_Path", StringData.create(rootPath));
    data.putValue("Workflow_Name", StringData.create(workflowName));
    data.putValue("Workflow_ID", StringData.create(workflowID));
    data.putValue("Workflow_Task_Paths", fullPaths);
    data.putValue("Workflow_Orphaned_Time_Paths", orphanedTimePaths);
    for (String coqType : COQ_TYPES) data.putValue("Workflow_Task_Paths/" + coqType, coqLists.get(coqType));
    String html = getRequestAsString(uri.toString());
    writeHeader();
    out.write(html);
}
Also used : DataContext(net.sourceforge.processdash.data.DataContext) TaskNodeType(net.sourceforge.processdash.tool.db.WorkflowEnactmentHelper.TaskNodeType) HashMap(java.util.HashMap) WorkflowEnactmentHelper(net.sourceforge.processdash.tool.db.WorkflowEnactmentHelper) ListData(net.sourceforge.processdash.data.ListData)

Example 38 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class TeamMetricsStatus method writeContents.

@Override
protected void writeContents() throws IOException {
    String prefixListName = getParameter("for");
    ListData prefixList = ListData.asListData(getDataContext().getSimpleValue(prefixListName));
    List<ImportData> importData = getImportData(prefixList);
    if (parameters.get("xml") != null)
        writeXml(importData);
    else
        writeHtml(importData);
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 39 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class HistDataPage method parseFormData.

public boolean parseFormData() {
    // From the posted data, create the effective list of projects.
    ListData probeList = new ListData();
    int r = 1;
    while (true) {
        String taskName = (String) params.get(TASK_FIELD + r);
        if (taskName == null)
            break;
        if (params.get(EXCLUDE_FIELD + r) == null)
            probeList.add(taskName);
        r++;
    }
    // save that list to the PROBE_SUBSET for this project.
    putValue(ProbeData.PROBE_LIST_NAME, probeList);
    data.waitForCalculations();
    return true;
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 40 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class SizeEstimatingTemplate method configureSETList.

protected static ListData configureSETList(DataRepository data, String prefix, String[] dataElements, int minRows, int padRows, boolean saveList) {
    String[] dataNames = new String[dataElements.length];
    for (int e = dataElements.length; e-- > 0; ) dataNames[e] = prefix + "/" + dataElements[e];
    ListData populatedRows = new ListData();
    int rowNum, lastPopulatedRow, i;
    rowNum = lastPopulatedRow = -1;
    ROW: while (true) {
        rowNum++;
        i = dataNames.length;
        while (i-- > 1) if (data.getValue(replaceNum(dataNames[i], rowNum)) != null) {
            lastPopulatedRow = rowNum;
            populatedRows.add(Integer.toString(rowNum));
            continue ROW;
        }
        // we can safely conclude that there is no more data.
        if (rowNum - lastPopulatedRow > 20)
            break ROW;
    }
    int extraRows = Math.max(padRows, minRows - populatedRows.size());
    for (int e = 0; e < extraRows; e++) populatedRows.add(Integer.toString(lastPopulatedRow + e + 1));
    if (saveList) {
        String listName = dataNames[0];
        String activeName = listName + "//Active";
        ListData currentActiveElements = ListData.asListData(data.getValue(activeName));
        ListData newActiveElements = new ListData(populatedRows);
        newActiveElements.setAddAll(currentActiveElements);
        data.putValue(listName, newActiveElements);
        data.putValue(activeName, newActiveElements);
    }
    return populatedRows;
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Aggregations

ListData (net.sourceforge.processdash.data.ListData)129 SimpleData (net.sourceforge.processdash.data.SimpleData)20 ArrayList (java.util.ArrayList)18 List (java.util.List)16 Iterator (java.util.Iterator)15 StringData (net.sourceforge.processdash.data.StringData)15 EVTaskListData (net.sourceforge.processdash.ev.EVTaskListData)9 Map (java.util.Map)8 HashSet (java.util.HashSet)7 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)6 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 LinkedList (java.util.LinkedList)5 DoubleData (net.sourceforge.processdash.data.DoubleData)5 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)5 LocalizedString (net.sourceforge.processdash.util.LocalizedString)5 NodeList (org.w3c.dom.NodeList)5 Date (java.util.Date)4 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)4 Element (org.w3c.dom.Element)4