Search in sources :

Example 71 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class SelectWBSNode method getStartingKey.

// start at the root of the current project.
protected PropertyKey getStartingKey() {
    DashHierarchy hierarchy = getPSPProperties();
    PropertyKey key = hierarchy.findExistingKey(getPrefix());
    while (key != null) {
        String id = getID(hierarchy, key);
        if (id != null && id.endsWith("Root"))
            break;
        key = key.getParent();
    }
    return key;
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 72 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class GetUnassignedAndDeferredTime method isMaster.

private boolean isMaster(String projectPath) throws IOException {
    DashHierarchy hierarchy = getPSPProperties();
    PropertyKey key = hierarchy.findExistingKey(projectPath);
    String templateID = null;
    if (key != null)
        templateID = hierarchy.getID(key);
    if (templateID == null)
        throw new TinyCGIException(404, "Not a team project");
    else if (templateID.endsWith(SyncWBS.MASTER_ROOT))
        return true;
    else if (templateID.endsWith(SyncWBS.TEAM_ROOT))
        return false;
    else
        throw new TinyCGIException(404, "Not a team project");
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey) TinyCGIException(net.sourceforge.processdash.net.http.TinyCGIException)

Example 73 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class AutoExportTrigger method scanHierarchy.

private void scanHierarchy(Set<String> dataNamesToWatch, PropertyKey node, boolean pathHasActiveExport) {
    String path = node.path();
    pathHasActiveExport = pathHasActiveExport || ExportManager.getInstance().hasEnabledExportTask(path);
    if (pathHasActiveExport && test(path, requiredTag)) {
        for (String watch : valuesToWatch) {
            String dataName = DataRepository.createDataName(path, watch);
            dataNamesToWatch.add(dataName);
        }
    }
    int numChildren = ctx.getHierarchy().getNumChildren(node);
    for (int i = numChildren; i-- > 0; ) {
        PropertyKey child = ctx.getHierarchy().getChildKey(node, i);
        scanHierarchy(dataNamesToWatch, child, pathHasActiveExport);
    }
}
Also used : PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 74 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class StudataExporter method getProjectPaths.

private List getProjectPaths() {
    DashHierarchy hier = getDashboardContext().getHierarchy();
    PropertyKey parent = hier.findExistingKey(getPrefix());
    int numKids = hier.getNumChildren(parent);
    List projectPaths = new ArrayList(numKids);
    ListData projectPathsData = new ListData();
    for (int i = 0; i < numKids; i++) {
        PropertyKey child = hier.getChildKey(parent, i);
        projectPaths.add(child.path());
        projectPathsData.add(StringData.create(child.path()));
    }
    getDataRepository().putValue("///STUDATA_List", projectPathsData);
    return projectPaths;
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) PropertyKey(net.sourceforge.processdash.hier.PropertyKey) ListData(net.sourceforge.processdash.data.ListData)

Example 75 with PropertyKey

use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.

the class StudataExporter method getStudentProfilePath.

private String getStudentProfilePath() {
    DashHierarchy hier = getDashboardContext().getHierarchy();
    PropertyKey parent = hier.findExistingKey(getPrefix());
    int numKids = hier.getNumChildren(parent);
    for (int i = 0; i < numKids; i++) {
        PropertyKey child = hier.getChildKey(parent, i);
        String path = child.path();
        if (hasTag(path, "PspForEngV3_Student_Profile"))
            return path;
    }
    // still allow the name and programming language to be exported.
    return getPrefix() + "/No Student Profile Found";
}
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