Search in sources :

Example 71 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class ConvertTeamProjectMCF method setupProcessConversionOptions.

private void setupProcessConversionOptions() throws MigrationException {
    Map<String, String> processes = getTeamProcessIDs();
    ListData pidList = new ListData();
    for (Map.Entry<String, String> e : processes.entrySet()) {
        String onePID = e.getKey();
        String oneName = e.getValue();
        if (processID.equals(onePID))
            continue;
        pidList.add(onePID);
        putStringValue(DISPLAY_DATA_NAME_PREFIX + onePID, oneName);
    }
    if (pidList.size() == 0)
        throw new MigrationException("noOtherTeamProcesses");
    putSimpleValue(ID_LIST_DATA_NAME, pidList);
}
Also used : HashMap(java.util.HashMap) Map(java.util.Map) ListData(net.sourceforge.processdash.data.ListData)

Example 72 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class MoveProjectWizard method getOutOfDateTeamMembers.

private ListData getOutOfDateTeamMembers() throws Exception {
    ListData result = new ListData();
    String uri = resolveRelativeURI("teamMetricsStatus");
    uri = uri + "?for=Corresponding_Project_Nodes&xml";
    String xml = getRequestAsString(uri);
    NodeList nl = XMLUtils.parse(xml).getElementsByTagName("member");
    for (int i = 0; i < nl.getLength(); i++) {
        Element m = (Element) nl.item(i);
        String version = m.getAttribute("dashVersion");
        if (DashPackage.compareVersions(version, "1.10.5") < 0)
            result.add(HTMLUtils.escapeEntities(m.getAttribute("name")));
    }
    return result;
}
Also used : NodeList(org.w3c.dom.NodeList) Element(org.w3c.dom.Element) ListData(net.sourceforge.processdash.data.ListData)

Example 73 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class GlobEngine method asCollection.

private static Collection asCollection(SimpleData data) {
    if (!data.test())
        return null;
    if (data instanceof StringData)
        data = ((StringData) data).asList();
    if (data instanceof ListData) {
        Collection words = new HashSet();
        words.addAll(((ListData) data).asList());
        return words;
    } else
        return asCollection(data.format());
}
Also used : Collection(java.util.Collection) StringData(net.sourceforge.processdash.data.StringData) ListData(net.sourceforge.processdash.data.ListData) HashSet(java.util.HashSet)

Example 74 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class EVSchedule method getPeriodNoteData.

public String getPeriodNoteData() {
    if (periodNotes == null || periodNotes.isEmpty())
        return null;
    ListData result = new ListData();
    for (Map.Entry<Date, String> e : periodNotes.entrySet()) {
        result.add(saveDate(e.getKey()));
        result.add(e.getValue());
    }
    return result.format();
}
Also used : Map(java.util.Map) TreeMap(java.util.TreeMap) SortedMap(java.util.SortedMap) Date(java.util.Date) ListData(net.sourceforge.processdash.data.ListData)

Example 75 with ListData

use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.

the class EVTaskDependency method removeTaskID.

public static void removeTaskID(DataContext data, String taskPath, String id) {
    String dataName = DataRepository.createDataName(taskPath, TASK_ID_DATA_NAME);
    SimpleData currentValue = data.getSimpleValue(dataName);
    ListData list = null;
    if (currentValue instanceof ListData)
        list = (ListData) currentValue;
    else if (currentValue instanceof StringData)
        list = ((StringData) currentValue).asList();
    if (list != null && list.remove(id))
        data.putValue(dataName, list);
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) StringData(net.sourceforge.processdash.data.StringData) ImmutableStringData(net.sourceforge.processdash.data.ImmutableStringData) ListData(net.sourceforge.processdash.data.ListData)

Aggregations

ListData (net.sourceforge.processdash.data.ListData)129 SimpleData (net.sourceforge.processdash.data.SimpleData)20 ArrayList (java.util.ArrayList)18 List (java.util.List)16 Iterator (java.util.Iterator)15 StringData (net.sourceforge.processdash.data.StringData)15 EVTaskListData (net.sourceforge.processdash.ev.EVTaskListData)9 Map (java.util.Map)8 HashSet (java.util.HashSet)7 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)6 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 LinkedList (java.util.LinkedList)5 DoubleData (net.sourceforge.processdash.data.DoubleData)5 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)5 LocalizedString (net.sourceforge.processdash.util.LocalizedString)5 NodeList (org.w3c.dom.NodeList)5 Date (java.util.Date)4 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)4 Element (org.w3c.dom.Element)4