Search in sources :

Example 1 with PropertyKey

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;
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 2 with PropertyKey

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);
    }
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 3 with PropertyKey

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>");
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 4 with PropertyKey

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");
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 5 with PropertyKey

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);
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Aggregations

PropertyKey (net.sourceforge.processdash.hier.PropertyKey)125 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)40 Prop (net.sourceforge.processdash.hier.Prop)16 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)10 SimpleData (net.sourceforge.processdash.data.SimpleData)7 ArrayList (java.util.ArrayList)6 Enumeration (java.util.Enumeration)6 IOException (java.io.IOException)5 Iterator (java.util.Iterator)5 StringTokenizer (java.util.StringTokenizer)5 TreePath (javax.swing.tree.TreePath)5 ListData (net.sourceforge.processdash.data.ListData)5 DefectLog (net.sourceforge.processdash.log.defects.DefectLog)5 List (java.util.List)4 ProcessDashboard (net.sourceforge.processdash.ProcessDashboard)4 HierarchyAlterer (net.sourceforge.processdash.hier.HierarchyAlterer)4 HierarchyAlterationException (net.sourceforge.processdash.hier.HierarchyAlterer.HierarchyAlterationException)4 DefectLogID (net.sourceforge.processdash.log.defects.DefectLogID)4 TinyCGIException (net.sourceforge.processdash.net.http.TinyCGIException)4 Point (java.awt.Point)3