Search in sources :

Example 26 with ListData

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

the class EditSubprojectList method findValidSubprojectNames.

/*
     * Methods for getting data about this and other projects
     */
private ListData findValidSubprojectNames() {
    ListData result = new ListData();
    String processID = getValue("Team_Process_PID");
    if (processID != null) {
        String templateID = processID + "/TeamRoot";
        findValidSubprojectNames(result, PropertyKey.ROOT, templateID);
    }
    return result;
}
Also used : ListData(net.sourceforge.processdash.data.ListData)

Example 27 with ListData

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

the class EditSubprojectList method showProjectList.

private void showProjectList() throws IOException {
    Map subprojects = getSubprojects();
    ListData validSubprojects = findValidSubprojectNames();
    if (subprojects.isEmpty()) {
        out.println("<tr>");
        out.println("<td colspan='3' align='center'><i>This master " + "project currently contains no subprojects</i></td>");
        out.println("</tr>");
        return;
    }
    for (Iterator i = subprojects.values().iterator(); i.hasNext(); ) {
        Subproject proj = (Subproject) i.next();
        out.println("<tr>");
        out.print("<td>");
        out.print(HTMLUtils.escapeEntities(proj.shortName));
        out.println("</td>");
        String pathError = validatePath("", proj.path, Collections.EMPTY_MAP, validSubprojects);
        out.print("<td>");
        out.print(HTMLUtils.escapeEntities(proj.path));
        if (pathError != null) {
            out.print("<br><span class='error'>");
            out.print(HTMLUtils.escapeEntities(pathError));
            out.print("</span>");
        }
        out.println("</td>");
        out.print("<td><form action='subprojectEdit' method='GET' " + "target='popup'><input type='submit' name='edit' " + "value='Edit...' onClick='popup();'>&nbsp;<input " + "type='submit' name='remove' value='Remove...' " + "onClick='popup();'><input type='hidden' " + "name='subproject_number' value='");
        out.print(proj.num);
        out.println("'></form></td>");
        out.println("</tr>");
    }
}
Also used : Iterator(java.util.Iterator) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) ListData(net.sourceforge.processdash.data.ListData)

Example 28 with ListData

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

the class EditSubprojectList method doEdit.

private void doEdit() throws IOException {
    String num = getParameter(NUMBER);
    if (!hasValue(num)) {
        writeCloseWindow(true);
        return;
    }
    Map subprojects = getSubprojects();
    ListData validSubprojects = findValidSubprojectNames();
    String shortName = getParameter(SHORT_NAME);
    String path = getParameter(PATH);
    String shortNameError = validateShortName(num, shortName, subprojects);
    String pathError = validatePath(num, path, subprojects, validSubprojects);
    if (shortNameError != null || pathError != null) {
        // there are problems with the values entered.  Send the user
        // back to the edit page to try again.
        showEditPage(num, shortName, shortNameError, path, pathError);
        return;
    }
    logger.log(Level.FINE, "Master project {0} updating subproject [{1} => {2}]", new Object[] { getPrefix(), shortName, path });
    putValue(num, SHORT_NAME, shortName);
    putValue(num, PATH, path);
    recalcDependentData();
    writeCloseWindow(true);
}
Also used : LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) ListData(net.sourceforge.processdash.data.ListData)

Example 29 with ListData

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

the class EditSubprojectList method saveSubprojectList.

private void saveSubprojectList(Map subprojects) {
    ListData pathList = new ListData();
    for (Iterator i = subprojects.values().iterator(); i.hasNext(); ) {
        Subproject proj = (Subproject) i.next();
        pathList.add(proj.path);
    }
    putValue(SUBPROJECT_PATH_LIST, pathList);
}
Also used : Iterator(java.util.Iterator) ListData(net.sourceforge.processdash.data.ListData)

Example 30 with ListData

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

the class Dbautolabelsdeferred method call.

/**
     * Arguments: one string, providing the name of another data element
     * (relative to this one) that contains the actual results of the
     * Dbautolabels calculation.
     */
@Override
public Object call(List arguments, ExpressionContext context) {
    String name = asString(getArg(arguments, 0));
    String targetDataName = context.resolveName(name);
    ListData result = new ListData();
    for (String label : Dbautolabels.AUTO_LABEL_NAMES) {
        result.add(TaskLabeler.LABEL_PREFIX + label);
        result.add(TaskLabeler.LABEL_HIDDEN_MARKER);
        result.add(DEFERRED_DATA_MARKER);
        result.add(DEFERRED_TOKEN_PREFIX + targetDataName);
    }
    return result;
}
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