Examples of DashHierarchy


Examples of net.sourceforge.processdash.hier.DashHierarchy

    protected void writeContents() throws IOException {
        String prefix = getPrefix();
        if (prefix == null) prefix = "";

        DashHierarchy props = getPSPProperties();
        PropertyKey key = props.findExistingKey(prefix);

        out.write("<HTML><HEAD>");
        out.write("<link rel=stylesheet type='text/css' href='/style.css'>");
        out.write("<TITLE>Hierarchy");
        if (prefix.length() > 0) {
            out.write(" - ");
            out.write(prefix);
        }
        out.write("</TITLE></HEAD><BODY>");
        if (prefix.length() > 0) {
            out.write("<B>");
            out.write(prefix);
            out.write("</B><BR>");
        }

        for (int i=0;   i < props.getNumChildren(key);   i++)
            writeNode(props, props.getChildKey(key, i));

        List<ScriptID> scripts = ScriptEnumerator.getScripts(
            getDashboardContext(), key);
        if (scripts != null && scripts.size() != 0) {
            out.write("<hr>");
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

        List result = new ArrayList();
       
        Enumeration leafNames = getInheritedPhaseList(defectPath, context
                .getData());
        if (leafNames == null) {
            DashHierarchy hier = context.getHierarchy();
            PropertyKey defectPathKey = hier.findExistingKey(defectPath);
            if (defectPathKey == null)
                return result;
            leafNames = hier.getLeafNames(defectPathKey);
            prefixLength = defectPath.length() + 1;
        }
       
        while (leafNames.hasMoreElements()) {
            String item = (String) leafNames.nextElement();
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

            return taskPath.substring(prefixLength);
   
        // no luck so far.  Look at the task in question, and see if it only
        // includes a single phase child (typical for old-style team projects
        // with phase stubs).
        DashHierarchy hier = context.getHierarchy();
        PropertyKey defectPathKey = hier.findExistingKey(defectPath);
        if (defectPathKey != null) {
            Enumeration leafNames = hier.getLeafNames(defectPathKey);
            List possibleMatches = new ArrayList();
            while (leafNames.hasMoreElements()) {
                String oneLeaf = (String) leafNames.nextElement();
                if (oneLeaf.length() > prefixLength) {
                    String leafTail = oneLeaf.substring(prefixLength);
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

    }

    private DashHierarchy getAugmentedHierarchy() {

        // create a copy of the standard hierarchy
        DashHierarchy result = new DashHierarchy(getPSPProperties().dataPath);
        result.copy(getPSPProperties());

        // find the leaves in the hierarchy, and augment each leaf with
        // supplementary children provided from data element specifications
        DataRepository data = getDataRepository();
        Enumeration<PropertyKey> leaves = result.getLeaves(PropertyKey.ROOT);
        while (leaves.hasMoreElements()) {
            PropertyKey leaf = leaves.nextElement();
            augmentHierarchy(result, leaf, data);
        }
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

            unit = units;
        }
        HTMLUtils.appendQuery(uri, "Unit", unit);
        HTMLUtils.appendQuery(uri, "Units", units);

        DashHierarchy props = getPSPProperties();
        PropertyKey self = props.findExistingKey(getPrefix());
        int numPhases = props.getNumChildren(self);
        for (int i = 0;  i < numPhases;  i++)
            HTMLUtils.appendQuery(uri, "Phases",
                props.getChildKey(self, i).name());

        String text = getRequestAsString(uri.toString());
        out.write(text);
    }
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

    private boolean prefixNamesTeamProjectStub() {
        return pathNamesTeamProjectStub(getPrefix());
    }

    private boolean pathNamesTeamProjectStub(String path) {
        DashHierarchy hierarchy = getPSPProperties();
        PropertyKey key = hierarchy.findExistingKey(path);
        String templateID = hierarchy.getID(key);
        return TEAM_STUB_ID.equals(templateID);
    }
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

        // compute the desired effective path.
        String nodeLocation = tweakLocation(getValue(NODE_LOCATION));
        String nodePath = nodeLocation + "/" + nodeName;

        // does a node already exist in the hierarchy with this path?
        DashHierarchy hier = getPSPProperties();
        PropertyKey key = hier.findExistingKey(nodePath);
        if (key != null) {
            // if the preexisting node is a team project stub, all is well.
            if (TEAM_STUB_ID.equals(hier.getID(key)))
                return nodePath;
            else
                return "duplicateName";
        } else {
            // look at the ancestors of the target path, and make certain that
            // they are all plain nodes
            key = hier.findClosestKey(nodePath);
            while (key != null) {
                if (StringUtils.hasValue(hier.getID(key)))
                    return "invalidParent";
                key = key.getParent();
            }
        }
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

        }
    }


    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

Examples of net.sourceforge.processdash.hier.DashHierarchy

        StudataExporterXml.writeXmlData(out, profileData, projectPaths, data);
        out.close();
    }

    private String getStudentProfilePath() {
        DashHierarchy hier = getDashboardContext().getHierarchy();
        PropertyKey parent = hier.findExistingKey(getPrefix());
        int numKids = hier.getNumChildren(parent);
        for (int i = 0;  i < numKids;  i++) {
            PropertyKey child = hier.getChildKey(parent, i);
            String path = child.path();
            if (hasTag(path, "PspForEngV3_Student_Profile"))
                return path;           
        }
       
View Full Code Here

Examples of net.sourceforge.processdash.hier.DashHierarchy

    }

    /** Get the list of PSP3 cycle names under the current PSP3 task. */
    private String[] getCycleList() {
        String prefix = (String) env.get("PATH_TRANSLATED");
        DashHierarchy props = getPSPProperties();
        PropertyKey self = props.findExistingKey(prefix);
        // WARNING: the "4" on the next line is a magic number which
        // depends on the structure of the PSP3 template.
        int numCycles = props.getNumChildren (self) - 4;
        if (numCycles < 0) numCycles = 0;
        String [] result = new String[numCycles];
        while (numCycles-- > 0)
            // WARNING: the "3" on the next line is a magic number which
            // depends on the structure of the PSP3 template.
            result[numCycles] = props.getChildKey(self, numCycles+3).name();

        return result;
    }
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.