Package net.sourceforge.processdash.hier

Examples of net.sourceforge.processdash.hier.DashHierarchy$Event


        // 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


        }
    }


    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

        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

    }

    /** 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

    /** Get the IDs of all team processes in use by this dashboard dataset */
    private Set<String> getTeamProcessIDsInUse() {
        Set<String> templateIDs = getTeamProcessIDs();

        Set<String> result = new HashSet<String>();
        DashHierarchy hier = dashboardContext.getHierarchy();
        for (Iterator i = hier.values().iterator(); i.hasNext();) {
            Prop prop = (Prop) i.next();
            String oneID = prop.getID();
            if (oneID != null && oneID.endsWith("Root")) {
                int slashPos = oneID.indexOf('/');
                if (slashPos != -1) {
View Full Code Here

                TaskNameInfo info = new TaskNameInfo(path, pref--);
                addToCache(newCache, taskID, info);
            }
        }
       
        DashHierarchy hierarchy = context.getHierarchy();
        for (int i = hierarchy.getNumChildren(key);  i-- > 0; )
            findTasksInHierarchy(newCache, hierarchy.getChildKey(key, i));
    }
View Full Code Here

        SimpleData sd = ctx.getData().getSimpleValue(dataName);
        if (sd != null && projectID.equals(sd.format())) {
            throw new AlreadyJoinedException();

        } else {
            DashHierarchy hier = ctx.getHierarchy();
            int i = hier.getNumChildren(key);
            while (i-- > 0) {
                PropertyKey childKey = hier.getChildKey(key, i);
                checkAlreadyJoined(ctx, childKey, projectID);
            }
        }
    }
View Full Code Here

  public void startTimeLog() {
      startTimeLog(null);
  }

  public void startTimeLog(PropertyKey phase) {
      DashHierarchy hier = parent.getProperties();
      if (phase == null)
          phase = parent.getCurrentPhase();
     
        if (hier != null) {
            if (time_frame != null) {
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        eventsReceived = new LinkedList();
        expectedTimes = new HashMap();
        data = new MockDataContext();
        hier = new DashHierarchy(null);
        hier.loadXML(openFile("hier3.xml"), new DashHierarchy(null));
       
        createModels();

        activeTaskModel = new MockActiveTaskModel(hier);
        timeLoggingModel.setActiveTaskModel(activeTaskModel);
View Full Code Here

    private static long templateTimestamp = 0;
   
    public static DashHierarchy loadTemplates(DataRepository data) {
        LOAD_TEMPLATES_PERMISSION.checkPermission();

        DashHierarchy templates = new DashHierarchy(null);
        ProfTimer pt = new ProfTimer(TemplateLoader.class,
            "TemplateLoader.loadTemplates");

        URL[] roots = getTemplateURLs();
        pt.click("Got template roots");
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.hier.DashHierarchy$Event

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.