Search in sources :

Example 31 with DashHierarchy

use of net.sourceforge.processdash.hier.DashHierarchy in project processdash by dtuma.

the class ScriptBrowserHTML method writeContents.

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>");
        for (int i = 1; i < scripts.size(); i++) writeScript(scripts.get(i));
    }
    out.write("</BODY></HTML>");
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) ScriptID(net.sourceforge.processdash.process.ScriptID) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 32 with DashHierarchy

use of net.sourceforge.processdash.hier.DashHierarchy in project processdash by dtuma.

the class ExternalResourceArchiverXMLv1 method getTeamProcessIDsInUse.

/** 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) {
                String oneProcessID = oneID.substring(0, slashPos);
                if (templateIDs.contains(oneProcessID))
                    result.add(oneProcessID);
            }
        }
    }
    return result;
}
Also used : Prop(net.sourceforge.processdash.hier.Prop) DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) Iterator(java.util.Iterator) HashSet(java.util.HashSet)

Example 33 with DashHierarchy

use of net.sourceforge.processdash.hier.DashHierarchy in project processdash by dtuma.

the class HierarchySynchronizer method doSync.

private void doSync() throws HierarchyAlterationException {
    phaseIDs = initPhaseIDs(processID);
    ListData nodeOrderData = new ListData();
    collectNodeOrderData(projectXML, nodeOrderData);
    getAllKnownWbsIds();
    Map<String, String> milestoneNames = syncMilestoneData(projectXML);
    ListData labelData = new ListData();
    ListData milestoneData = new ListData();
    if (isTeam()) {
        // for a team, get label data for all nodes in a project before
        // we prune the non-team nodes
        getLabelData(projectXML, milestoneNames, labelData, milestoneData);
        saveHierarchyFilterInfo(projectXML);
    }
    pruneWBS(projectXML, fullCopyMode, getNonprunableIDs(), Collections.EMPTY_SET);
    if (!isTeam()) {
        // for an individual, collect label data after pruning so we
        // only see labels that are relevant to our tasks.
        getLabelData(projectXML, milestoneNames, labelData, milestoneData);
        getScheduleData(projectXML);
    }
    changes = new ArrayList();
    discrepancies = new ListData();
    discrepancies.add(new Date());
    syncActions = buildSyncActions();
    SyncWorker syncWorker;
    if (whatIfMode) {
        DashHierarchy mockHierarchy = new DashHierarchy("");
        mockHierarchy.copy(this.hierarchy);
        this.hierarchy = mockHierarchy;
        syncWorker = new SyncWorkerWhatIf(dataRepository, mockHierarchy);
    } else {
        syncWorker = new SyncWorkerLive(dataRepository, deletionPermissions, completionPermissions);
    }
    if (debugLogInfo != null)
        syncWorker = SyncWorkerLogger.wrapWorker(syncWorker, debugLogInfo);
    this.data = syncWorker;
    forceData(projectPath, LABEL_LIST_DATA_NAME, labelData);
    forceData(projectPath, MILESTONE_LIST_DATA_NAME, milestoneData);
    forceData(projectPath, NODE_ORDER_DATA_NAME, nodeOrderData);
    forceData(projectPath, TeamDataConstants.CLOSED_PROJECT_FLAG, projectClosed ? ImmutableDoubleData.TRUE : null);
    if (!isTeam()) {
        syncSchedule();
        saveWorkflowUrlData();
        checkForUserInactivity();
    }
    sync(syncWorker, projectPath, projectXML);
    if (!isTeam())
        updateWorkflowPhasesInDefects();
    processDeferredDeletions(syncWorker);
    readChangesFromWorker(syncWorker);
    String discrepancyDataName = DataRepository.createDataName(projectPath, SyncDiscrepancy.DISCREPANCIES_DATANAME);
    dataRepository.putValue(discrepancyDataName, discrepancies);
    if (!whatIfMode || changes.isEmpty()) {
        String timestampDataName = DataRepository.createDataName(projectPath, TeamDataConstants.LAST_SYNC_TIMESTAMP);
        dataRepository.putValue(timestampDataName, new DateData());
    }
    // unneeded files from the team dashboard directory.
    if (isTeam() && !whatIfMode && !fullCopyMode && !syncWorker.getNodesDeleted().isEmpty()) {
        try {
            DashController.scrubDataDirectory();
            logger.info("HierarchySynchronizer scrubbed team " + "dashboard directory.");
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
}
Also used : DateData(net.sourceforge.processdash.data.DateData) DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) ArrayList(java.util.ArrayList) Date(java.util.Date) ListData(net.sourceforge.processdash.data.ListData) EVTaskListData(net.sourceforge.processdash.ev.EVTaskListData)

Example 34 with DashHierarchy

use of net.sourceforge.processdash.hier.DashHierarchy in project processdash by dtuma.

the class UserDataWriter method writeNewTasks.

private void writeNewTasks(XmlSerializer ser, String processID) throws IOException {
    DashHierarchy hier = getPSPProperties();
    PropertyKey projectRoot = hier.findExistingKey(getPrefix());
    String phaseDataName = HierarchySynchronizer.getEffectivePhaseDataName(processID);
    writeNewTasks(ser, hier, projectRoot, "root", phaseDataName);
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 35 with DashHierarchy

use of net.sourceforge.processdash.hier.DashHierarchy in project processdash by dtuma.

the class UserDataWriter method writeSizeData.

private void writeSizeData(XmlSerializer ser) throws IOException {
    DashHierarchy hier = getPSPProperties();
    PropertyKey projectRoot = hier.findExistingKey(getPrefix());
    if (projectRoot != null)
        writePspSizeData(ser, hier, projectRoot);
    ListData sizedObjects = ListData.asListData(getData("Sized_Object_List"));
    if (sizedObjects != null) {
        for (int i = sizedObjects.size(); i-- > 0; ) writeLocalObjectSizeData(ser, (String) sizedObjects.get(i));
    }
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) PropertyKey(net.sourceforge.processdash.hier.PropertyKey) ListData(net.sourceforge.processdash.data.ListData)

Aggregations

DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)56 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)40 ArrayList (java.util.ArrayList)7 ListData (net.sourceforge.processdash.data.ListData)6 List (java.util.List)5 HashMap (java.util.HashMap)4 DataRepository (net.sourceforge.processdash.data.repository.DataRepository)4 Point (java.awt.Point)3 Iterator (java.util.Iterator)3 ProcessDashboard (net.sourceforge.processdash.ProcessDashboard)3 SimpleData (net.sourceforge.processdash.data.SimpleData)3 TinyCGIException (net.sourceforge.processdash.net.http.TinyCGIException)3 IOException (java.io.IOException)2 Enumeration (java.util.Enumeration)2 HashSet (java.util.HashSet)2 LinkedList (java.util.LinkedList)2 HierarchyAlterer (net.sourceforge.processdash.hier.HierarchyAlterer)2 Prop (net.sourceforge.processdash.hier.Prop)2 DefectLog (net.sourceforge.processdash.log.defects.DefectLog)2 DefectLogID (net.sourceforge.processdash.log.defects.DefectLogID)2