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));
}
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();
}
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);
}
}
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()));
}
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) {
}
}
Aggregations