Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.SimpleData


    }

    private static void checkAlreadyJoined(DashboardContext ctx,
            PropertyKey key, String projectID) {
        String dataName = DataRepository.createDataName(key.path(), PROJECT_ID);
        SimpleData sd = ctx.getData().getSimpleValue(dataName);
        if (sd != null && projectID.equals(sd.format())) {
            throw new AlreadyJoinedException();

        } else {
            DashHierarchy hier = ctx.getHierarchy();
            int i = hier.getNumChildren(key);
View Full Code Here


    /** Write the CGI header. */
    protected void writeHeader() {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        String dataName = DataRepository.createDataName(prefix, DATA_NAME);
        SimpleData d = data.getSimpleValue(dataName);
        String subsetPrefix = null;
        if (d != null) subsetPrefix = d.format();
        if (subsetPrefix == null || subsetPrefix.length() == 0)
            subsetPrefix = DEFAULT_PREFIX;

        out.print("Location: ");
        out.print(WebServer.urlEncodePath(subsetPrefix));
View Full Code Here

        while (path != null) {
            // first, check for a setting pointing to a defined standard.
            String settingDataName = DataRepository.createDataName(path,
                    SETTING_DATA_NAME);
            SimpleData d = data.getSimpleValue(settingDataName);
            if (d != null && d.test()) {
                String defectTypeName = d.format();
                if (defectTypeName.trim().length() > 0)
                    return getByName(defectTypeName, data);
            }

            // next, check for an ad-hoc standard, specified directly for this
            // particular path
            String contentDataName = DataRepository.createDataName(path,
                    CONTENTS_DATA_NAME);
            d = data.getSimpleValue(contentDataName);
            if (d != null && d.test())
                return getFromContents(d.format());
           
            // no luck - move up the hierarchy
            path = DataRepository.chopPath(path);
        }
View Full Code Here

            return mostPreferredName;

        String bestName = DEFAULT_NAME;
        double bestPriority = -1;
        for (String oneName : getDefinedStandards(data)) {
            SimpleData sd = data.getSimpleValue(PRIORITY_PREFIX + oneName);
            if (sd instanceof DoubleData) {
                double onePriority = ((DoubleData) sd).getDouble();
                if (onePriority > bestPriority) {
                    bestName = oneName;
                    bestPriority = onePriority;
View Full Code Here

        data = r;
        if (path == null) path = "";
       
        // check for a user setting pointing to a defined standard
        String dataName = DataRepository.createDataName(path, SETTING_DATA_NAME);
        SimpleData d = data.getSimpleValue(dataName);
        if (d != null && d.test()) {
            String result = d.format().trim();
            if (result.length() > 0)
                return result;
        }

        // check for an ad-hoc, inline standard
        dataName = DataRepository.createDataName(path, CONTENTS_DATA_NAME);
        d = data.getSimpleValue(dataName);
        if (d != null && d.test()) {
            String result = getFromContents(d.format()).getName();
            if (result != null)
                result = " " + result;
            return result;
        }
View Full Code Here

    protected boolean hasValue(String name) {
        String prefix = (String) env.get("PATH_TRANSLATED");
        DataRepository data = getDataRepository();

        String dataName = DataRepository.createDataName(prefix, name);
        SimpleData value = data.getSimpleValue(dataName);
        return (value != null && value.test());
    }
View Full Code Here

     * @param dataNameSuffix the suffix that was used to generate the token
     * @since 1.14.0.1
     */
    protected String getPostToken(String dataNameSuffix) {
        String dataName = getPostTokenDataName(dataNameSuffix);
        SimpleData storedToken = getDataRepository().getSimpleValue(dataName);
        SimpleData storedDate = getDataRepository().getSimpleValue(dataName+"/TS");
        if (storedToken != null && storedDate instanceof DateData) {
            DateData date = (DateData) storedDate;
            long age = System.currentTimeMillis() - date.getValue().getTime();
            if (age > 0 && age < getPostTokenAgeTimeout())
                return storedToken.format();
View Full Code Here

    @Override
    protected void writeContents() throws IOException {
        // First, look at the project which is invoking this script, and see
        // if it is preceded by a PSP0 program. If not, print nothing and exit.
        DataContext data = getDataContext();
        SimpleData prevProgramVal = data.getSimpleValue("Previous_Program");
        if (!hasValue(prevProgramVal))
            return;

        String prevProgram = prevProgramVal.format();
        SimpleData psp0tag = data.getSimpleValue(prevProgram + "/PSP0");
        if (!hasValue(psp0tag))
            return;

        // Next, check to see if size data has been entered for the preceding
        // PSP0 program. If it has, print nothing and exit.
        SimpleData psp0size = data.getSimpleValue(prevProgram
                + "/New & Changed LOC");
        if (hasValue(psp0size))
            return;

        // At this point, we know this project is preceded by a PSP0 program
View Full Code Here

        return true;
    }
   
    private void addTaskListNames(ExportedDataValue val) {
        SimpleData d = val.getSimpleValue();
        if (!d.test())
            return;
       
        ListData list = null;
        if (d instanceof ListData)
            list = (ListData) d;
View Full Code Here

        Object value = parameters.get(name);
        return (value != null && !"".equals(value));
    }
   
    protected double getDoubleData(String name) {
        SimpleData val = getDataContext().getSimpleValue(name);
        if (val instanceof DoubleData)
            return ((DoubleData) val).getDouble();
        else
            return 0;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.data.SimpleData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.