use of net.sourceforge.processdash.data.StringData in project processdash by dtuma.
the class EVTaskDependency method addTaskIDs.
public static void addTaskIDs(DataContext data, String taskPath, String id) {
if (id == null || id.length() == 0)
return;
String dataName = DataRepository.createDataName(taskPath, TASK_ID_DATA_NAME);
SimpleData currentValue = data.getSimpleValue(dataName);
ListData newValue;
if (currentValue instanceof ListData)
newValue = (ListData) currentValue;
else if (currentValue instanceof StringData)
newValue = ((StringData) currentValue).asList();
else
newValue = new ListData();
boolean valueChanged = false;
String[] idList = id.split(",");
for (int i = 0; i < idList.length; i++) {
if (newValue.setAdd(idList[i]))
valueChanged = true;
}
if (valueChanged)
data.putValue(dataName, newValue);
}
use of net.sourceforge.processdash.data.StringData 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.StringData 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.StringData in project processdash by dtuma.
the class HierarchySynchronizer method getProcessDataList.
private List getProcessDataList(String name) {
List result = new LinkedList();
String dataName = "/" + processID + "/" + name;
SimpleData val = data.getSimpleValue(dataName);
if (val instanceof StringData)
val = ((StringData) val).asList();
if (val instanceof ListData) {
ListData l = (ListData) val;
for (int i = 0; i < l.size(); i++) result.add(l.get(i));
}
return result;
}
use of net.sourceforge.processdash.data.StringData in project processdash by dtuma.
the class DashboardTimeLogTest method createModels.
protected void createModels() throws Exception {
tempDir = createTempDir();
DashboardTimeLog dashboardTimeLog = new DashboardTimeLog(tempDir, data, hier);
String dataName = DataRepository.createDataName(PATH4, "Time");
data.putValue(dataName, new StringData("\"foo"));
approver = dashboardTimeLog;
timeLog = dashboardTimeLog;
timeLoggingModel = (DefaultTimeLoggingModel) dashboardTimeLog.getTimeLoggingModel();
}
Aggregations