Search in sources :

Example 6 with TeamMemberList

use of teamdash.team.TeamMemberList in project processdash by dtuma.

the class WBSSynchronizer method addMissingTeamMembers.

private void addMissingTeamMembers(Map<String, File> unclaimedExportFiles, Map<String, String> datasetIDMap) {
    Date timestamp = getLastTeamListReverseSyncDate();
    TeamMemberList team = new TeamMemberList(teamProject.getTeamMemberList());
    boolean madeChange = false;
    for (File file : unclaimedExportFiles.values()) if (addMissingTeamMember(timestamp, team, file, datasetIDMap))
        madeChange = true;
    if (madeChange) {
        team.assignMissingUniqueIDs(null);
        teamProject.getTeamMemberList().copyFrom(team);
    }
    //
    teamProject.getWBS().getRoot().setAttribute(//
    TEAM_LIST_SYNC_TIMESTAMP, Long.toString(System.currentTimeMillis()));
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) File(java.io.File) Date(java.util.Date)

Example 7 with TeamMemberList

use of teamdash.team.TeamMemberList in project processdash by dtuma.

the class CsvNodeDataImporter method getNodesFromCsvFile.

public List getNodesFromCsvFile(File f, TeamMemberList teamList) throws IOException, ParseException {
    in = new BufferedReader(new FileReader(f));
    team = teamList;
    parseHeaderLine();
    List result = parseData();
    in.close();
    in = null;
    team = null;
    return result;
}
Also used : BufferedReader(java.io.BufferedReader) FileReader(java.io.FileReader) ArrayList(java.util.ArrayList) List(java.util.List) LinkedList(java.util.LinkedList) TeamMemberList(teamdash.team.TeamMemberList)

Example 8 with TeamMemberList

use of teamdash.team.TeamMemberList in project processdash by dtuma.

the class CsvNodeDataImporterUI method run.

public void run(WBSJTable table, DataTableModel data, TeamMemberList team) {
    File f = selectFile(table);
    if (f == null)
        return;
    List newNodes = null;
    try {
        CsvNodeDataImporter importer = new CsvNodeDataImporter();
        newNodes = importer.getNodesFromCsvFile(f, team);
    } catch (IOException e) {
        showError("Could not open and read from the file '" + f + "'");
    } catch (ParseException e) {
        showError(e.getMessage());
    }
    if (newNodes == null)
        return;
    WBSModel model = (WBSModel) table.getModel();
    newNodes = WBSNode.cloneNodeList(newNodes, model);
    int[] newRows = model.insertNodes(newNodes, model.getRowCount());
    if (newRows == null || newRows.length == 0)
        return;
    storeExtraNodeAttributes(model, data, newRows);
    table.selectRows(newRows);
    table.scrollRectToVisible(table.getCellRect(newRows[0], 0, true));
    UndoList.madeChange(table, "Import from CSV File");
}
Also used : List(java.util.List) TeamMemberList(teamdash.team.TeamMemberList) IOException(java.io.IOException) ParseException(teamdash.wbs.CsvNodeDataImporter.ParseException) File(java.io.File)

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