Search in sources :

Example 1 with TeamMemberList

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);
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) Iterator(java.util.Iterator) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Example 2 with TeamMemberList

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) {
        }
    }
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) HashMap(java.util.HashMap) Element(org.w3c.dom.Element) HashMap(java.util.HashMap) Map(java.util.Map) TeamMember(teamdash.team.TeamMember) ParseException(java.text.ParseException) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException)

Example 3 with TeamMemberList

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);
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) Iterator(java.util.Iterator) TeamMember(teamdash.team.TeamMember) Date(java.util.Date)

Example 4 with TeamMemberList

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);
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) CustomColumnSpecs(teamdash.wbs.columns.CustomColumnSpecs) Map(java.util.Map) File(java.io.File)

Example 5 with TeamMemberList

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);
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) Element(org.w3c.dom.Element) File(java.io.File) IOException(java.io.IOException)

Aggregations

TeamMemberList (teamdash.team.TeamMemberList)8 File (java.io.File)4 IOException (java.io.IOException)3 Map (java.util.Map)3 Date (java.util.Date)2 Iterator (java.util.Iterator)2 List (java.util.List)2 Element (org.w3c.dom.Element)2 TeamMember (teamdash.team.TeamMember)2 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedList (java.util.LinkedList)1 SAXException (org.xml.sax.SAXException)1 ParseException (teamdash.wbs.CsvNodeDataImporter.ParseException)1 CustomColumnSpecs (teamdash.wbs.columns.CustomColumnSpecs)1