use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class DefectUtil method getWorkflowID.
private static String getWorkflowID(DataContext data, String path) {
String dataName = DataRepository.createDataName(path, TeamDataConstants.WORKFLOW_ID_DATA_NAME);
SimpleData sd = data.getSimpleValue(dataName);
if (sd == null)
return null;
String result = sd.format();
int commaPos = result.indexOf(',');
return (commaPos == -1 ? result : result.substring(0, commaPos));
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class ImportedDefectManager method getWbsSubcomponentInfo.
private static Map getWbsSubcomponentInfo(DataRepository data, String path, String wbsId) {
String dataName = DataRepository.createDataName(path, "Project_Component_Info");
SimpleData val = data.getSimpleValue(dataName);
if (val == null)
return null;
Element xml;
try {
xml = XMLUtils.parse(val.format()).getDocumentElement();
} catch (Exception e) {
return null;
}
Map result = new HashMap();
getWbsComponentInfo(result, xml, path, wbsId);
return result;
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class ImportedDefectManager method rerootPath.
private static String rerootPath(DataRepository data, String defectPath, Map wbsIdMap) {
SaveableData wbsIdValue = data.getInheritableValue(defectPath, "Project_WBS_ID");
if (wbsIdValue == null)
return defectPath;
SimpleData wbsIdSimpleValue = wbsIdValue.getSimpleValue();
if (wbsIdSimpleValue == null)
return defectPath;
String wbsID = wbsIdSimpleValue.format();
while (wbsID != null && wbsID.length() > 0) {
String result = (String) wbsIdMap.get(wbsID);
if (result != null)
return result;
wbsID = DataRepository.chopPath(wbsID);
}
return defectPath;
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class TeamStartBootstrap method getValue.
/** Get a value from the data repository. */
protected String getValue(String name) {
DataRepository data = getDataRepository();
String prefix = getPrefix();
if (prefix == null)
prefix = "";
String dataName = DataRepository.createDataName(prefix, name);
SimpleData d = data.getSimpleValue(dataName);
return (d == null ? null : d.format());
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class TeamStartNotifier method getStorageDataName.
private static String getStorageDataName(DashboardContext ctx, String projectID) {
String result = null;
// check to see if any pending invitations are currently stored.
for (int i = MAX_OUTSTANDING_INVITES; i-- > 0; ) {
String dataName = DATA_PREFIX + i + DATA_SUFFIX;
SimpleData preexistingInvitation = ctx.getData().getSimpleValue(dataName);
if (preexistingInvitation == null) {
// if there is no invitation with this data name, we can
// store our new invitation here.
result = dataName;
} else {
// overwriting the old invitation.
try {
String preexistingProjectID = XMLUtils.parse(preexistingInvitation.format()).getDocumentElement().getAttribute(PROJECT_ID);
if (projectID.equals(preexistingProjectID))
return dataName;
} catch (Exception e) {
}
}
}
return result;
}
Aggregations