Search in sources :

Example 11 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository 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 12 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class TeamProjectSetupWizard method createTeamSchedule.

protected String createTeamSchedule(String scheduleName) {
    DataRepository data = getDataRepository();
    EVTaskListRollup rollup = new EVTaskListRollup(scheduleName, data, getPSPProperties(), getObjectCache(), false);
    rollup.save();
    // publish the newly created schedule, with no password required.
    String passwordDataName = "/ev /" + scheduleName + "/_Password_";
    data.putValue(passwordDataName, ImmutableDoubleData.TRUE);
    passwordDataName = "/ev /" + scheduleName + "/PW_STOR";
    data.putValue(passwordDataName, StringData.create(" none "));
    return rollup.getID();
}
Also used : EVTaskListRollup(net.sourceforge.processdash.ev.EVTaskListRollup) DataRepository(net.sourceforge.processdash.data.repository.DataRepository)

Example 13 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class TeamProjectSetupWizard method getSimpleValue.

/** Get a value from the data repository. */
protected SimpleData getSimpleValue(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;
}
Also used : DataRepository(net.sourceforge.processdash.data.repository.DataRepository) SimpleData(net.sourceforge.processdash.data.SimpleData)

Example 14 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class TeamProjectSetupWizard method handleTeamSchedulePage.

/** Handle values posted from the team schedule name page */
protected void handleTeamSchedulePage() {
    String scheduleName = getParameter("scheduleName");
    if (scheduleName == null || scheduleName.trim().length() == 0) {
        printRedirect(TEAM_SCHEDULE_URL + "?missing");
        return;
    }
    scheduleName = scheduleName.trim();
    putValue(TEAM_SCHEDULE, scheduleName);
    if (!EVTaskListRollup.validName(scheduleName)) {
        printRedirect(TEAM_SCHEDULE_URL + "?invalid");
        return;
    }
    DataRepository data = getDataRepository();
    if (EVTaskListData.exists(data, scheduleName) || EVTaskListRollup.exists(data, scheduleName))
        printRedirect(TEAM_SCHEDULE_URL + "?duplicate");
    else
        showTeamConfirmPage();
}
Also used : DataRepository(net.sourceforge.processdash.data.repository.DataRepository)

Example 15 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class ExportManager method getExportInstructionsFromData.

private Collection getExportInstructionsFromData() {
    Collection result = new LinkedList();
    DataRepository data = dashboard.getData();
    Object hints = new DataNameFilter.PrefixLocal() {

        public boolean acceptPrefixLocalName(String p, String localName) {
            return localName.endsWith(EXPORT_DATANAME);
        }
    };
    for (Iterator iter = data.getKeys(null, hints); iter.hasNext(); ) {
        String name = (String) iter.next();
        AbstractInstruction instr = getExportInstructionFromData(name);
        if (instr != null)
            result.add(instr);
    }
    return result;
}
Also used : Iterator(java.util.Iterator) Collection(java.util.Collection) DataRepository(net.sourceforge.processdash.data.repository.DataRepository) LinkedList(java.util.LinkedList)

Aggregations

DataRepository (net.sourceforge.processdash.data.repository.DataRepository)37 SimpleData (net.sourceforge.processdash.data.SimpleData)11 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)4 IOException (java.io.IOException)3 ListData (net.sourceforge.processdash.data.ListData)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 StringData (net.sourceforge.processdash.data.StringData)2 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1