Search in sources :

Example 76 with SimpleData

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

the class EVTaskListData method findTasksInHierarchy.

private void findTasksInHierarchy(SortedMap tasks, String ordinalDataName, PropertyKey key) {
    String path = key.path();
    String dataName = DataRepository.createDataName(path, ordinalDataName);
    SimpleData value = data.getSimpleValue(dataName);
    if (value != null)
        tasks.put(value, path);
    for (int i = 0; i < hierarchy.getNumChildren(key); i++) findTasksInHierarchy(tasks, ordinalDataName, hierarchy.getChildKey(key, i));
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData)

Example 77 with SimpleData

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

the class EVTaskListData method getSchedule.

private EVSchedule getSchedule(DataRepository data, String taskListName) {
    String globalPrefix = MAIN_DATA_PREFIX + taskListName;
    String dataName = DataRepository.createDataName(globalPrefix, EST_HOURS_DATA_NAME);
    SimpleData d = data.getSimpleValue(dataName);
    if (d instanceof StringData)
        d = ((StringData) d).asList();
    if (d instanceof ListData) {
        String lockedName = DataRepository.createDataName(globalPrefix, DATES_LOCKED_DATA_NAME);
        SimpleData l = data.getSimpleValue(lockedName);
        boolean locked = (l != null && l.test());
        return new EVSchedule((ListData) d, locked);
    } else
        return new EVSchedule();
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) StringData(net.sourceforge.processdash.data.StringData) ListData(net.sourceforge.processdash.data.ListData)

Example 78 with SimpleData

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

the class EVTaskListRollup method addTaskListsFromData.

private void addTaskListsFromData(DataRepository data, DashHierarchy hierarchy, ObjectCache cache, String taskListName, boolean willNeedChangeNotification) {
    String globalPrefix = MAIN_DATA_PREFIX + taskListName;
    String dataName = DataRepository.createDataName(globalPrefix, TASK_LISTS_DATA_NAME);
    SimpleData listVal = data.getSimpleValue(dataName);
    ListData list = null;
    if (listVal instanceof ListData)
        list = (ListData) listVal;
    else if (listVal instanceof StringData)
        list = ((StringData) listVal).asList();
    if (list == null)
        return;
    for (int i = 0; i < list.size(); i++) {
        taskListName = (String) list.get(i);
        EVTaskList taskList = openTaskListToAdd(taskListName, data, hierarchy, cache, willNeedChangeNotification);
        if (taskList == null) {
            if (EVTaskListXML.validName(taskListName))
                taskList = new EVTaskListXML(taskListName);
            else
                continue;
        }
        if (((EVTask) root).add((EVTask) taskList.getRoot()))
            evTaskLists.add(taskList);
    }
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) StringData(net.sourceforge.processdash.data.StringData) ListData(net.sourceforge.processdash.data.ListData)

Example 79 with SimpleData

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

the class TaskListAltererMessageHandler method pathMatchesProjectID.

private boolean pathMatchesProjectID(String path, String projectID) {
    String dataName = DataRepository.createDataName(path, PROJECT_ID_DATA_NAME);
    SimpleData sd = ctx.getData().getSimpleValue(dataName);
    return (sd != null && projectID.equals(sd.format()));
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData)

Example 80 with SimpleData

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

the class OpenTimeLogEditor method augmentHierarchy.

private void augmentHierarchy(DashHierarchy hier, PropertyKey node, DataRepository data) {
    String path = node.path();
    String dataName = DataRepository.createDataName(path, "Project_Component_Info");
    SimpleData val = data.getSimpleValue(dataName);
    if (val == null)
        return;
    try {
        Element xml = XMLUtils.parse(val.format()).getDocumentElement();
        augmentHierarchy(hier, node, xml);
    } catch (Exception e) {
    }
}
Also used : Element(org.w3c.dom.Element) SimpleData(net.sourceforge.processdash.data.SimpleData) IOException(java.io.IOException)

Aggregations

SimpleData (net.sourceforge.processdash.data.SimpleData)164 ListData (net.sourceforge.processdash.data.ListData)20 DoubleData (net.sourceforge.processdash.data.DoubleData)15 SaveableData (net.sourceforge.processdash.data.SaveableData)14 StringData (net.sourceforge.processdash.data.StringData)13 IOException (java.io.IOException)11 DataRepository (net.sourceforge.processdash.data.repository.DataRepository)11 DateData (net.sourceforge.processdash.data.DateData)10 Iterator (java.util.Iterator)9 List (java.util.List)7 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)7 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 ImmutableDoubleData (net.sourceforge.processdash.data.ImmutableDoubleData)6 NumberData (net.sourceforge.processdash.data.NumberData)6 Element (org.w3c.dom.Element)6 Map (java.util.Map)5 DataContext (net.sourceforge.processdash.data.DataContext)5 EscapeString (net.sourceforge.processdash.util.EscapeString)5 File (java.io.File)4