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