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;
}
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();'> <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>");
}
}
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);
}
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);
}
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;
}
Aggregations