use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class DataMessageHandler method getPrefix.
private String getPrefix(MessageEvent message) {
String nodeID = message.getMessageXml().getAttribute("nodeID");
if (XMLUtils.hasValue(nodeID)) {
PropertyKey key = ctx.getHierarchy().findKeyByNodeID(nodeID);
if (key != null)
return key.path();
logger.warning("When handling message with ID '" + message.getMessageId() + "', could not find any node with ID '" + nodeID + "'. Discarding message.");
return null;
}
String prefix = message.getMessageXml().getAttribute("prefix");
if (XMLUtils.hasValue(prefix))
return prefix;
logger.warning("When handling message with ID '" + message.getMessageId() + "', no nodeID or prefix was provided. Discarding message.");
return null;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class UserDataWriter method writeActualDataForPSPPhases.
private void writeActualDataForPSPPhases(XmlSerializer ser, DashHierarchy hier, PropertyKey node) throws IOException {
// iterate over the phases in this PSP process
for (int i = hier.getNumChildren(node); i-- > 0; ) {
PropertyKey phase = hier.getChildKey(node, i);
String path = phase.path();
// for each phase, write an XML element containing subtask data.
ser.startTag(null, SUBTASK_DATA_TAG);
writeTimeDataAttr(ser, EST_TIME_ATTR, getData(path, "Estimated Time"));
writeTimeDataAttr(ser, TIME_ATTR, getData(path, "Time"));
writeActualDataAttr(ser, START_DATE_ATTR, getData(path, "Started"));
writeActualDataAttr(ser, COMPLETION_DATE_ATTR, getData(path, "Completed"));
ser.endTag(null, SUBTASK_DATA_TAG);
}
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class PlanSummaryNameHeader method writeContents.
protected void writeContents() throws IOException {
getDataRepository().waitForCalculations();
String prefix = getPrefix();
PropertyKey projectRootKey = getStartingKey();
String projectRoot = projectRootKey.path();
String currentFilter = SelectLabelFilter.getCurrentFilter(getDataRepository(), projectRoot);
boolean isSnippet = (env.containsKey(SnippetEnvironment.SNIPPET_ID));
boolean isIndiv = (getID(getPSPProperties(), projectRootKey).indexOf("Indiv") != -1);
boolean useData = SelectWBSFilterTeamData.usesDataBasedFilter(getDataRepository(), projectRoot);
out.println("<html><head>");
out.println("<link rel=stylesheet type='text/css' href='/style.css'>");
if (isSnippet && StringUtils.hasValue(currentFilter))
out.println("<link rel=stylesheet type='text/css' href='/reports/filter-style.css'>");
out.println("<style>");
out.println(" body { margin: 0pt; padding: 2px }");
out.println(" h1 { margin: 0pt; padding: 0pt }");
out.println(" h2 { margin: 0pt; padding: 0pt }");
out.println("</style></head><body>");
out.print("<h1 style='margin-top:0pt'><!-- editLink -->");
out.print(HTMLUtils.escapeEntities(projectRoot));
out.println("</h1>");
out.print("<h2>");
writeFilterIcon(projectRoot, currentFilter);
if (isIndiv)
writeHierarchyIconIndiv(projectRoot);
else if (useData) {
writeHierarchyIconData(projectRoot);
writeUserGroupIcon(projectRoot);
} else
writeHierarchyIconFrame(prefix, projectRoot);
out.println("</h2>");
String cmsPageTitle = (String) env.get("cmsPageTitle");
if (cmsPageTitle != null) {
out.print("<h2>");
out.print(HTMLUtils.escapeEntities(cmsPageTitle));
out.println("</h2>");
}
out.println("</body></html>");
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class SelectLabelFilter method doPost.
protected void doPost() throws IOException {
PropertyKey projectRootKey = getStartingKey();
String projectRoot = projectRootKey.path();
String dataName = DataRepository.createDataName(projectRoot, FILTER_DATA_NAME);
parseFormData();
String newFilter = getParameter("filter");
if (newFilter == null || newFilter.trim().length() == 0 || parameters.containsKey("remove"))
// remove the label filter
getDataRepository().putValue(dataName, null);
else {
// save the value of the new label filter
getDataRepository().putValue(dataName, StringData.create(newFilter.trim()));
// add a listener to prevent the filter data element
// from being disposed
getDataRepository().addDataListener(dataName, LABEL_FILTER_KEEPER, false);
}
// The changed filter may affect many other calculations, and those
// values may take a moment or two to recalculate. In the next step when
// we redirect to the destUri, it will be typical for that page to use
// the results of those calculations, potentially in charts or tables.
// If we redirect immediately, those charts/tables could be generated
// from unrecalculated values. To avoid this, we intentionally wait for
// the recalculations to finish before we redirect to the target page.
getDataRepository().waitForCalculations();
String destUri = getParameter("destUri");
if (destUri == null)
destUri = "../summary_frame.shtm";
out.write("Location: " + destUri + "\r\n\r\n");
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class UserDataWriter method writeActualData.
private void writeActualData(XmlSerializer ser) throws IOException {
DashHierarchy hier = getPSPProperties();
PropertyKey projectRoot = hier.findExistingKey(getPrefix());
writeActualData(ser, hier, projectRoot, true);
}
Aggregations