Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-06-25 12:22:20 -0400
committerGerrit Code Review @ Eclipse.org2013-07-01 13:56:45 -0400
commit685a832a2f7de39da816a023fc4dce19980c918f (patch)
tree139fcbc4b88cc8ff83d177ad0b8d394cac16b02d
parent8a48482ed233637b116965cce4721c3ee85e36df (diff)
downloadorg.eclipse.osee-685a832a2f7de39da816a023fc4dce19980c918f.tar.gz
org.eclipse.osee-685a832a2f7de39da816a023fc4dce19980c918f.tar.xz
org.eclipse.osee-685a832a2f7de39da816a023fc4dce19980c918f.zip
refactor[ats_GF4YG]: Update change report export to support ids only
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
index d3b542c0d1..a16303ce32 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
@@ -22,6 +22,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
@@ -35,6 +36,7 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.change.ArtifactChange;
import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta;
@@ -53,16 +55,18 @@ public final class ExportChangeReportOperation extends AbstractOperation {
private final List<TeamWorkFlowArtifact> workflows;
private final Appendable resultFolder;
private final boolean reverse;
+ private final boolean writeChangeReports;
- public ExportChangeReportOperation(List<TeamWorkFlowArtifact> workflows, boolean reverse, Appendable resultFolder) {
+ public ExportChangeReportOperation(List<TeamWorkFlowArtifact> workflows, boolean reverse, boolean writeChangeReports, Appendable resultFolder) {
super("Exporting Change Report(s)", Activator.PLUGIN_ID);
this.workflows = workflows;
this.reverse = reverse;
+ this.writeChangeReports = writeChangeReports;
this.resultFolder = resultFolder;
}
public ExportChangeReportOperation(List<TeamWorkFlowArtifact> workflows, boolean reverse) {
- this(workflows, reverse, new StringBuilder());
+ this(workflows, reverse, true, new StringBuilder());
}
@Override
@@ -93,12 +97,19 @@ public final class ExportChangeReportOperation extends AbstractOperation {
if (!changes.isEmpty() && changes.size() < 4000) {
String id =
workflow.getSoleAttributeValueAsString(AtsAttributeTypes.LegacyPcrId, workflow.getHumanReadableId());
-
- Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes);
String prefix = "/" + id;
- RendererManager.diff(collector, artifactDeltas, prefix, NO_DISPLAY, true, SKIP_DIALOGS, true);
+ if (writeChangeReports) {
+
+ Collection<ArtifactDelta> artifactDeltas = ChangeManager.getCompareArtifacts(changes);
+ RendererManager.diff(collector, artifactDeltas, prefix, NO_DISPLAY, true, SKIP_DIALOGS, true);
+ }
String artIdsAsString = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",", artIds);
try {
+ if (resultFolder.toString().isEmpty()) {
+ IFolder folder = OseeData.getFolder("ids");
+ File idsFolder = new File(folder.getLocationURI());
+ resultFolder.append(idsFolder.getAbsolutePath());
+ }
Lib.writeStringToFile(artIdsAsString, new File(resultFolder + prefix + "_ids.txt"));
} catch (IOException ex) {
OseeExceptions.wrapAndThrow(ex);

Back to the top