Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java38
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java14
2 files changed, 35 insertions, 17 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
index 62522a67197..4c157cd2c60 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ExportChangeReportsAction.java
@@ -141,21 +141,8 @@ public class ExportChangeReportsAction extends Action {
RenderingUtil.setPopupsAllowed(false);
for (Artifact workflow : workflows) {
- AtsBranchManager atsBranchMgr = ((TeamWorkFlowArtifact) workflow).getBranchMgr();
- Collection<Change> changes = new ArrayList<Change>();
- IOperation operation = null;
- if (atsBranchMgr.isCommittedBranchExists()) {
- operation = ChangeManager.comparedToPreviousTx(pickTransaction(workflow), changes);
- } else {
- Branch workingBranch = atsBranchMgr.getWorkingBranch();
- if (workingBranch != null && !workingBranch.getBranchType().isBaselineBranch()) {
- operation = ChangeManager.comparedToParent(workingBranch, changes);
- }
- }
- if (operation != null) {
- doSubWork(operation, monitor, 0.50);
- }
+ Collection<Change> changes = computeChanges(workflow, monitor);
if (!changes.isEmpty() && changes.size() < 4000) {
String folderName = workflow.getSoleAttributeValueAsString(AtsAttributeTypes.LegacyPcrId, null);
IOperation subOp = new WordChangeReportOperation(changes, folderName);
@@ -166,5 +153,26 @@ public class ExportChangeReportsAction extends Action {
}
RenderingUtil.setPopupsAllowed(true);
}
+
+ private Collection<Change> computeChanges(Artifact workflow, IProgressMonitor monitor) throws OseeCoreException {
+ AtsBranchManager atsBranchMgr = ((TeamWorkFlowArtifact) workflow).getBranchMgr();
+
+ List<Change> changes = new ArrayList<Change>();
+ IOperation operation = null;
+ if (atsBranchMgr.isCommittedBranchExists()) {
+ operation = ChangeManager.comparedToPreviousTx(pickTransaction(workflow), changes);
+ } else {
+ Branch workingBranch = atsBranchMgr.getWorkingBranch();
+ if (workingBranch != null && !workingBranch.getBranchType().isBaselineBranch()) {
+ operation = ChangeManager.comparedToParent(workingBranch, changes);
+ }
+ }
+ if (operation != null) {
+ doSubWork(operation, monitor, 0.50);
+
+ Collections.sort(changes);
+ }
+ return changes;
+ }
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
index eb86a85a99d..c4b1d6940fa 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
@@ -22,7 +22,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
* @author Jeff C. Phillips
*/
-public abstract class Change implements IAdaptable {
+public abstract class Change implements IAdaptable, Comparable<Change> {
private final long sourceGamma;
private final int artId;
private final TransactionDelta txDelta;
@@ -149,4 +149,14 @@ public abstract class Change implements IAdaptable {
}
return null;
}
-}
+
+ @Override
+ public String toString() {
+ return getName();
+ }
+
+ @Override
+ public int compareTo(Change o) {
+ return getName().compareTo(o.getName());
+ }
+} \ No newline at end of file

Back to the top