Search in sources :

Example 51 with SimpleData

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));
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData)

Example 52 with SimpleData

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;
}
Also used : HashMap(java.util.HashMap) Element(org.w3c.dom.Element) SimpleData(net.sourceforge.processdash.data.SimpleData) HashMap(java.util.HashMap) Map(java.util.Map)

Example 53 with SimpleData

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;
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) SaveableData(net.sourceforge.processdash.data.SaveableData)

Example 54 with SimpleData

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());
}
Also used : DataRepository(net.sourceforge.processdash.data.repository.DataRepository) SimpleData(net.sourceforge.processdash.data.SimpleData)

Example 55 with SimpleData

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;
}
Also used : SimpleData(net.sourceforge.processdash.data.SimpleData) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException)

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