Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.ListData


    /** Perform a query and return a result set. */
    public static ResultSet get(DataRepository data, String forParam,
                                String[] conditions, String orderBy,
                                String[] dataNames, String basePrefix) {
        // get the list of prefixes
        ListData prefixList = getFilteredList(data, forParam, conditions,
                                              orderBy, basePrefix);

        // Create a result set to return
        ResultSet result = new ResultSet(prefixList.size(), dataNames.length);

        // write the column headers into the result set.
        result.setColName(0, null);
        for (int i=0;  i < dataNames.length;  i++)
            result.setColName(i+1, dataNames[i]);

        // get the data and fill the result set.
        String prefix, dataName;
        if (basePrefix == null) basePrefix = "";
        int baseLen = basePrefix.length();
        if (baseLen > 0) baseLen++; // remove / as well

        for (int p=0;  p < prefixList.size();  p++) {
            // get the next prefix
            Object pfx = prefixList.get(p);
            if (pfx instanceof String)
                prefix = (String) pfx;
            else if (pfx instanceof SimpleData)
                prefix = ((SimpleData) pfx).format();
            else
View Full Code Here


    }

    private static ResultSet getResultSetFromRepository(DataRepository data,
            String prefix, String useParam) {
        String dataName = DataRepository.createDataName(prefix, useParam);
        ListData l = ListData.asListData(data.getSimpleValue(dataName));
        if (l != null && l.size() == 1)
            return (ResultSet) l.get(0);
        else
            return null;
    }
View Full Code Here

     *  a result set.
     */
    public static String[] getPrefixList(DataRepository data,
                                         Map queryParameters,
                                         String prefix) {
        ListData list =  getFilteredList(data,
                                         getForParam(queryParameters),
                                         getConditions(queryParameters),
                                         getOrderBy(queryParameters),
                                         prefix);
        int i = list.size();
        String [] result = new String[i];
        while (i-- > 0) result[i] = asString(list.get(i));
        return result;
    }
View Full Code Here

        if (pspChildPos == -1)
            return;

        // get a list of the official, acceptable phases in the controlling
        // process definition.
        ListData phaseListSpec = onePmTask.getAcceptableNodeTypes();
        if (phaseListSpec == null || !phaseListSpec.test())
            return;
        List phaseList = phaseListSpec.asList();
        int postmortemPos = phaseList.indexOf("Postmortem");
        if (postmortemPos == -1)
            return;

        // find the tasks that immediately follow this postmortem task which
View Full Code Here

                           Map queryParameters,
                           Task t) {

        if (queryParameters.containsKey(DB_MODE_PARAM)) {
            DatabasePlugin plugin = QueryUtils.getDatabasePlugin(data);
            ListData criteria = getDatabaseCriteria(data, prefix,
                queryParameters);
            if (plugin != null && criteria != null)
                ImportedDefectManager.run(plugin, criteria.asList(), t);

        } else {
            String [] prefixes = ResultSet.getPrefixList
                    (data, queryParameters, prefix);
            boolean includeChildren = !queryParameters.containsKey(NO_CHILDREN_PARAM);
View Full Code Here

            String prefix, Map queryParameters) {
        String dataName = (String) queryParameters.get("for");
        if (dataName.startsWith("[") && dataName.endsWith("]"))
            dataName = dataName.substring(1, dataName.length() - 1);
        dataName = DataRepository.createDataName(prefix, dataName);
        ListData criteria = ListData.asListData(data.getSimpleValue(dataName));
        return criteria;
    }
View Full Code Here

   
    protected static Enumeration getInheritedPhaseList(String defectPath,
            DataRepository data) {
        Object inheritedPhaseList = data.getInheritableValue
            (defectPath, "Effective_Defect_Phase_List");
        ListData list = null;
        if (inheritedPhaseList instanceof ListData)
            list = (ListData) inheritedPhaseList;
        else if (inheritedPhaseList instanceof StringData)
            list = ((StringData) inheritedPhaseList).asList();

        if (list == null)
            return null;

        Vector result = new Vector();
        for (int i = 0;   i < list.size();   i++)
            result.add(list.get(i).toString());
        return result.elements();
    }
View Full Code Here

    }

    private void markExclusions(DataRepository data, String prefix,
                                boolean clearOutlierMarks) {
        SimpleData d = null;
        ListData l = null;
        if (!clearOutlierMarks) {
            String dataName = DataRepository.createDataName(prefix, PROBE_LIST_NAME);
            d = data.getSimpleValue(dataName);
            if (d instanceof ListData) l = (ListData) d;
            else if (d instanceof StringData) l = ((StringData) d).asList();
        }

        if (clearOutlierMarks || l == null) {
            for (int row = resultSet.numRows();   row > 0;   row--)
                resultSet.setData(row, EXCLUDE, null);

        } else {
            for (int row = resultSet.numRows();   row > 0;   row--) {
                prefix = getRowId(row);
                resultSet.setData
                    (row, EXCLUDE,
                     l.contains(prefix) ? null : TagData.getInstance());
            }
        }
    }
View Full Code Here

    }
   
    public String storeChartData(ResultSet chartData, ProbeMethod method) {
        String dataName = "PROBE_Chart_Data///" + method.getMethodLetter()
                + "_" + method.methodPurpose.getKey();
        ListData l = new ListData();
        l.add(chartData);
        data.putValue(DataRepository.createDataName(prefix, dataName), l);
        return dataName;
    }
View Full Code Here

                                      boolean willNeedChangeNotification) {
        String globalPrefix = MAIN_DATA_PREFIX + taskListName;
        String dataName =
            DataRepository.createDataName(globalPrefix, TASK_LISTS_DATA_NAME);
        SimpleData listVal = data.getSimpleValue(dataName);
        ListData list = null;
        if (listVal instanceof ListData)
            list = (ListData) listVal;
        else if (listVal instanceof StringData)
            list = ((StringData) listVal).asList();

        if (list == null) return;
        for (int i = 0;   i < list.size();   i++) {
            taskListName = (String) list.get(i);
            EVTaskList taskList = openTaskListToAdd(taskListName, data,
                    hierarchy, cache, willNeedChangeNotification);
            if (taskList == null) {
                if (EVTaskListXML.validName(taskListName))
                    taskList = new EVTaskListXML(taskListName);
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.