use of net.sourceforge.processdash.data.SimpleData 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.SimpleData in project processdash by dtuma.
the class DefaultDataExportFilter method processMaxDate.
private void processMaxDate(ExportedDataValue v) {
String name = v.getName();
if (name.endsWith("/Started") || name.endsWith("/Completed")) {
SimpleData value = v.getSimpleValue();
if (value instanceof DateData) {
Date thisDate = ((DateData) value).getValue();
maxDate = DateUtils.maxDate(maxDate, thisDate);
}
}
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class DefaultTaskLabeler method loadMilestoneData.
private void loadMilestoneData(String path) {
String dataName = DataRepository.createDataName(path, MILESTONES_DATA_NAME);
SimpleData val = data.getSimpleValue(dataName);
if (val == null || !val.test())
return;
Element xml;
try {
xml = XMLUtils.parse(val.format()).getDocumentElement();
} catch (Exception e) {
return;
}
maybeListenForDataChanges(dataName);
XmlMilestone previous = null;
for (Element m : XMLUtils.getChildElements(xml)) {
XmlMilestone xm = new XmlMilestone(m, milestoneData.size());
String id = xm.getMilestoneID();
if (XMLUtils.hasValue(id)) {
milestoneData.put(id, xm);
xm.setPrevious(previous);
previous = xm;
}
}
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class HierarchyNoteManager method getNotesForPath.
public static Map<String, HierarchyNote> getNotesForPath(DataContext data, String path, boolean ignoreBlank) {
String dataName = DataRepository.createDataName(path, TEAM_NOTE_DATA_NAME);
SimpleData val = data.getSimpleValue(dataName);
if (val == null)
return null;
Map<String, HierarchyNote> result;
result = new LinkedHashMap<String, HierarchyNote>();
try {
result.put(NOTE_KEY, new HierarchyNote(val));
dataName = DataRepository.createDataName(path, TEAM_NOTE_CONFLICT_DATA_NAME);
val = data.getSimpleValue(dataName);
if (val != null)
result.put(NOTE_CONFLICT_KEY, new HierarchyNote(val));
dataName = DataRepository.createDataName(path, TEAM_NOTE_LAST_SYNC_DATA_NAME);
val = data.getSimpleValue(dataName);
if (val != null)
result.put(NOTE_BASE_KEY, new HierarchyNote(val));
if (ignoreBlank && isOnlyIgnorableBlankNote(result))
return null;
return result;
} catch (InvalidNoteSpecification e) {
e.printStackTrace();
return null;
}
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class HierarchyNoteManager method saveNotesForPath.
public static void saveNotesForPath(DataContext data, String path, Map<String, HierarchyNote> noteData) {
for (Map.Entry<String, HierarchyNote> e : noteData.entrySet()) {
String dataName = null;
if (NOTE_KEY.equals(e.getKey()))
dataName = TEAM_NOTE_DATA_NAME;
else if (NOTE_CONFLICT_KEY.equals(e.getKey()))
dataName = TEAM_NOTE_CONFLICT_DATA_NAME;
else if (NOTE_BASE_KEY.equals(e.getKey()))
dataName = TEAM_NOTE_LAST_SYNC_DATA_NAME;
if (dataName != null) {
SimpleData val = null;
if (e.getValue() instanceof HierarchyNote) {
HierarchyNote note = (HierarchyNote) e.getValue();
// data if it is missing
if (dataName == TEAM_NOTE_DATA_NAME) {
if (note.getTimestamp() == null)
note.setTimestamp(new Date());
if (note.getAuthor() == null)
note.setAuthor(ProcessDashboard.getOwnerName(data));
}
val = (note).getAsData();
}
String fullDataName = DataRepository.createDataName(path, dataName);
data.putValue(fullDataName, val);
}
}
notifyListeners(path);
}
Aggregations