Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.ListData


    public static void removeTaskID(DataContext data, String taskPath, String id) {
        String dataName = DataRepository.createDataName(taskPath,
                TASK_ID_DATA_NAME);
        SimpleData currentValue = data.getSimpleValue(dataName);
        ListData list = null;
       
        if (currentValue instanceof ListData)
            list = (ListData) currentValue;
        else if (currentValue instanceof StringData)
            list = ((StringData) currentValue).asList();
       
        if (list != null && list.remove(id))
            data.putValue(dataName, list);
    }
View Full Code Here


   
    public static List getTaskIDs(DataContext data, String taskPath) {
        String dataName = DataRepository.createDataName(taskPath,
                TASK_ID_DATA_NAME);
        SimpleData currentValue = data.getSimpleValue(dataName);
        ListData list = null;
       
        if (currentValue == null || currentValue.test() == false)
            return null;
        if (currentValue instanceof ListData)
            list = (ListData) currentValue;
        else if (currentValue instanceof StringData)
            list = ((StringData) currentValue).asList();
        else
            return null;
       
        List result = new LinkedList();
        for (int i = 0;  i < list.size();  i++)
            result.add(list.get(i));
        if (!result.isEmpty())
            return result;
        else
            return null;
    }
View Full Code Here

        return getDatabasePlugin(data, false);
    }

    public static DatabasePlugin getDatabasePlugin(DataContext data,
            boolean waitForAllProjects) {
        ListData pluginItem = (ListData) data
                .getValue(DatabasePlugin.DATA_REPOSITORY_NAME);
        if (pluginItem == null)
            return null;

        DatabasePlugin databasePlugin = (DatabasePlugin) pluginItem.get(0);
        if (waitForAllProjects)
            waitForAllProjects(databasePlugin);
        return databasePlugin;
    }
View Full Code Here

    }


    public boolean parseFormData() {
        // From the posted data, create the effective list of projects.
        ListData probeList = new ListData();
        int r = 1;
        while (true) {
            String taskName = (String) params.get(TASK_FIELD+r);
            if (taskName == null) break;
            if (params.get(EXCLUDE_FIELD+r) == null)
                probeList.add(taskName);
            r++;
        }

        // save that list to the PROBE_SUBSET for this project.
        putValue(ProbeData.PROBE_LIST_NAME, probeList);
View Full Code Here

    private List getProjectSpecificCriteria(FilterMode filterMode) {
        // If the caller has requested comprehensive filtering, use the
        // complete filter criteria for the current project.
        if (filterMode == FilterMode.ALL) {
            ListData filter = ListData.asListData(ctx.getData()
                    .getInheritableValue(prefix, "DB_Filter_Criteria"));
            if (filter != null)
                return filter.asList();
        }

        // otherwise, construct a filter limiting to the current project.
        List result = new ArrayList();
        result.add(QueryUtils.PROJECT_CRITERIA);

        ListData filter = ListData.asListData(ctx.getData()
                .getInheritableValue(prefix, "DB_Project_Keys"));
        if (filter != null)
            result.addAll(filter.asList());

        return result;
    }
View Full Code Here

    private void lookupObjects() {
        DatabasePlugin db = require(QueryUtils.getDatabasePlugin(data));
        query = require(db.getObject(QueryRunner.class));

        ListData hierItem = (ListData) data
                .getSimpleValue(DashHierarchy.DATA_REPOSITORY_NAME);
        hier = (DashHierarchy) hierItem.get(0);

        projectID = DataRepository
                .getInheritableValue(data, new StringBuffer(onePath),
                    PROJECT_ID).getSimpleValue().format();
        db.getObject(ProjectLocator.class).getKeyForProject(projectID, null);
View Full Code Here

     */
    public void startOneTimeExportOperation() {
        SimpleData histList = data
                .getSimpleValue(HISTORICALLY_EXPORTED_DATANAME);
        if (histList instanceof ListData)
            histList = new ListData((ListData) histList);
        this.originalHistList = histList;
    }
View Full Code Here

        //  export task.
        data.putValue(CURRENT_EXPORTED_FILES_DATANAME, null);
    }
   
    public void finishExportAllOperation() {
        ListData currentExportedFiles =
            ListData.asListData(data.getValue(CURRENT_EXPORTED_FILES_DATANAME));
        ListData historicallyExportedFiles =
            ListData.asListData(data.getValue(HISTORICALLY_EXPORTED_DATANAME));
       
        if (historicallyExportedFiles != null && currentExportedFiles != null) {
            // After this method call, historicallyExportedFiles wont contain filenames
            //  that are not in currentExportedFiles.
View Full Code Here

        recordExportedFile(data, HISTORICALLY_EXPORTED_DATANAME, path);
    }

    private static void recordExportedFile(DataContext data, String list,
            String path) {
        ListData exportedFiles = ListData.asListData(data.getValue(list));
       
        if (exportedFiles == null) {
            exportedFiles = new ListData();
        }
       
        exportedFiles.setAdd(normalize(path));
        data.putValue(list, exportedFiles);
    }
View Full Code Here

        if (hasAppraisal && hasFailure)
            writeChartHTML(LINE_CHART, TOTAL_COQ_CHART);
        if (hasAFR)
            writeChartHTML(LINE_CHART, AFR_CHART);

        ListData mainAppraisalPhases = getMainAppraisalPhases();
        if (mainAppraisalPhases.size() > 0) {
            writeChartHTML(LINE_CHART, REVIEW_RATE_CHART);
            for (int i = 0;   i < mainAppraisalPhases.size();   i++) {
                if (hasYield)
                    writeChartHTML(XY_CHART, REV_RATE_VS_PROC_YIELD,
                                   fmtArg("phase", mainAppraisalPhases.get(i)));
                writeChartHTML(XY_CHART, REV_RATE_VS_PHASE_YIELD,
                               fmtArg("phase", mainAppraisalPhases.get(i)));
            }
            if (hasYield && mainAppraisalPhases.size() > 1)
                writeChartHTML(XY_CHART, COMBINED_REV_RATE_VS_PROC_YIELD);
        }

        out.write("</body></html>\n");
    }
View Full Code Here

TOP

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

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.