use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class TeamProjectSetupWizard method copyNodeIDsToHierarchy.
private static boolean copyNodeIDsToHierarchy(DataContext data, DashHierarchy hier, PropertyKey key) {
boolean madeChange = false;
SimpleData projectID = data.getSimpleValue(DataRepository.createDataName(key.path(), TeamDataConstants.PROJECT_ID));
if (projectID != null && projectID.test()) {
String nodeID = projectID.format() + ":root";
Prop p = hier.pget(key);
if (!nodeID.equals(p.getNodeID())) {
p.setNodeID(nodeID);
madeChange = true;
}
} else {
for (int i = hier.getNumChildren(key); i-- > 0; ) {
PropertyKey child = hier.getChildKey(key, i);
if (copyNodeIDsToHierarchy(data, hier, child))
madeChange = true;
}
}
return madeChange;
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class MigrationToolIndivLauncher method assertNoRootDefects.
private void assertNoRootDefects() {
Prop p = ctx.getHierarchy().pget(projectRoot);
String defectLogFilename = p.getDefectLog();
if (!StringUtils.hasValue(defectLogFilename))
return;
File defectLogFile = new File(targetDir, defectLogFilename);
if (defectLogFile.length() == 0)
return;
String message = getRes("Error.Root_Defects_FMT", esc(projectPath));
failedPreconditions.add(message);
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class MigrationToolIndivLauncher method getPhaseChildren.
private List<String> getPhaseChildren(PropertyKey node) {
List<String> result = new ArrayList<String>();
Prop p = ctx.getHierarchy().pget(node);
for (int i = 0; i < p.getNumChildren(); i++) {
PropertyKey childKey = p.getChild(i);
Prop child = ctx.getHierarchy().pget(childKey);
String templateID = child.getID();
if (templateID != null && templateID.contains("/PHASE/"))
result.add(childKey.name());
}
return result;
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class TemplateLoader method createProcessRoot.
/**
* The templates hierarchy needs a root. However, that root cannot
* be read from any file because its children are determined dynamically
* by searching classpaths and template directories. Once the children
* are loaded from their various locations, this routine dynamically
* builds their parent.
*
* NOTE: currently, the children are placed in alphabetical order.
*/
private static void createProcessRoot(DashHierarchy templates) {
Enumeration nodes = templates.keys();
Vector processes = new Vector();
PropertyKey key, parent;
while (nodes.hasMoreElements()) {
key = (PropertyKey) nodes.nextElement();
parent = key.getParent();
if (parent != null && parent.equals(PropertyKey.ROOT))
processes.add(key);
}
if (processes.size() > 0) {
Collections.sort(processes);
Prop p = new Prop();
while (processes.size() > 0) p.addChild((PropertyKey) processes.remove(0), -1);
templates.put(PropertyKey.ROOT, p);
}
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class TemplateInfo method addSafeNamesOfProcessPhases.
public static final void addSafeNamesOfProcessPhases(HierarchyNodeMapper m) {
if (TEMPLATES == null)
// about the phases in various metrics collection frameworks.
return;
for (Iterator i = TEMPLATES.entrySet().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
PropertyKey key = (PropertyKey) e.getKey();
Prop prop = (Prop) e.getValue();
if (PROCESS_PHASE_STATUS.equals(prop.getStatus())) {
String phaseName = Prop.unqualifiedName(key.name());
m.addSafeName(phaseName);
}
}
}
Aggregations