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;
}
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");
}
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);
}
}
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;
}
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";
}
Aggregations