use of teamdash.team.TeamMemberList in project processdash by dtuma.
the class TeamProjectBottomUp method recalculateBottomUpData.
private void recalculateBottomUpData() {
WBSModel newWbs = makeStartingWBS();
TeamMemberList newTeam = new TeamMemberList();
for (Iterator i = subprojects.entrySet().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
String shortName = (String) e.getKey();
TeamProject subproject = (TeamProject) e.getValue();
String subprojInitials = TeamMember.convertToInitials(shortName);
addWBSItems(newWbs, shortName, subproject, subprojInitials);
double totalSubprojectTime = sumUpTime(newWbs, subprojInitials);
addTeamMember(newTeam, shortName, subproject, totalSubprojectTime);
}
newWbs.copyNodeExpansionStates(getWBS(), MasterWBSUtil.NODE_ID_COMPARATOR);
getWBS().copyFrom(newWbs);
getTeamMemberList().copyFrom(newTeam);
}
use of teamdash.team.TeamMemberList in project processdash by dtuma.
the class ProjectHistoryBridgedAbstract method loadIdentityInfo.
protected void loadIdentityInfo(ManifestEntry teamList) {
if (teamList != null) {
try {
if (identities == null)
identities = new HashMap<String, String>();
Element xml = parseXml(teamList.getStream());
TeamMemberList team = new TeamMemberList(xml);
for (TeamMember indiv : team.getTeamMembers()) {
String infoStr = indiv.getServerIdentityInfo();
Map info = HTMLUtils.parseQuery(infoStr);
String username = (String) info.get("username");
if (StringUtils.hasValue(username))
identities.put(username, indiv.getName());
}
} catch (Exception e) {
}
}
}
use of teamdash.team.TeamMemberList in project processdash by dtuma.
the class TeamProjectBottomUp method addTeamMember.
private void addTeamMember(TeamMemberList newTeam, String shortName, TeamProject subproject, double totalSubprojectTime) {
// create a new row in the team list, and set the name/initials.
newTeam.maybeAddEmptyRow();
int pos = newTeam.getRowCount() - 1;
newTeam.setValueAt(shortName, pos, TeamMemberList.NAME_COLUMN);
newTeam.setValueAt(shortName, pos, TeamMemberList.INITIALS_COLUMN);
// retrieve the newly added pseudo-team-member. (Note that we couldn't
// do this until the name was set above, because the getTeamMembers()
// method only returns nonempty individuals.)
TeamMember newMember = (TeamMember) newTeam.getTeamMembers().get(pos);
// find out when the subteam is starting, and set that as the start
// date for our new pseudo-team-member.
TeamMemberList subTeam = subproject.getTeamMemberList();
Date subteamStartDate = subTeam.getDateForEffort(0);
newMember.setStartDate(subteamStartDate);
// now, find out when the subteam plans to finish. Then, create an
// artificial schedule that causes our pseudo-team-member's to finish
// on that date.
long teamEndTime = subteamStartDate.getTime();
for (Iterator i = subTeam.getTeamMembers().iterator(); i.hasNext(); ) {
TeamMember m = (TeamMember) i.next();
double memberTime = sumUpTime(subproject.getWBS(), m.getInitials());
Date memberEndDate = m.getSchedule().getDateForEffort(memberTime);
if (memberEndDate != null)
teamEndTime = Math.max(teamEndTime, memberEndDate.getTime());
}
Date teamEndDate = new Date(teamEndTime);
double teamDuration = newMember.getSchedule().dateToDoubleWeekValue(teamEndDate) - newMember.getSchedule().getStartWeek();
newMember.getSchedule().setHoursPerWeek(totalSubprojectTime / teamDuration);
}
use of teamdash.team.TeamMemberList in project processdash by dtuma.
the class TeamProjectMerger method run.
public void run() {
// alter the node IDs in the incoming branch to ensure the best match.
TeamProjectNodeIDMatcher.performMatch(base, main, incoming);
// merge the various data structures in the team project.
TeamMemberList team = mergeTeams();
WorkflowWBSModel workflows = mergeWorkflows();
ProxyWBSModel proxies = mergeProxies();
MilestonesWBSModel milestones = mergeMilestones();
CustomColumnSpecs columns = mergeColumns();
WBSModel wbs = mergeWBS();
Map userSettings = mergeUserSettings();
// create a TeamProject object to hold the merged data.
File dir = new File("no such directory " + System.currentTimeMillis());
merged = new TeamProject(dir, "Unused", team, wbs, workflows, proxies, milestones, columns, userSettings);
}
use of teamdash.team.TeamMemberList in project processdash by dtuma.
the class TeamProject method openTeamList.
/** Open the file containing the list of team members */
private void openTeamList() {
try {
File file1 = checkEditable(new File(directory, TEAM_LIST_FILENAME));
File file2 = checkEditable(new File(directory, TEAM_LIST_FILENAME2));
File file = (file2.exists() ? file2 : file1);
Element xml = openXML(file);
if (xml != null)
teamList = new TeamMemberList(xml);
} catch (Exception e) {
}
if (teamList == null) {
System.out.println("No " + TEAM_LIST_FILENAME + " found; creating empty team list");
teamList = new TeamMemberList();
}
teamList.setReadOnly(readOnly);
}
Aggregations