use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class MockActiveTaskModel method setNextPhase.
public boolean setNextPhase() {
PropertyKey parent = node.getParent();
PropertyKey nextNode = null;
for (int i = hierarchy.getNumChildren(parent); i-- > 0; ) {
PropertyKey childKey = hierarchy.getChildKey(parent, i);
if (node.equals(childKey))
return setNode(nextNode);
else
nextNode = childKey;
}
return false;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TaskListAltererMessageHandler method findProjectWithID.
private String findProjectWithID(PropertyKey parent, String projectID) {
for (int i = ctx.getHierarchy().getNumChildren(parent); i-- > 0; ) {
PropertyKey node = ctx.getHierarchy().getChildKey(parent, i);
// check to see if THIS node is the project we're looking for.
String path = node.path();
if (pathMatchesProjectID(path, projectID))
return path;
// Otherwise, recurse into children to look for the project.
String childResult = findProjectWithID(node, projectID);
if (childResult != null)
return childResult;
}
// the project was not found in this portion of the tree.
return null;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class MigrationToolTeam method getDataFileName.
private String getDataFileName(DashboardContext ctx, String path) {
DashHierarchy hier = ctx.getHierarchy();
PropertyKey key = hier.findExistingKey(path);
if (key == null) {
logger.severe("No property key found for '" + path + "'");
return null;
}
Prop p = hier.pget(key);
if (p == null) {
logger.severe("No prop found for '" + path + "'");
return null;
}
String dataFileName = p.getDataFile();
if (dataFileName == null) {
logger.severe("No datafile associated with '" + path + "'");
return null;
}
return dataFileName;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class HierarchySynchronizer method getTotalPlanTimeForIndivNode.
private double getTotalPlanTimeForIndivNode(PropertyKey node) {
double result = 0;
// add time logged directly to the node, if it exists.
SimpleData d = getData(node.path(), EST_TIME_DATA_NAME);
result += getDoubleData(d);
// if the node is not a PSP task and has children, add their time too.
if (!isPSPTask(node)) {
for (int i = hierarchy.getNumChildren(node); i-- > 0; ) {
PropertyKey child = hierarchy.getChildKey(node, i);
result += getTotalPlanTimeForIndivNode(child);
}
}
return result;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class ConvertTeamProjectMCF method findProject.
/**
* Locates the enclosing team project, and sets the values of the
* {@link #projectRoot} and {@link #processID} fields accordingly. If there
* is no enclosing team project, both will be set to null.
*/
private void findProject() throws MigrationException {
DashHierarchy hierarchy = getPSPProperties();
PropertyKey key = hierarchy.findExistingKey(getPrefix());
while (key != null) {
String templateID = hierarchy.getID(key);
if (templateID != null && templateID.endsWith(MASTER_ROOT)) {
throw new MigrationException("notSupportedMaster");
}
String teamTemplateID = getTeamPID(templateID);
if (teamTemplateID != null) {
projectRoot = key.path();
processID = teamTemplateID;
return;
}
key = key.getParent();
}
throw new MigrationException("notTeamProject");
}
Aggregations