Package net.sourceforge.processdash.hier

Examples of net.sourceforge.processdash.hier.PropertyKey


        }
        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());
View Full Code Here


     * the Size Inventory Form, and return the complete data repository prefix
     * for that empty row.
     */
    private String getTargetPrefix(SizeMetricApiRequestData request) {
        // make certain a task exists in the hierarchy at the specified path
        PropertyKey pathKey = request.ctx.getHierarchy().findExistingKey(
            request.targetPath);
        if (pathKey == null)
            return null;

        // make certain the task is an Indiv node within a team project
View Full Code Here

        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

    private void maybeSetDefaultProjectPath() {
        // Look for an existing, unused stub in the hierarchy.  If one is
        // found, use its name and location and exit.  Users will still be
        // able to overwrite these values; but this helps them to pick up
        // where they left off if they got confused.
        PropertyKey stub = findUnusedTeamProjectStub(getPSPProperties(),
            PropertyKey.ROOT);
        if (stub != null) {
            putValue(NODE_NAME, stub.name());
            putValue(NODE_LOCATION, stub.getParent().path());
            return;
        }

        // if the prefix is not set, set it to the localized default location.
        if (!StringUtils.hasValue(getValue(NODE_LOCATION))) {
View Full Code Here

        if (TEAM_STUB_ID.equals(hier.getID(node))) {
            return node;

        } else {
            for (int i = hier.getNumChildren(node);  i-- > 0; ) {
                PropertyKey result = findUnusedTeamProjectStub(hier,
                    hier.getChildKey(node, i));
                if (result != null)
                    return result;
            }
            return null;
View Full Code Here

        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();
            }
        }

        // path seems OK
        return nodePath;
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

        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;           
        }
       
        // no student profile was found.  Create an imaginary one; it will
View Full Code Here

    /** 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];
View Full Code Here

        for (ScriptEnumeratorListener l : notifyList)
            l.scriptChanged(evt);
    }

    public static List<ScriptID> getScripts(DashboardContext ctx, String path) {
        PropertyKey key = ctx.getHierarchy().findClosestKey(path);
        return getScripts(ctx, key);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.hier.PropertyKey

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.