Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.ListData


        }
        return result;
    }
   
    private void saveTaskLists(String newName, DataRepository data) {
        ListData list = null;
        if (newName != null) {
            list = new ListData();
            Iterator i = evTaskLists.iterator();
            while (i.hasNext())
                list.add(((EVTaskList) i.next()).taskListName);
        }

        persistDataValue(newName, data, TASK_LISTS_DATA_NAME, list);
    }
View Full Code Here


        // get the [Use_Rollup] data element for the current
        // project. If it is null, return immediately.
        String prefix = getPrefix();   if (prefix == null) return;
        String useRollupName = DataRepository.createDataName(prefix, "Use_Rollup");
        ListData rollupIDs = getList(data, useRollupName);
        if (rollupIDs == null) return;

        String tableStart = TABLE_START, tableEnd = "", tableRow;
        for (int i = 0;   i < rollupIDs.size();   i++) {
            tableRow = getFragment(data, rollupIDs.get(i).toString());
            if (tableRow != null && tableRow.length() > 0) {
                out.print(tableStart);
                out.print(tableRow);
                tableStart = ""; tableEnd = TABLE_END;
            }
View Full Code Here

        // lookup the data element [/ROLLUP_ID/Rollup Instance
        // List]. If it is missing or if it contains less than two
        // items, return an empty fragment (and save the empty
        // fragment to the cache).
        String instanceListName = rollupInstanceList(rollupID);
        ListData instanceList = getList(data, instanceListName);
        if (instanceList == null || instanceList.size() < 2)
            return CACHE.put(rollupID, "");

        // Construct an HTML fragment
        String prompt = resources.format("Rollup_Select_Prompt_FMT", rollupID);
        StringBuffer result = new StringBuffer();
        result.append("<tr><td>").append(HTMLUtils.escapeEntities(prompt))
            .append("&nbsp;</td>\n    <td colspan=10><select name='[")
            .append(rollupPrefix(rollupID)).append("]s'>");
        for (int i = 0;   i < instanceList.size();   i++) {
            String opt = HTMLUtils.escapeEntities((String) instanceList.get(i));
            result.append("\n<option value=\"").append(opt).append("\">")
                    .append(opt);
        }
        result.append("\n</select></td></tr>\n");
        return CACHE.put(rollupID, result.toString());
View Full Code Here

            return StringData.create(NC_LOC);
        if (DLD_LINES.equalsIgnoreCase(paramVal))
            return StringData.create(DLD_LINES);

        String processID = getStringData(request, "Process_ID");
        ListData allowedUnits = ListData.asListData(getData(request, //
            "/" + processID + "/Custom_Size_Metric_List"));
        if (allowedUnits == null)
            throw badRequest(UNSUPPORTED_TARGET_PATH, "Cannot store size ",
                "data; could not identify the process for task '",
                request.targetPath, "'");

        for (int i = 0; i < allowedUnits.size(); i++) {
            String oneUnit = allowedUnits.get(i).toString();
            if (paramVal.equalsIgnoreCase(oneUnit))
                return StringData.create(oneUnit);
        }

        throw badRequest(BAD_PARAM, "The sizeUnits parameter '", paramVal,
View Full Code Here

    }


    /** Construct an empty list. */
    protected static ListData newEmptyList() {
        ListData result = new ListData();
        result.setEditable(false);
        return result;
    }
View Full Code Here

        saveAllJoiningData(parameters);
        joinProject();
    }

    private void saveAllJoiningData(Map values) {
        ListData l = null;
        if (values.containsKey(PROJECT_ID)) {
            l = new ListData();
            l.add(values);
        }
        putValue(ALL_JOINING_DATA, l);
    }
View Full Code Here

    public List<ScriptID> getScripts(String path) {
        List<ScriptID> result = null;

        while (path != null) {
            String fullDataName = DataRepository.createDataName(path, dataName);
            ListData l = ListData.asListData(data.getSimpleValue(fullDataName));
            if (l != null && l.test()) {
                if (result == null)
                    result = new ArrayList<ScriptID>();

                for (int i = 0; i < l.size(); i++)
                    addScriptItem(result, l.get(i), path);
            }

            path = DataRepository.chopPath(path);
        }
View Full Code Here

    private List getProjectPaths() {
        DashHierarchy hier = getDashboardContext().getHierarchy();
        PropertyKey parent = hier.findExistingKey(getPrefix());
        int numKids = hier.getNumChildren(parent);
        List projectPaths = new ArrayList(numKids);
        ListData projectPathsData = new ListData();
        for (int i = 0;  i < numKids; i++) {
            PropertyKey child = hier.getChildKey(parent, i);
            projectPaths.add(child.path());
            projectPathsData.add(StringData.create(child.path()));
        }
        getDataRepository().putValue("///STUDATA_List", projectPathsData);
        return projectPaths;
    }
View Full Code Here

    }

    private void loadOrdinalData(DataContext data, String path) {
        String dataName = DataRepository.createDataName(path,
            NODE_ORDER_DATA_NAME);
        ListData list = ListData.asListData(data.getSimpleValue(dataName));
        if (list != null) {
            cacheInvalidator.listenToData(dataName);
            for (int i = 0; i < list.size(); i++) {
                String taskId = StringUtils.asString(list.get(i));
                getOrdinalData(taskId).put(path, i);
            }
        }
    }
View Full Code Here

        while (keys.hasNext()) {
            String dataName = (String) keys.next();
            if (!dataName.endsWith("/" + INSTRUCTIONS_DATANAME))
                continue;

            ListData l = ListData.asListData(data.getSimpleValue(dataName));
            if (l == null || !l.test())
                continue;

            for (int i = 1; i < l.size(); i += 2) {
                String id = l.get(i - 1).toString();
                if (cache.containsKey(id))
                    continue;

                String spec = l.get(i).toString();
                Element specXml;
                try {
                    specXml = parseSpec(spec).getDocumentElement();
                } catch (Exception e) {
                    specXml = null;
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.