Examples of ListData


Examples of net.sourceforge.processdash.data.ListData

                listNames.put(rsse, listName);
            }
        }

        // fetch the value of the named list.
        ListData result = lookupList(data, listName);

        // if the named list has no value yet, create the value and
        // save it in the repository.
        if (result == null) synchronized (listName) {
            result = lookupList(data, listName);
            if (result == null) {
                String expression = rsse.buildExpression();

                try {
                    data.putExpression(listName, "", expression);
                } catch (MalformedValueException mve) {
                    System.err.println("malformed value!");
                    data.putValue(listName, new ListData());
                }
                data.addDataListener(listName, NULL_LISTENER);
                result = lookupList(data, listName);
            }
        }
View Full Code Here

Examples of net.sourceforge.processdash.data.ListData

    private static ListData getFilteredList(DataRepository data,
                                            String forParam,
                                            String[] conditions,
                                            String orderBy,
                                            String basePrefix) {
        ListData result;
            // if the "for" parameter is missing or is simply ".", then
            // return a list containing only one element - the base prefix.
        if (forParam == null ||
            forParam.length() == 0 ||
            forParam.equals(".")) {
            result = new ListData();
            result.add(basePrefix);

            // if the for parameter specifies a data list rather than
            // a tag name, or if the base prefix is empty, return all the
            // items in the list in question.
        } else if (basePrefix == null || basePrefix.length() == 0 ||
                   !forParamIsTagName(forParam)) {
            result =
                getList(data, forParam, conditions, orderBy, basePrefix);

            // otherwise, get the appropriate prefix list, and create
            // a filtered copy containing only those prefixes that
            // start with the base prefix.
        } else {
            ListData fullPrefixList =
                getList(data, forParam, conditions, orderBy, basePrefix);
            result = new ListData();
            String item;
            for (int i = 0;   i < fullPrefixList.size();   i++) {
                item = (String) fullPrefixList.get(i);
                if (item.equals(basePrefix) ||
                    item.startsWith(basePrefix + "/"))
                    result.add(item);
            }
        }
View Full Code Here

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

Examples of net.sourceforge.processdash.data.ListData

    }

    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

Examples of net.sourceforge.processdash.data.ListData

     *  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

Examples of net.sourceforge.processdash.data.ListData

        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

Examples of net.sourceforge.processdash.data.ListData

                           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

Examples of net.sourceforge.processdash.data.ListData

            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

Examples of net.sourceforge.processdash.data.ListData

   
    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

Examples of net.sourceforge.processdash.data.ListData

    }

    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
TOP
Copyright © 2018 www.massapi.com. 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.