use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class WBSExcelWriter method writeDataForNodes.
private int writeDataForNodes(HSSFSheet sheet, int rowNum, WBSNode node, TableColumnModel columns) {
HSSFRow row = sheet.createRow(rowNum);
writeCellForNodeName(node, row);
writeCellsForNodeData(row, node, columns);
WBSNode[] children = wbs.getChildren(node);
if (children.length == 0)
return rowNum;
int childRowPos = rowNum;
for (WBSNode child : children) {
if (!child.isHidden())
childRowPos = writeDataForNodes(sheet, childRowPos + 1, child, columns);
}
sheet.groupRow(rowNum + 1, childRowPos);
if (!node.isExpanded())
sheet.setRowGroupCollapsed(rowNum + 1, true);
return childRowPos;
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class PlanTimeWatcher method calcDiscrepancies.
private List<String> calcDiscrepancies() {
if (restrictTo == null)
return null;
List<String> result = null;
WBSNode rootNode = dataModel.getWBSModel().getRoot();
if (rootNode.getAttribute(WBSSynchronizer.SYNC_IN_PROGRESS_ATTR) != null)
return null;
for (int i = teamMemberColumns.size(); i-- > 0; ) {
int oneColumn = teamMemberColumns.get(i);
String oneAttr = teamMemberAttrs[i];
String oneDiscrepancy = calcDiscrepancyFor(rootNode, oneColumn, oneAttr);
if (oneDiscrepancy != null) {
if (result == null)
result = new ArrayList<String>();
result.add(oneDiscrepancy);
}
}
return result;
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class TeamTimeColumn method applyWorkflowRoleEdits.
private void applyWorkflowRoleEdits(AssignedToEditList edits, WBSNode node) {
// scan the list of edits, looking for role-related changes.
for (Iterator i = edits.iterator(); i.hasNext(); ) {
Change change = (Change) i.next();
String origInitials = change.origInitials;
boolean isRoleAssignment = false;
if (origInitials != null && origInitials.startsWith(ROLE_BEG)) {
if (change.isDelete()) {
deleteRole(node, origInitials);
} else if (change.isInitialsChange()) {
isRoleAssignment = true;
deleteRole(node, origInitials);
}
}
if (!isRoleAssignment)
i.remove();
}
// no role assignments were found, we're done.
if (edits.isEmpty())
return;
// find the parent node which bounds this workflow instantiation.
while (true) {
WBSNode parent = wbsModel.getParent(node);
if (parent == null || parent.getAttribute(WorkflowModel.WORKFLOW_SOURCE_IDS_ATTR) == null)
break;
else
node = parent;
}
// store these new role assignments on the parent node
storeRoleAssignments(edits, node);
// tell the decendants of that parent to apply these role assignments.
for (WBSNode child : wbsModel.getDescendants(node)) {
LeafTaskData leafTaskData = getLeafTaskData(child);
if (leafTaskData != null)
leafTaskData.applyWorkflowRoleAssignments(edits);
}
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class ProjectChangeListFactory method buildChangesForEditedNode.
private void buildChangesForEditedNode(TreeNodeChange<Integer, WBSNodeContent> tnc, Map<Integer, ProjectWbsNodeChange> nodeChanges, Map<Integer, ProjectWbsTimeChange> timeChanges) {
Integer nodeID = tnc.getNodeID();
if (nodeID < 0)
// don't look for edits on the root node.
return;
WBSNodeContent base = diff.getBaseRoot().findNode(nodeID).getContent();
WBSNodeContent mod = tnc.getNode().getContent();
Set<String> attrNames = new HashSet<String>(base.keySet());
attrNames.addAll(mod.keySet());
boolean sawTimeChange = false;
for (String attr : attrNames) {
String baseVal = base.get(attr);
String modVal = mod.get(attr);
if (baseVal != null && baseVal.equals(modVal)) {
// no change in this attribute value
} else if (NODE_NAME.equals(attr)) {
Object changeType = new ProjectWbsNodeChange.Renamed(baseVal);
addNodeChange(tnc, nodeChanges, wbsB, changeType);
} else if (indivTimeAttrs.contains(attr) || TeamTimeColumn.TEAM_TIME_ATTR.equals(attr)) {
sawTimeChange = true;
}
}
if (sawTimeChange) {
WBSNode node = wbsB.getNodeMap().get(nodeID);
timeChanges.put(nodeID, new ProjectWbsTimeChange(node, base, mod, indivTimeAttrs, teamMemberNames, author, timestamp));
}
}
use of teamdash.wbs.WBSNode in project processdash by dtuma.
the class ProjectChangeListFactory method addNodeMove.
private void addNodeMove(TreeNodeChange<Integer, WBSNodeContent> tnc, Map<Integer, ProjectWbsNodeChange> nodeChanges) {
Integer nodeID = tnc.getNodeID();
WBSNode node = wbsA.getNodeMap().get(nodeID);
WBSNode oldParent = wbsA.getParent(node);
Object changeType = new ProjectWbsNodeChange.Moved(oldParent);
addNodeChange(tnc, nodeChanges, wbsB, changeType);
}
Aggregations