use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class WorkflowProbeScriptSource method getProbeTaskPaths.
private List<String> getProbeTaskPaths(String path) {
String workflowRoot = getWorkflowParent(path);
PropertyKey workflowRootKey = context.getHierarchy().findExistingKey(workflowRoot);
if (workflowRootKey == null)
return Collections.EMPTY_LIST;
List<String> result = new ArrayList();
findProbeTasks(result, workflowRootKey);
return result;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TemplateLoader method createScriptMaps.
private static void createScriptMaps(DashHierarchy templates) {
Enumeration nodes = templates.keys();
PropertyKey key;
while (nodes.hasMoreElements()) {
key = (PropertyKey) nodes.nextElement();
if (key.getParent().equals(PropertyKey.ROOT))
addScriptMaps(templates, key, null, null);
}
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class SizeInventoryForm method writeContents.
public void writeContents() throws IOException {
String prefix = getPrefix();
if (prefix == null)
prefix = "/";
DashHierarchy hierarchy = getPSPProperties();
PropertyKey key = hierarchy.findExistingKey(prefix);
String uri = getURI();
highlightTimestamp = getHighlightTimestamp();
out.println(HTML_HEADER);
out.println("<h2>");
out.print(HTMLUtils.escapeEntities(prefix));
out.println("</h2><form name='sizes'>");
out.flush();
if (!prefix.endsWith("/"))
prefix = prefix + "/";
expansionText = new StringBuffer();
writeHierarchy(uri, prefix, key, hierarchy);
if (highlightTimestamp > 0 && expansionText.length() == 0) {
// if we were asked to highlight, but no matching sections were
// found, clear the highlight request and draw all sections.
highlightTimestamp = -1;
writeHierarchy(uri, prefix, key, hierarchy);
}
if (highlightTimestamp <= 0)
writeHierarchyExpanders(expansionText);
expansionText = null;
out.println("</form><script src='/data.js'>" + "document.writeln('<p>Problem loading the script!');" + "</script>");
out.println("</body></html>");
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class GenericPlanSummaryForm method writeContents.
protected void writeContents() throws IOException {
StringBuffer uri = new StringBuffer((String) env.get("SCRIPT_PATH"));
uri.setLength(uri.length() - 6);
uri.append(".shtm");
String unit, units;
DataRepository data = getDataRepository();
String prefix = getPrefix();
SimpleData d = data.getSimpleValue(prefix + "/" + UNITS_NAME);
units = (d != null ? d.format() : null);
if (units == null || units.trim().length() == 0)
units = resources.getString("Default_Units");
int semicolonPos = units.indexOf(';');
if (semicolonPos > -1) {
unit = units.substring(0, semicolonPos);
units = units.substring(semicolonPos + 1);
} else if (units.endsWith("s")) {
unit = units.substring(0, units.length() - 1);
} else {
unit = units;
}
HTMLUtils.appendQuery(uri, "Unit", unit);
HTMLUtils.appendQuery(uri, "Units", units);
DashHierarchy props = getPSPProperties();
PropertyKey self = props.findExistingKey(getPrefix());
int numPhases = props.getNumChildren(self);
for (int i = 0; i < numPhases; i++) HTMLUtils.appendQuery(uri, "Phases", props.getChildKey(self, i).name());
String text = getRequestAsString(uri.toString());
out.write(text);
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class CycleSummaryForm method getCycleList.
/** Get the list of PSP3 cycle names under the current PSP3 task. */
private String[] getCycleList() {
String prefix = (String) env.get("PATH_TRANSLATED");
DashHierarchy props = getPSPProperties();
PropertyKey self = props.findExistingKey(prefix);
// WARNING: the "4" on the next line is a magic number which
// depends on the structure of the PSP3 template.
int numCycles = props.getNumChildren(self) - 4;
if (numCycles < 0)
numCycles = 0;
String[] result = new String[numCycles];
while (numCycles-- > 0) // WARNING: the "3" on the next line is a magic number which
// depends on the structure of the PSP3 template.
result[numCycles] = props.getChildKey(self, numCycles + 3).name();
return result;
}
Aggregations